ShenglanLuCPH opened a new issue, #23320:
URL: https://github.com/apache/superset/issues/23320

   Description:
   We host the superset verion 2.0.1 in Azure Kubernetes Service. We have an 
embeded dashboard, which gets the guest token from the backend with user 
information.
   The dashboard is loaded correctly, but in the browser network traffic, we 
see `500` error for `POST` to 
`https://{host.url}/api/v1/dashboard/{dashboard_id}/filter_state?tab_id={tab_id}`
   
   The python stack trace indicates that error is caused by the [get_user_id() 
function](https://github.com/apache/superset/blob/master/superset/utils/core.py)
 in the 
[CreateFilterStateCommand](https://github.com/apache/superset/blob/master/superset/dashboards/filter_state/commands/create.py)
 is not applicable to GuestUser object for embeded dashboards.
   
   #### How to reproduce the bug
   
   1. Open browser developer tool
   2. Go to the embeded dashboard, and the `Network` tab
   3. See error
   
   ### Expected results
   No error shown
   
   ### Actual results
   500 error for the api call
   
   #### Screenshots
   
   
   ### Environment
   
   - browser type and version: Edge Version 110.0.1587.63 (Official build) 
(64-bit)
   - superset version: `2.0.1` 
   - python version: not applicable
   - node.js version: not applicable
   - any feature flags active: 
       ```      
        "ENABLE_TEMPLATE_PROCESSING": True,
         "DASHBOARD_RBAC": True,
         "DASHBOARD_CROSS_FILTERS": True,
         "EMBEDDED_SUPERSET": True,
         "DRILL_TO_DETAIL": True,
         "DASHBOARD_NATIVE_FILTERS": True,
         "HORIZONTAL_FILTER_BAR": True 
      ```
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [x] I have checked the superset logs for python stacktraces and included 
it here as text if there are any.
   - [ ] I have reproduced the issue with at least the latest released version 
of superset.
   - [x] I have checked the issue tracker for the same issue and I haven't 
found one similar.
   
   ### Additional context
   Python stacktraces:
   ```
   [09/Mar/2023:16:21:17 +0000] "POST 
/api/v1/dashboard/{}/filter_state?tab_id={} HTTP/1.1" 500 26 
"https://{hosted.url}/embedded/{emved-guid}?uiConfig=11"; "Mozilla/5.0 (Windows 
NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 
Safari/537.36 Edg/110.0.1587.63"
   
   AttributeError: 'GuestUser' object has no attribute 'get_user_id'
       return user.get_user_id() if not user.is_anonymous else None
     File "/app/superset/key_value/utils.py", line 70, in get_owner
       entry: Entry = {"owner": get_owner(actor), "value": value}
     File "/app/superset/dashboards/filter_state/commands/create.py", line 41, 
in create
       return self.create(self._cmd_params)
     File "/app/superset/temporary_cache/commands/create.py", line 35, in run
       key = self.get_create_command()(args).run()
     File "/app/superset/temporary_cache/api.py", line 76, in post
       return f(self, *args, **kwargs)
     File "/app/superset/views/base_api.py", line 83, in wraps
       return super().post(pk)
     File "/app/superset/dashboards/filter_state/api.py", line 98, in post      
       value = f(*args, **kwargs)
     File "/app/superset/utils/log.py", line 245, in wrapper
       return f(self, *args, **kwargs)  
     File 
"/usr/local/lib/python3.8/site-packages/flask_appbuilder/api/__init__.py", line 
86, in wraps
   Traceback (most recent call last): 
   ERROR:root:'GuestUser' object has no attribute 'get_user_id'
   ```


-- 
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