mapbox / mapbox/tippecanoe

"JSON metadata file is not valid" when serving mbtiles with tileserver.php

Open
#802 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
3.1k
Forks
430
PR merge metrics
No merged PRs in 30d

Description

I'm trying to serve mbtiles generated with tippecanoe using tileserver-php. The server crashes with a JavaScript alert:

"JSON metadata file is not valid."

I traced it down to the /tilserver/index.json request which returns a JSON file that JavaScript thinks is not proper JSON.

The problem occurs in the generator_options, which looks like this for me:

"generator_options": "tippecanoe --force -o output.mbtiles '--maximum-zoom=16' --drop-densest-as-needed -rg input.geojson",

Removing the single quotes around --maximum-zoom=16 generator_options fixes the issue.

This seems like a duplicate of #459, but there the problem was the json field.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the /tilserver/index.json response with an MBTiles file generated by tippecanoe using the shown generator_options. Inspect how generator_options is serialized into the JSON metadata and verify that the resulting response parses as valid JSON without unwanted single quotes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.