dosubot[bot] commented on issue #33606: URL: https://github.com/apache/superset/issues/33606#issuecomment-2916592364
<!-- Greeting --> Hi @kdemirov! I'm [Dosu](https://go.dosu.dev/dosubot) and Iām helping the superset team. <!-- Answer --> For MapBox charts returning a 404 in production but working locally, here are the most likely causes and steps to troubleshoot: 1. **MAPBOX_API_KEY not set in production**: The MapBox chart requires a valid API key. In Superset, this is configured via the `MAPBOX_API_KEY` environment variable. If this is missing or empty in your production `.env` or environment configuration, MapBox charts will fail to load. Double-check that your production environment has a valid MapBox API key set (not just locally) and that it is accessible to the Superset process. See [here](https://github.com/apache/superset/blob/master/docker/.env) and [here](https://github.com/apache/superset/blob/master/docs/docs/faq.mdx). 2. **Content Security Policy (CSP) restrictions**: Production environments often have stricter CSP settings. MapBox charts need to connect to `https://api.mapbox.com` and `https://events.mapbox.com`. If your CSP does not allow these domains in `connect-src`, MapBox resources will be blocked, resulting in errors or missing maps. You can adjust CSP settings in Superset using `superset_config.py` and Talisman. See [the security docs](https://github.com/apache/superset/blob/master/docs/docs/security/security.mdx). 3. **Network or firewall issues**: Ensure your production server can reach MapBox endpoints. Firewalls, proxies, or outbound network restrictions can block these requests, causing failures that may not appear in Superset logs. 4. **API key usage limits or invalid key**: If your API key is invalid or has exceeded its usage limits, MapBox will return errors. Make sure the key is valid and has sufficient quota. 5. **No errors in Superset logs**: Since you see no errors in the logs and the chart exists in the database, the issue is almost certainly environmental (API key, CSP, or network). **Action steps:** - Confirm `MAPBOX_API_KEY` is set and non-empty in your production environment. - Check your CSP settings to ensure `https://api.mapbox.com` and `https://events.mapbox.com` are allowed. - Verify network connectivity from your production server to MapBox endpoints. - Make sure your API key is valid and not rate-limited. If you address these areas and the issue persists, please share any browser console errors or network request failures you see when loading a MapBox chart in production. This can help pinpoint whether the problem is with the frontend, backend, or network configuration. <!-- Dosu Comment Footer --> *To reply, just mention my name [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/f9de356c-e99a-471c-864c-93b42662741c?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/f9de356c-e99a-471c-864c-93b42662741c?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/f9de356c-e99a-471c-864c-93b42662741c?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/f9de356c-e99a-471c-864c-93b42662741c?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/f9de356c-e99a-471c-864c-93b42662741c?feedback_type=hallucination) | [Report š](https://app.dosu.dev/response-feedback/f9de356c-e99a-471c-864c-93b42662741c?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/f9de356c-e99a-471c-864c-93b42662741c?feedback_type=other)</sup> [](https://go.dosu.dev/discord-bot) [! [Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/33606) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
