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

Cloudflare Worker: Promise will never complete #502

Open
Colleoni opened this issue Nov 29, 2024 · 6 comments
Open

Cloudflare Worker: Promise will never complete #502

Colleoni opened this issue Nov 29, 2024 · 6 comments

Comments

@Colleoni
Copy link

Colleoni commented Nov 29, 2024

I am currently testing a PMTiles deploy using Cloudflare as the CDN following the documentation.

I have completed the guide and tested everything on maputnik using a source data layer of type: Vector (TileJSON url).
However, for zooms over level 6 I receive a 500 error. (example url: planet-20241004/6/33/22.mvt)

So, I have extracted the mvt request and called it from a browser, in which Cloudflare response with

Error 1101: Worker threw exception

In order to further investigate the problem, I have also enabled worker logs, which basically contains the message

"exceptions": [
    {
      "name": "Error",
      "message": "Promise will never complete.",
      "timestamp": 1732890215379
    }
  ],

I have tried to deploy the worker both Manually and using the wrangler script.
Initially I had the problem that I was not on the paid worker plan, but then I noticed it and I have activated it.

Do you have any suggestion? Am I missing something?

@bdon
Copy link
Member

bdon commented Nov 29, 2024

I just tried using a worker with the index.js linked here: https://docs.protomaps.com/deploy/cloudflare , setting the r2 BUCKET binding and an ALLOWED_ORIGINS to https://maplibre.org, then loading the TileJSON in Maputnik and zooming to 15 without issues. Is this happening intermittently for you or 100% of the time?

@Colleoni
Copy link
Author

Thank for you help and time.
It happens 100%, only low resolution tiles are downloaded

@bdon
Copy link
Member

bdon commented Nov 29, 2024

Is your planet-20241004 download from maps.protomaps.com/builds or from a different source?

@Colleoni
Copy link
Author

I did not notice it, but apparently you pointed in the right direction it is not from protomaps build.
I think it is generated with a different tool. I really did not thought about this because I am currently using the same file on a test server which uses tileserver-gl and it works. I will check with a photomaps build.
I was probably looking into the wrong direction.... Cloudflare resource etc...

@bdon
Copy link
Member

bdon commented Nov 30, 2024

If you can share your file that will help debug, also you can use the command pmtiles verify https://docs.protomaps.com/pmtiles/cli#verify to check the structure of the file, in case it is invalid somehow

@Colleoni
Copy link
Author

OK, I can confirm it is definitely the file.
I have tried the verify command following your suggestion, but it simply output

Completed verify in 20.003737981s.

I will try to re-upload the data on r2 and see. Sure no problem in sharing it, it is 70gb, I only need to find how to correctly share it, probably using r2.

I think the file was generated using osmium-tool, but I will try to confirm also this.
Thank you gain for your help

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