You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "juliacebria (via GitHub)" <gi...@apache.org> on 2025/01/31 07:36:22 UTC
[I] Unable to Retrieve Cached Screenshot from Superset API [superset]
juliacebria opened a new issue, #32057:
URL: https://github.com/apache/superset/issues/32057
### Discussed in https://github.com/apache/superset/discussions/32056
<div type='discussions-op-text'>
<sup>Originally posted by **juliacebria** January 31, 2025</sup>
I am trying to generate and retrieve a dashboard screenshot from Apache Superset using the /cache_dashboard_screenshot/ and /screenshot/{cache_key}/ API endpoints. The request to generate the screenshot returns a 202 Accepted response along with a cache_key, but when attempting to retrieve the screenshot using this cache_key, I receive a 404 Not Found error.
Steps to Reproduce
Send a POST request to:
http://localhost:8088/api/v1/dashboard/2/cache_dashboard_screenshot/
with the following payload:
{
"dataMask": {
"filters": [
{"col": "name", "op": "IN", "val": ["Aaron"]}
]
}
}
Response:
{
"cache_key": "60d0f310ff6af584fd30ea53e217c0d6",
"dashboard_url": "http://superset:8088/superset/dashboard/p/jJAxQlyLVYm/",
"image_url": "http://superset:8088/api/v1/dashboard/2/screenshot/60d0f310ff6af584fd30ea53e217c0d6/"
}
Wait for 15 seconds to ensure the screenshot is processed.
Send a GET request to retrieve the screenshot:
http://localhost:8088/api/v1/dashboard/2/screenshot/60d0f310ff6af584fd30ea53e217c0d6/
Response:
{
"message": "Not found"
}
Status Code: 404 Not Found
Additional Information
Running Superset in a Docker Compose environment.
The issue persists even after waiting longer before retrieving the screenshot.
The dashboard exists.
</div>
--
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: notifications-unsubscribe@superset.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Unable to Retrieve Cached Screenshot from Superset API [superset]
Posted by "juliacebria (via GitHub)" <gi...@apache.org>.
juliacebria commented on issue #32057:
URL: https://github.com/apache/superset/issues/32057#issuecomment-2627229071
This is the cache configuration:
REDIS_HOST = os.getenv("REDIS_HOST", "redis")
REDIS_PORT = os.getenv("REDIS_PORT", "6379")
REDIS_CELERY_DB = os.getenv("REDIS_CELERY_DB", "0")
REDIS_RESULTS_DB = os.getenv("REDIS_RESULTS_DB", "1")
RESULTS_BACKEND = FileSystemCache("/app/superset_home/sqllab")
CACHE_CONFIG = {
"CACHE_TYPE": "RedisCache",
"CACHE_DEFAULT_TIMEOUT": 300,
"CACHE_KEY_PREFIX": "superset_",
"CACHE_REDIS_HOST": REDIS_HOST,
"CACHE_REDIS_PORT": REDIS_PORT,
"CACHE_REDIS_DB": REDIS_RESULTS_DB,
}
DATA_CACHE_CONFIG = CACHE_CONFIG
Ans I have the flags enabled:
FEATURE_FLAGS = {"ALERT_REPORTS": True,
"THUMBNAILS": True,
"THUMBNAILS_SQLA_LISTENERS": True,
"ENABLE_DASHBOARD_SCREENSHOT_ENDPOINTS": True}.
I don't know where the problem is. @dosu help me please
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Unable to Retrieve Cached Screenshot from Superset API [superset]
Posted by "mistercrunch (via GitHub)" <gi...@apache.org>.
mistercrunch closed issue #32057: Unable to Retrieve Cached Screenshot from Superset API
URL: https://github.com/apache/superset/issues/32057
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Unable to Retrieve Cached Screenshot from Superset API [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #32057:
URL: https://github.com/apache/superset/issues/32057#issuecomment-2626493610
<!-- Answer -->
I found some similar discussions and issues that might be relevant to your problem:
1. [Unable to get a screenshot of a chart](https://github.com/apache/superset/discussions/27760) - This discussion is unsolved and was last updated on October 3, 2024 <sup>[[1]](https://github.com/apache/superset/discussions/27760)</sup>.
2. [API /chart/{pk}/cache_screenshot/](https://github.com/apache/superset/discussions/18281) - Another unsolved discussion, last updated on May 8, 2023 <sup>[[2]](https://github.com/apache/superset/discussions/18281)</sup>.
3. [Dashboard Screenshot API Endpoint Gives an Error Message when a Dashboard is Empty or has no Charts](https://github.com/apache/superset/issues/30736) - This issue was closed by a pull request that fixed the problem of downloading a screenshot of an empty dashboard <sup>[[3]](https://github.com/apache/superset/issues/30736)</sup>.
Regarding the 404 Not Found error when retrieving the screenshot, here are some potential reasons based on the Superset API behavior:
- The `cache_key` might not correspond to a valid cached screenshot. If the screenshot is not found in the cache, a 404 error is returned <sup>[[4]](https://github.com/apache/superset/blob/master/tests/integration_tests/dashboards/api_tests.py)</sup>.
- Ensure that the "THUMBNAILS" feature is enabled, as the endpoint will return a 404 error if this feature is not active <sup>[[5]](https://github.com/apache/superset/blob/master/superset/dashboards/api.py)</sup>.
- There might be an issue with the caching mechanism in your Docker Compose environment. Proper configuration of the caching layer, often using Redis, is crucial for the efficient caching and retrieval of screenshots <sup>[[6]](https://github.com/apache/superset/blob/master/docs/docs/installation/architecture.mdx)</sup>.
You might want to verify these aspects to troubleshoot the issue further.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
---
<sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/39a1f597-2349-446f-8e5c-95c59ca4c46f?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/39a1f597-2349-446f-8e5c-95c59ca4c46f?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/39a1f597-2349-446f-8e5c-95c59ca4c46f?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/39a1f597-2349-446f-8e5c-95c59ca4c46f?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/39a1f597-2349-446f-8e5c-95c59ca4c46f?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/39a1f597-2349-446f-8e5c-95c59ca4c46f?feedback_type=other)</sup>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Unable to Retrieve Cached Screenshot from Superset API [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #32057:
URL: https://github.com/apache/superset/issues/32057#issuecomment-2627238256
<!-- Answer -->
Given your configuration, here are a few things to check and consider:
1. **Redis Configuration**: Ensure that your Redis service is running and accessible from your Superset instance. You can test connectivity to Redis using a Redis client or command-line tool to verify that the host and port are correct.
2. **Cache Key Validity**: The `cache_key` might not correspond to a valid cached screenshot if the screenshot generation process hasn't completed successfully. Ensure that the task responsible for generating the screenshot is running without errors. You can check the logs for any errors related to screenshot generation.
3. **Task Execution**: Verify that the Superset worker is processing tasks correctly. The worker should be able to handle background tasks, including screenshot generation. Check the logs for the `superset-worker` service to ensure there are no errors or issues.
4. **Timeouts and Delays**: Sometimes, the screenshot generation might take longer than expected. Try increasing the wait time before attempting to retrieve the screenshot to ensure the task has completed.
5. **Logs and Errors**: Check the Superset logs for any error messages or warnings that might indicate why the screenshot is not being cached or retrieved. This can provide insights into any underlying issues.
6. **Database and Execution Logs**: Ensure that the database is correctly logging the execution of screenshot tasks. The `ReportExecutionLog` entries can help track the status and any errors during execution.
If these checks do not resolve the issue, consider reviewing the Superset worker and Redis configurations to ensure they align with the expected setup for caching and task execution.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
---
<sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/c162e73f-419b-4deb-a4df-ef2475354a8b?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/c162e73f-419b-4deb-a4df-ef2475354a8b?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/c162e73f-419b-4deb-a4df-ef2475354a8b?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/c162e73f-419b-4deb-a4df-ef2475354a8b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/c162e73f-419b-4deb-a4df-ef2475354a8b?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/c162e73f-419b-4deb-a4df-ef2475354a8b?feedback_type=other)</sup>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org