dosubot[bot] commented on issue #33561:
URL: https://github.com/apache/superset/issues/33561#issuecomment-2901300490

   <!-- Answer -->
   Based on your detailed description, configuration, and logs, here’s what is 
known about the issue embedding Superset dashboards with guest tokens and 
GLOBAL_ASYNC_QUERIES enabled (with polling):
   
   - The problem only occurs when GLOBAL_ASYNC_QUERIES is True and 
GLOBAL_ASYNC_QUERIES_TRANSPORT is set to "polling". With async queries off, 
embedding works as expected.
   - The error message “Unexpected Error - See More” and the session 
interruption warning suggest a problem with guest token handling or async query 
initialization.
   - No async query jobs are created on initial load (as seen in Celery 
Flower), but they are created after a manual dashboard refresh, which then 
loads data correctly.
   - The logs show 401 and 404 errors for chart data endpoints on initial load, 
indicating possible permission or token propagation issues for the embedded 
guest session.
   - Your guest token and async query configuration appears correct and aligns 
with Superset’s documented options for these features ([config 
reference](https://github.com/apache/superset/blob/master/superset/config.py), 
[async queries 
doc](https://github.com/apache/superset/blob/master/superset-websocket/README.md)).
   
   **What’s likely happening:**
   - When using guest tokens and async queries with polling, the initial async 
job submission may not be properly associating the guest token with the job or 
the request context. This can result in the backend rejecting the request or 
not starting the async job, leading to the errors you see.
   - The fact that a manual refresh works suggests that the session or token 
context is established only after the first failed attempt, or that the refresh 
triggers a different code path that handles guest tokens correctly.
   
   **What is not yet resolved:**
   - There is no documented fix or workaround for this specific scenario in the 
Superset repository or documentation.
   - Issue #18814, which you referenced, does not have a solution or further 
insights at this time.
   
   **Relevant configuration/documentation:**
   - GLOBAL_ASYNC_QUERIES and guest token settings are documented in the main 
config file ([see 
here](https://github.com/apache/superset/blob/master/superset/config.py)).
   - The async queries transport can be set to 'polling' as you have done ([see 
here](https://github.com/apache/superset/blob/master/superset-websocket/README.md)).
   - Guest tokens are expected to be included in the request context for async 
jobs, and there are tests confirming this behavior, but no indication of a fix 
for your scenario ([see 
here](https://github.com/apache/superset/blob/master/tests/unit_tests/async_events/async_query_manager_tests.py)).
   
   **Summary:**  
   This appears to be a bug or unsupported edge case in Superset 4.1.2 when 
combining guest tokens, embedded dashboards, and async queries with polling. 
The workaround for now is to disable GLOBAL_ASYNC_QUERIES for embedded 
dashboards, or require users to manually refresh the dashboard after load 
(which is not ideal). There is no official fix or workaround documented in the 
repository as of now.
   
   If you need to pursue this further, you may want to monitor or comment on 
issue #18814 for updates, as it tracks the same problem.
   
   If you have any more logs or can reproduce this with a minimal setup, that 
information could help the maintainers identify and fix the root cause in a 
future release.
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://go.dosu.dev/dosubot), mention 
@dosu-bot.*
   
   ---
   <sup>Help Dosu learn! Give it feedback: [Great 
Response](https://app.dosu.dev/response-feedback/4088f7c9-e78e-42fe-8d70-efc409ea4009?feedback_type=great_response)
 | [Irrelevant 
Answer](https://app.dosu.dev/response-feedback/4088f7c9-e78e-42fe-8d70-efc409ea4009?feedback_type=irrelevant_answer)
 | [Incorrect 
Sources](https://app.dosu.dev/response-feedback/4088f7c9-e78e-42fe-8d70-efc409ea4009?feedback_type=incorrect_sources)
 | [Too 
Verbose](https://app.dosu.dev/response-feedback/4088f7c9-e78e-42fe-8d70-efc409ea4009?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/4088f7c9-e78e-42fe-8d70-efc409ea4009?feedback_type=hallucination)
 | [Bug 
Report](https://app.dosu.dev/response-feedback/4088f7c9-e78e-42fe-8d70-efc409ea4009?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/4088f7c9-e78e-42fe-8d70-efc409ea4009?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: [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]

Reply via email to