You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "johannes-ws (via GitHub)" <gi...@apache.org> on 2025/08/01 07:29:17 UTC

[I] Error when add roles and users programmatically using Superset API [superset]

johannes-ws opened a new issue, #34467:
URL: https://github.com/apache/superset/issues/34467

   ### Bug description
   
   I got an error when i want to add roles and users programmatically using Superset API. Here is my code.
   
       import requests
       import json
       import os
   
       # --- Configuration ---
       # For security, use environment variables in production environments.
       SUPERSET_URL = "http://127.0.0.1:8088"
       ADMIN_USER = os.getenv("SUPERSET_ADMIN_USER", "admin")
       ADMIN_PASSWORD = os.getenv("SUPERSET_ADMIN_PASSWORD", "admin")
   
       # --- New Role & User Details ---
       NEW_ROLE_NAME = "Financial Analyst"
       NEW_ROLE_PERMISSIONS = ["can read on Dashboard", "can read on Chart"]
   
       NEW_USER_USERNAME = "dina.finance"
       NEW_USER_FIRSTNAME = "Dina"
       NEW_USER_LASTNAME = "Putri"
       NEW_USER_EMAIL = "dina.finance@example.com"
       NEW_USER_PASSWORD = "SecureStrongPassword456!"
   
       # Error handler function
       def handle_error(response):
           """Prints error message from API response and exits."""
           try:
               error_details = response.json()
               print(f"❌ Failed: Status {response.status_code} - {error_details.get('message', response.text)}")
           except json.JSONDecodeError:
               print(f"❌ Failed: Status {response.status_code} - {response.text}")
           exit()
   
       def main():
           """Main function to execute the process."""
           access_token = None
   
           # Use a session object for efficient multiple requests
           session = requests.Session()
   
           # 1. Login and get access token
           print(f"🔑 Attempting to log in as '{ADMIN_USER}'...")
           try:
               login_payload = {
                   "username": ADMIN_USER,
                   "password": ADMIN_PASSWORD,
                   "provider": "db"
               }
               response = session.post(f"{SUPERSET_URL}/api/v1/security/login", json=login_payload, timeout=10)
               
               if response.status_code != 200:
                   handle_error(response)
                   
               access_token = response.json().get("access_token")
               if not access_token:
                   print("❌ Access token not found in response.")
                   exit()
                   
               print("✅ Successfully retrieved token.")
               # Set Authorization header for subsequent requests
               session.headers.update({"Authorization": f"Bearer {access_token}"})
   
           except requests.exceptions.RequestException as e:
               print(f"❌ Connection error during login: {e}")
               exit()
   
           # 2. Create or get Role
           print(f"🛠️ Checking for role '{NEW_ROLE_NAME}'...")
           role_id = None
           role_payload = {"name": NEW_ROLE_NAME, "permissions": NEW_ROLE_PERMISSIONS}
           
           try:
               response = session.post(f"{SUPERSET_URL}/api/v1/security/roles/", json=role_payload)
               if response.status_code == 201:
                   role_id = response.json()["result"]["id"]
                   print(f"✅ Role '{NEW_ROLE_NAME}' successfully created with ID: {role_id}")
               elif response.status_code == 409:
                   print(f"ℹ️ Role '{NEW_ROLE_NAME}' already exists. Searching for ID...")
                   params = {"q": json.dumps({"filters": [{"col": "name", "opr": "eq", "value": NEW_ROLE_NAME}]})}
                   response_get = session.get(f"{SUPERSET_URL}/api/v1/security/roles/", params=params)
                   if response_get.status_code == 200 and response_get.json()["count"] > 0:
                       role_id = response_get.json()["result"][0]["id"]
                       print(f"✅ Role found with ID: {role_id}")
                   else:
                       print("❌ Failed to find ID for existing role.")
                       exit()
               else:
                   handle_error(response)
   
           except requests.exceptions.RequestException as e:
               print(f"❌ Connection error while creating role: {e}")
               exit()
   
           # 3. Create new user
           if role_id:
               print(f"👤 Creating user '{NEW_USER_USERNAME}'...")
               user_payload = {
                   "first_name": NEW_USER_FIRSTNAME,
                   "last_name": NEW_USER_LASTNAME,
                   "username": NEW_USER_USERNAME,
                   "email": NEW_USER_EMAIL,
                   "password": NEW_USER_PASSWORD,
                   "active": True,
                   "roles": [role_id]
               }
               try:
                   response = session.post(f"{SUPERSET_URL}/api/v1/security/users/", json=user_payload)
                   if response.status_code != 201:
                       handle_error(response)
                   
                   print(f"✅ User '{NEW_USER_USERNAME}' successfully created.")
               except requests.exceptions.RequestException as e:
                   print(f"❌ Connection error while creating user: {e}")
                   exit()
           else:
               print("❌ Cannot proceed with user creation because role ID was not found.")
   
           print("\n🎉 Process Completed!")
   
       if __name__ == "__main__":
           main()
   
   When i run <code>python setup_superset.py</code>, it gives this output.
   
   	🔑 Attempting to log in as 'admin'...
   	✅ Successfully retrieved token.
   	🛠️ Checking for role 'Financial Analyst'...
   	❌ Failed: Status 404 - {"errors": [{"message": "404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.", "error_type": "GENERIC_BACKEND_ERROR", "level": "error", "extra": {"issue_codes": [{"code": 1011, "message": "Issue 1011 - Superset encountered an unexpected error."}]}}]}
   
   I succeeded to get access token, but failed when try to access <code>/api/v1/security/roles/</code> and <code>/api/v1/security/users/</code>. I also try another API but it gives a same error message.
   
   I'm using Superset 4.1.3 and i don't change the code (just docker compose)
   
   Any solution about that?
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   4.1.3
   
   ### Python version
   
   3.11
   
   ### Node version
   
   18 or greater
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
   - [x] 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] Error when add roles and users programmatically using Superset API [superset]

Posted by "johannes-ws (via GitHub)" <gi...@apache.org>.
johannes-ws commented on issue #34467:
URL: https://github.com/apache/superset/issues/34467#issuecomment-3143797904

   superset_app          | 2025-08-01 08:59:15,529:WARNING:superset.views.error_handling:Exception
   superset_app          | Traceback (most recent call last):
   superset_app          |   File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request
   superset_app          |     rv = self.dispatch_request()
   superset_app          |          ^^^^^^^^^^^^^^^^^^^^^^^
   superset_app          |   File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request
   superset_app          |     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
   superset_app          |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   superset_app          |   File "/app/superset/utils/log.py", line 304, in wrapper
   superset_app          |     value = f(*args, **kwargs)
   superset_app          |             ^^^^^^^^^^^^^^^^^^
   superset_app          |   File "/app/superset/views/core.py", line 897, in welcome
   superset_app          |     if not g.user or not get_user_id():
   superset_app          |   File "/app/.venv/lib/python3.11/site-packages/werkzeug/local.py", line 318, in __get__
   superset_app          |     obj = instance._get_current_object()
   superset_app          |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   superset_app          |   File "/app/.venv/lib/python3.11/site-packages/werkzeug/local.py", line 526, in _get_current_object
   superset_app          |     return get_name(local())
   superset_app          |                     ^^^^^^^
   superset_app          |   File "/app/.venv/lib/python3.11/site-packages/flask_login/utils.py", line 25, in <lambda>
   superset_app          |     current_user = LocalProxy(lambda: _get_user())
   superset_app          |                                       ^^^^^^^^^^^
   superset_app          |   File "/app/.venv/lib/python3.11/site-packages/flask_login/utils.py", line 370, in _get_user
   superset_app          |     current_app.login_manager._load_user()
   superset_app          |   File "/app/.venv/lib/python3.11/site-packages/flask_login/login_manager.py", line 364, in _load_user
   superset_app          |     user = self._user_callback(user_id)
   superset_app          |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   superset_app          |   File "/app/.venv/lib/python3.11/site-packages/flask_appbuilder/security/manager.py", line 2227, in load_user
   superset_app          |     if user.is_active:
   superset_app          |        ^^^^^^^^^^^^^^
   superset_app          | AttributeError: 'NoneType' object has no attribute 'is_active'
   superset_app          | 2025-08-01 08:59:15,530:ERROR:superset.views.error_handling:'NoneType' object has no attribute 'is_active'
   superset_app          | Traceback (most recent call last):
   superset_app          |   File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request
   superset_app          |     rv = self.dispatch_request()
   superset_app          |          ^^^^^^^^^^^^^^^^^^^^^^^
   superset_app          |   File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request
   superset_app          |     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
   superset_app          |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   superset_app          |   File "/app/superset/utils/log.py", line 304, in wrapper
   superset_app          |     value = f(*args, **kwargs)
   superset_app          |             ^^^^^^^^^^^^^^^^^^
   superset_app          |   File "/app/superset/views/core.py", line 897, in welcome
   superset_app          |     if not g.user or not get_user_id():
   superset_app          |   File "/app/.venv/lib/python3.11/site-packages/werkzeug/local.py", line 318, in __get__
   superset_app          |     obj = instance._get_current_object()
   superset_app          |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   superset_app          |   File "/app/.venv/lib/python3.11/site-packages/werkzeug/local.py", line 526, in _get_current_object
   superset_app          |     return get_name(local())
   superset_app          |                     ^^^^^^^
   superset_app          |   File "/app/.venv/lib/python3.11/site-packages/flask_login/utils.py", line 25, in <lambda>
   superset_app          |     current_user = LocalProxy(lambda: _get_user())
   superset_app          |                                       ^^^^^^^^^^^
   superset_app          |   File "/app/.venv/lib/python3.11/site-packages/flask_login/utils.py", line 370, in _get_user
   superset_app          |     current_app.login_manager._load_user()
   superset_app          |   File "/app/.venv/lib/python3.11/site-packages/flask_login/login_manager.py", line 364, in _load_user
   superset_app          |     user = self._user_callback(user_id)
   superset_app          |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   superset_app          |   File "/app/.venv/lib/python3.11/site-packages/flask_appbuilder/security/manager.py", line 2227, in load_user
   superset_app          |     if user.is_active:
   superset_app          |        ^^^^^^^^^^^^^^
   superset_app          | AttributeError: 'NoneType' object has no attribute 'is_active'
   superset_app          | 2025-08-01 08:59:15,532:INFO:werkzeug:172.18.0.1 - - [01/Aug/2025 08:59:15] "GET /superset/welcome/ HTTP/1.1" 500 -


