-
Notifications
You must be signed in to change notification settings - Fork 691
feat: Add ignore-missing-files cli option to avoid crashing at startup #1896
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
feat: Add ignore-missing-files cli option to avoid crashing at startup #1896
Conversation
|
I had the same issue with some styles using optional data files and solved it with a script, which generated a valid config/stubbed files and reloaded the tileserver on demand. I like this as I could drop some of the stubbed stuff 👍 |
This reverts commit f04b3ad.
…erve_style.js now
fb5e974 to
332fc77
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested these changes and everything works as expected, but only if the data source is configured: If there is a unconfigured data source in the style, we will have the previous behaviour.
This fixed the issue for me: okimiko@cc9cff8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Made the suggested changes and tested it on my end.
…rewlaguna824/tileserver-gl into andrewlaguna824/ignore-missing-files
okimiko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine for me now 👍
Add
--ignore-missing-filesflag to prevent crash on startupProblem
When deploying tileserver-gl, the application crashes during startup if any configured mbtiles/pmtiles files don't exist.
This currently causes an issue in our deployments where large files, such as mbtiles, are loaded separately.
Concretely, the issue is that since files are required on startup, our k8s pod running tileserver-gl will crash loop until
the configured files are available in storage. However, since the pod is crash looping, we are unable to transfer the files
to storage.
Right now, we have a workaround to either load tileserver-gl with an empty config at first or to hack the pod startup into an
infinite sleep loop while we load the tiles into storage. This makes deployments manual and configuration management cumbersome.
Solution
This PR adds a new
--ignore-missing-filesCLI flag that allows tileserver-gl to start successfully even when some configured data sources are missing. When enabled:The default behavior remains unchanged to maintain backward compatibility.
Usage
# Start with the flag to ignore missing files tileserver-gl --config config.json --ignore-missing-filesTesting
With Flag and Missing MBTiles
Log Warnings at Startup
Problematic Style Not in Repository
Problematic Style Returns 404 for Rendered Tile
Problematic Datasource Returns 404
Without Flag and Missing MBTiles (original behavior)