Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tile not found - pmtiles file, I know the tiles exist #675

Closed
tobinbradley opened this issue May 24, 2023 · 6 comments
Closed

Tile not found - pmtiles file, I know the tiles exist #675

tobinbradley opened this issue May 24, 2023 · 6 comments

Comments

@tobinbradley
Copy link

I've been digging through the code trying to figure out what's going on with this, but I've hit the limits of my Rust skills, which are approximately none.

I have a PMTiles file (~200mb) that I converted from a MBTiles file using go-pmtiles. If I look at it with the pmtiles preview tool, works fine. I server it with go-pmtiles, works fine. I consume it with the PMTiles client-side JS library in MapLibre GL, works fine. I try serving it with martin, and with every request I get tile not found, ex:

Tile 7/35/50 not found in tiles-pmtiles

I tried turning debuggin on, and it doesn't say much more (at least to my stupid eyes):

[2023-05-24T21:45:17Z ERROR martin::srv::server] Tile 7/35/50 not found in tiles-pmtiles
[2023-05-24T21:45:17Z DEBUG actix_web::middleware::logger] Error in response: "Tile 7/35/50 not found in tiles-pmtiles"
[2023-05-24T21:45:17Z INFO  actix_web::middleware::logger] 127.0.0.1 "GET /tiles-pmtiles/7/35/50 HTTP/1.1" 500 39 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36" 0.000065
[2023-05-24T21:45:18Z DEBUG actix_web::middleware::logger] Error in response: "Source service-worker.js does not exist"
[2023-05-24T21:45:18Z INFO  actix_web::middleware::logger] 127.0.0.1 "GET /service-worker.js HTTP/1.1" 404 62 "http://localhost:3000/service-worker.js" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36" 0.000314

This happens on both Linux and Windows binary releases and on martin built from the latest source on Linux, so it doesn't appear to be a platform/build issue.

My guess is the ZXY isn't getting translated correctly via thePMTiles header info, which means this might be a bug in the pmtiles crate and not in martin itself. But my rust skills don't extend much past the swearing stage, so I could be totally wrong.

@nyurik
Copy link
Member

nyurik commented May 24, 2023

@tobinbradley i guess it will be mega-hard for me to debug it without the original data file. Do you think you somehow can make it much much smaller while still having the bug manifest itself? This way we can add that tiny pmtiles file to the CI, and ensure that it passes all the tests. BTW, this would be part of the https://crates.io/crates/pmtiles crate.

@nyurik
Copy link
Member

nyurik commented May 24, 2023

oh, silly me, you did post the pmtiles file! I will try to play with it to see if i can reproduce the issue locally!

@nyurik
Copy link
Member

nyurik commented May 24, 2023

(but still - see if you can generate a tiny subset of it, ideally with just one tile)

@nyurik
Copy link
Member

nyurik commented May 25, 2023

I think i found the culprit - stadiamaps/pmtiles-rs#17, but it would be awesome to create a lot more tiny test fixture files, where each tile is just a few bytes long with some sequential numbers.

nyurik added a commit to nyurik/pmtiles-rs that referenced this issue May 25, 2023
nyurik added a commit to stadiamaps/pmtiles-rs that referenced this issue May 25, 2023
@tobinbradley
Copy link
Author

Thank you so much! I set Cargo.toml to pmtiles = { version = "0.2.2"..., built martin and it finds the tiles perfectly!

I really appreciate you tracking this down in the pmtiles dependency. That's going above and beyond. To paraphrase Jon "maddog" Hall, you will never pay for a beer in my presence.

Tnanks again!

@nyurik
Copy link
Member

nyurik commented May 25, 2023

you are very welcome. This should be part of the v0.8.4 release too (should be published in the next few minutes)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants