You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "scott-varadise (via GitHub)" <gi...@apache.org> on 2025/09/25 06:47:43 UTC
[I] [6.0.0-RC2] 'GuestUser' object has no attribute 'active' [superset]
scott-varadise opened a new issue, #35282:
URL: https://github.com/apache/superset/issues/35282
### Bug description
## **Description**
Apache Superset throws an AttributeError when using guest token authentication. The GuestUser class is missing the required `active` attribute that Flask-AppBuilder's security manager expects.
## **Error Message**
AttributeError: 'GuestUser' object has no attribute 'active'
## **Stack Trace**
File "/app/.venv/lib/python3.11/site-packages/flask_appbuilder/security/decorators.py", line 106, in wraps
if current_app.appbuilder.sm.has_access(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.11/site-packages/flask_appbuilder/security/manager.py", line 1591, in has_access
if current_user.is_authenticated and current_user.active:
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'GuestUser' object has no attribute 'active'
## **Steps to Reproduce**
1. Configure Superset with guest token authentication
2. Create a guest token for dashboard access
3. Access dashboard API endpoint: `GET /api/v1/dashboard/{id}`
4. Error occurs when Flask-AppBuilder security manager checks `current_user.active`
## **Expected Behavior**
Guest users should be able to access permitted dashboards without AttributeError, with the security manager properly checking user permissions.
## **Actual Behavior**
The application crashes with a 500 error because the `GuestUser` class lacks the `active` attribute required by Flask-AppBuilder's permission system.
## **Environment**
- **Superset Version**: [Specify your version]
- **Python Version**: 3.11
- **Flask-AppBuilder**: [Check your version]
- **Deployment**: Docker container
- **Authentication**: Guest token authentication
## **Suggested Fix**
The `GuestUser` class should include the required Flask-AppBuilder attributes:
- `active = True`
- `is_authenticated` property
- `is_anonymous` property
## **Additional Context**
This appears to be a compatibility issue between Superset's guest authentication implementation and Flask-AppBuilder's security manager expectations. The error specifically occurs at line 1591 in Flask-AppBuilder's manager.py when checking user permissions.
## **Workaround**
Manually add the missing attributes to the GuestUser class implementation in the security manager configuration.
### Screenshots/recordings
_No response_
### Superset version
master / latest-dev
### Python version
3.9
### Node version
16
### Browser
Chrome
### Additional context
_No response_
### Checklist
- [ ] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [ ] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [ ] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
--
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] [6.0.0-RC2] 'GuestUser' object has no attribute 'active' [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #35282:
URL: https://github.com/apache/superset/issues/35282#issuecomment-3332439201
<!-- Greeting -->
Hi @scott-varadise! I'm [Dosu](https://go.dosu.dev/dosubot) and Iām helping the superset team.
<!-- Answer -->
The root cause is that the `GuestUser` class in Superset (used for guest token authentication) does not define the `active` attribute, which Flask-AppBuilder expects for permission checks. This leads to the AttributeError when accessing endpoints as a guest user. The class already implements `is_authenticated` and `is_anonymous` properties, but lacks `active` [`source`](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/security/guest_token.py).
This is not a tracked issue in the Superset repository, and recent PRs and documentation do not address it. The recommended fix is to add the following property to the `GuestUser` class in `superset/security/guest_token.py`:
```python
@property
def active(self) -> bool:
return True
```
This will make `GuestUser` compatible with Flask-AppBuilder's security manager and resolve the error. You can patch your local implementation until an official fix is released.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do? [Good](https://app.dosu.dev/response-feedback/e6b2381a-c09b-499f-a4e4-519c016652f0?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/e6b2381a-c09b-499f-a4e4-519c016652f0?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/e6b2381a-c09b-499f-a4e4-519c016652f0?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/e6b2381a-c09b-499f-a4e4-519c016652f0?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/e6b2381a-c09b-499f-a4e4-519c016652f0?feedback_type=hallucination) | [Report š](https://app.dosu.dev/response-feedback/e6b2381a-c09b-499f-a4e4-519c016652f0?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/e6b2381a-c09b-499f-a4e4-519c016652f0?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu
b) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/35282)
--
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] [6.0.0-RC2] 'GuestUser' object has no attribute 'active' [superset]
Posted by "scott-varadise (via GitHub)" <gi...@apache.org>.
scott-varadise closed issue #35282: [6.0.0-RC2] 'GuestUser' object has no attribute 'active'
URL: https://github.com/apache/superset/issues/35282
--
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