You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "irodriguez-nebustream (via GitHub)" <gi...@apache.org> on 2025/05/03 23:57:03 UTC

[I] API endpoint SDK (/api/v1/me/roles/) not compatible with SUPERSET_APP_ROOT subpath routing [superset]

irodriguez-nebustream opened a new issue, #33353:
URL: https://github.com/apache/superset/issues/33353

   ### Bug description
   
   Bug description*
   When Superset is configured with SUPERSET_APP_ROOT set to a non-root path (e.g., "/prefix"), the embedded dashboard's API call to /api/v1/me/roles/ fails with a 404 error because the endpoint doesn't account for the application root path.
   Reproduction steps:
   
   Configure Superset with SUPERSET_APP_ROOT="/prefix" in the config
   Embed a dashboard using the embedDashboard() SDK function
   Monitor the network requests
   
   Expected behavior:
   The API call should go to /prefix/api/v1/me/roles/ (with the app root prefix) to match the subpath routing configuration.
   Actual behavior:
   The API call goes to /api/v1/me/roles/ (without the prefix), resulting in a 404 error because the route doesn't exist at the root level.
   Root cause:
   ```
   In superset-frontend/src/embedded/index.tsx, the start() function has a hardcoded endpoint path that doesn't consider the application root:
   typescriptconst getMeWithRole = makeApi<void, { result: UserWithPermissionsAndRoles }>({
     method: 'GET',
     endpoint: '/api/v1/me/roles/',  // Hardcoded path, no app root
   });
   ```
   
   ### Screenshots/recordings
   
   Console error showing 404 for /api/v1/me/roles/ when Superset is configured with SUPERSET_APP_ROOT="/prefix"
   
   ![Image](https://github.com/user-attachments/assets/ecf6d65c-22e3-4fce-97bf-eecad13404e2)
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   3.10
   
   ### Node version
   
   I don't know
   
   ### 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] API endpoint SDK (/api/v1/me/roles/) not compatible with SUPERSET_APP_ROOT subpath routing [superset]

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

   Very new to doing any PR's but here is my attempt at a fix https://github.com/apache/superset/pull/33356


-- 
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] API endpoint SDK (/api/v1/me/roles/) not compatible with SUPERSET_APP_ROOT subpath routing [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #33353: API endpoint SDK (/api/v1/me/roles/) not compatible with SUPERSET_APP_ROOT subpath routing
URL: https://github.com/apache/superset/issues/33353


-- 
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] API endpoint SDK (/api/v1/me/roles/) not compatible with SUPERSET_APP_ROOT subpath routing [superset]

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

   Leaving comments on the PR...


-- 
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] API endpoint SDK (/api/v1/me/roles/) not compatible with SUPERSET_APP_ROOT subpath routing [superset]

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

   <!-- Answer -->
   To resolve the issue with the API endpoint not accounting for the `SUPERSET_APP_ROOT` subpath routing, you can modify the endpoint to dynamically include the application root. This can be achieved by using the `getUrl` method from the `SupersetClientClass` in the Superset SDK. Here's how you can adjust the endpoint in your code:
   
   Replace the hardcoded endpoint in `superset-frontend/src/embedded/index.tsx` with a dynamic one:
   
   ```typescript
   import { SupersetClient } from 'superset-ui-core';
   
   const client = new SupersetClient();
   
   const getMeWithRole = makeApi<void, { result: UserWithPermissionsAndRoles }>({
     method: 'GET',
     endpoint: client.getUrl({ endpoint: '/api/v1/me/roles/' }),  // Use getUrl to include app root
   });
   ```
   
   This change will ensure that the API call correctly includes the `SUPERSET_APP_ROOT` prefix, preventing the 404 error when accessing the endpoint <sup>[[1]](https://github.com/apache/superset/blob/master/superset-frontend/src/utils/pathUtils.ts)</sup><sup>[[2]](https://github.com/apache/superset/blob/master/superset-frontend/packages/superset-ui-core/src/connection/SupersetClientClass.ts)</sup>.
   
   
   <!-- 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/49bd75fa-eaed-4ed8-bf46-367bb672b750?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/49bd75fa-eaed-4ed8-bf46-367bb672b750?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/49bd75fa-eaed-4ed8-bf46-367bb672b750?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/49bd75fa-eaed-4ed8-bf46-367bb672b750?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/49bd75fa-eaed-4ed8-bf46-367bb672b750?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/49bd75fa-eaed-4ed8-bf46-367bb672b750?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/49bd75fa-eaed-4ed8-bf46-367bb672b750?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] API endpoint SDK (/api/v1/me/roles/) not compatible with SUPERSET_APP_ROOT subpath routing [superset]

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

   @rusackas Hello, i'm fairly new to contributing, but I believe this is a simple enough fix. Can you help me get this through


-- 
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] API endpoint SDK (/api/v1/me/roles/) not compatible with SUPERSET_APP_ROOT subpath routing [superset]

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

   PR has been merged, and I assume this should have been closed. Holler if I'm wrong!


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