-- 
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] Error when add roles and users programmatically using Superset API [superset]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #34467:
URL: https://github.com/apache/superset/issues/34467#issuecomment-3148897613

   <!-- Answer -->
   The 403 Forbidden error means your admin user doesn't have the required permissions to access the roles API after migration. This is common after upgrading or enabling new APIs, because the permissions for the admin role may not be fully synced.
   
   To fix this, run:
   
   ```bash
   superset init
   ```
   
   This will resync all roles and permissions, including the ones needed for the admin user to access the security APIs like `/api/v1/security/roles/` [reference](https://github.com/apache/superset/issues/33925). After running `superset init`, restart your Superset server.
   
   If you still get a 403, double-check that your admin user is assigned to the correct admin role (matching `AUTH_ROLE_ADMIN` in your config), and that there are no custom security manager overrides or config differences affecting permissions [reference](https://github.com/apache/superset/issues/33925). 
   
   This should resolve the permission issue and let you use the security API as intended.
   
   
   <!-- 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/568c4792-bee9-4633-9fbd-5e292df0634a?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/568c4792-bee9-4633-9fbd-5e292df0634a?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/568c4792-bee9-4633-9fbd-5e292df0634a?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/568c4792-bee9-4633-9fbd-5e292df0634a?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/568c4792-bee9-4633-9fbd-5e292df0634a?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/568c4792-bee9-4633-9fbd-5e292df0634a?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/568c4792-bee9-4633-9fbd-5e292df0634a?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu
 b)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![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/34467)


-- 
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] Error when add roles and users programmatically using Superset API [superset]

Posted by "msyavuz (via GitHub)" <gi...@apache.org>.
msyavuz commented on issue #34467:
URL: https://github.com/apache/superset/issues/34467#issuecomment-3149957141

   That error happens when you forget to run `superset fab create-admin` but that shouldn't be necessary when using docker compose for everything. My only other recommendation is running `docker compose down -v` and `docker compose up`


-- 
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] Error when add roles and users programmatically using Superset API [superset]

Posted by "msyavuz (via GitHub)" <gi...@apache.org>.
msyavuz commented on issue #34467:
URL: https://github.com/apache/superset/issues/34467#issuecomment-3143735710

   
   Does this fix your issue @johannes-ws?
   
   > The 404 errors happen because Superset 4.1.3 does not expose the `/api/v1/security/roles/` or `/api/v1/security/users/` endpoints—these APIs simply do not exist in this version, even if you try to enable them in `superset_config.py` [[discussion](https://github.com/apache/superset/discussions/33878)].
   > 
   > In Superset 4.1.3, user and role management is handled through the Superset UI or the CLI, not via REST API. For automation or scripting, you should use the CLI commands provided by Flask AppBuilder (FAB), which Superset uses under the hood. For example, you can create a user with:
   > 
   > superset fab create-user \
   >     --username dina.finance \
   >     --firstname Dina \
   >     --lastname Putri \
   >     --email dina.finance@example.com \
   >     --password 'SecureStrongPassword456!' \
   >     --role 'Financial Analyst'
   > 
   > You can also create roles and assign permissions using the FAB CLI, but fine-grained permission management still requires the UI or direct DB manipulation (which is not recommended or supported) [[discussion](https://github.com/apache/superset/discussions/33878)].
   > 
   > If you need to manage users and roles via API, this is only supported in Superset 5.0.0+ with the `FAB_ADD_SECURITY_API = True` setting [[discussion](https://github.com/apache/superset/discussions/33877)]. Upgrading is the best path if API automation is a requirement.
   


-- 
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] Error when add roles and users programmatically using Superset API [superset]

Posted by "johannes-ws (via GitHub)" <gi...@apache.org>.
johannes-ws commented on issue #34467:
URL: https://github.com/apache/superset/issues/34467#issuecomment-3152980000

   Okay thanks for helping, i apologize for my fault. @msyavuz 


-- 
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] Error when add roles and users programmatically using Superset API [superset]

Posted by "johannes-ws (via GitHub)" <gi...@apache.org>.
johannes-ws closed issue #34467: Error when add roles and users programmatically using Superset API
URL: https://github.com/apache/superset/issues/34467


-- 
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] Error when add roles and users programmatically using Superset API [superset]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #34467:
URL: https://github.com/apache/superset/issues/34467#issuecomment-3143476796

   <!-- Answer -->
   The 404 errors happen because Superset 4.1.3 does not expose the `/api/v1/security/roles/` or `/api/v1/security/users/` endpoints—these APIs simply do not exist in this version, even if you try to enable them in `superset_config.py` [[discussion](https://github.com/apache/superset/discussions/33878)].
   
   In Superset 4.1.3, user and role management is handled through the Superset UI or the CLI, not via REST API. For automation or scripting, you should use the CLI commands provided by Flask AppBuilder (FAB), which Superset uses under the hood. For example, you can create a user with:
   
   ```bash
   superset fab create-user \
       --username dina.finance \
       --firstname Dina \
       --lastname Putri \
       --email dina.finance@example.com \
       --password 'SecureStrongPassword456!' \
       --role 'Financial Analyst'
   ```
   
   You can also create roles and assign permissions using the FAB CLI, but fine-grained permission management still requires the UI or direct DB manipulation (which is not recommended or supported) [[discussion](https://github.com/apache/superset/discussions/33878)].
   
   If you need to manage users and roles via API, this is only supported in Superset 5.0.0+ with the `FAB_ADD_SECURITY_API = True` setting [[discussion](https://github.com/apache/superset/discussions/33877)]. Upgrading is the best path if API automation is a requirement.
   
   
   <!-- 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/e80b60a7-4c7c-411a-8cd6-b23a077cbdc4?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/e80b60a7-4c7c-411a-8cd6-b23a077cbdc4?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/e80b60a7-4c7c-411a-8cd6-b23a077cbdc4?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/e80b60a7-4c7c-411a-8cd6-b23a077cbdc4?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/e80b60a7-4c7c-411a-8cd6-b23a077cbdc4?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/e80b60a7-4c7c-411a-8cd6-b23a077cbdc4?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/e80b60a7-4c7c-411a-8cd6-b23a077cbdc4?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu
 b)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![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/34467)


-- 
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] Error when add roles and users programmatically using Superset API [superset]

Posted by "johannes-ws (via GitHub)" <gi...@apache.org>.
johannes-ws commented on issue #34467:
URL: https://github.com/apache/superset/issues/34467#issuecomment-3148892698

   After migration from Superset 4.1.3 to 5.0.0 and added <code>FAB_ADD_SECURITY_API = True</code> to <code>config.py</code>, i got a new error message.
   
   	🔑 Attempting to log in as 'admin'...
   	✅ Successfully retrieved token.
   	🛠️ Checking for role 'Financial Analyst'...
   	❌ Failed: Status 403 - Forbidden
   
   Any solution about that? @dosu 


-- 
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] Error when add roles and users programmatically using Superset API [superset]

Posted by "johannes-ws (via GitHub)" <gi...@apache.org>.
johannes-ws commented on issue #34467:
URL: https://github.com/apache/superset/issues/34467#issuecomment-3143745407

   I got a new error. When i run docker compose for Superset 5.0.0, it gives an error message at address 127.0.0.1:8088.
   
   	{"errors": [{"message": "'NoneType' object has no attribute 'is_active'", "error_type": "GENERIC_BACKEND_ERROR", "level": "error", "extra": {"issue_codes": [{"code": 1011, "message": "Issue 1011 - Superset encountered an unexpected error."}]}}]}
   
   <img width="1919" height="1022" alt="Image" src="https://github.com/user-attachments/assets/1825cf81-1ddb-4345-a783-ac7e7d669fd7" />
   
   What should i do?


-- 
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] Error when add roles and users programmatically using Superset API [superset]

Posted by "msyavuz (via GitHub)" <gi...@apache.org>.
msyavuz commented on issue #34467:
URL: https://github.com/apache/superset/issues/34467#issuecomment-3143769783

   This looks like a session issue, either clearing the cache/cookies or restarting superset should fix it. Feel free to share backend logs if that doesn't help


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