You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "Divyanshu-s13 (via GitHub)" <gi...@apache.org> on 2026/04/05 07:46:43 UTC

[I] Crash in credentials list error handler when Axios error has no response [apisix-dashboard]

Divyanshu-s13 opened a new issue, #3370:
URL: https://github.com/apache/apisix-dashboard/issues/3370

   ### Issue description
   
   The credentials list API helper throws a secondary runtime error while handling failures. In [credentials.ts:38], the catch block reads e.response.status directly. For network/CORS/timeout failures, response can be undefined, so this path crashes with a TypeError instead of handling the original failure.
   Where:
   [credentials.ts:38-45]
   
   ### Expected behavior
   
   - Error handling should be resilient.
   - If status is 404, return an empty credentials list.
   - For other failures, rethrow the original error without introducing a new TypeError.
   
   ### How to Reproduce
   
   1. Start the dashboard normally and open it in browser.
   2. Open browser DevTools, go to Network, and set throttling to Offline.
   3. In the app, navigate to a consumer’s Credentials page so the credentials list request is triggered.
   4. Check browser console.
   
   
   ### Screenshots
   
   _No response_
   
   ### Environment
   
   _No response_
   
   ### Additional context
   
   Actual result:
   
   1. App throws TypeError: Cannot read properties of undefined (reading status).
   2. Error points to [credentials.ts:40] in the catch handler.
   
   Expected result:
   
   1. No crash.
   2. If request fails without HTTP response, error should be handled safely.
   3. Only HTTP 404 should return empty list fallback; other errors should be rethrown cleanly.


-- 
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@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Crash in credentials list error handler when Axios error has no response [apisix-dashboard]

Posted by "Divyanshu-s13 (via GitHub)" <gi...@apache.org>.
Divyanshu-s13 commented on issue #3370:
URL: https://github.com/apache/apisix-dashboard/issues/3370#issuecomment-4206473326

   > I think this question is largely unnecessary:
   > 
   > * If the network goes down, all API calls will fail, not just credentials.
   > * The Dashboard is completely unusable without a network connection; this isn't a credentials issue.
   > * This isn't a scenario users would actually encounter.
   
   Thanks for the feedback, that makes sense regarding the broader point that without network access the dashboard is generally unusable.
   
   I agree this PR should not be framed as an offline-mode fix.
   The change is narrower: it prevents a secondary runtime crash in the credentials error handler when Axios throws an error without a response (for example timeout, CORS, TLS, or request-abort cases), so the UI can surface the original request failure cleanly.
   
   I can update the PR title and description to reflect this narrower robustness fix, or close it if you would prefer to keep the current behavior unchanged.


-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Crash in credentials list error handler when Axios error has no response [apisix-dashboard]

Posted by "Divyanshu-s13 (via GitHub)" <gi...@apache.org>.
Divyanshu-s13 commented on issue #3370:
URL: https://github.com/apache/apisix-dashboard/issues/3370#issuecomment-4188480496

   @Baoyuantop  Hi, I'd like to work on this bug and submit a fix!
   Could you assign this issue to me? I'll have a PR ready shortly.


-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Crash in credentials list error handler when Axios error has no response [apisix-dashboard]

Posted by "Divyanshu-s13 (via GitHub)" <gi...@apache.org>.
Divyanshu-s13 commented on issue #3370:
URL: https://github.com/apache/apisix-dashboard/issues/3370#issuecomment-4226061261

   > I think if you have clear steps to reproduce a specific issue, and that issue is affecting users, then we can accept the fix. Please don’t speculate about the issue based on the code.
   
   Thank you for the clarification @Baoyuantop ! That makes complete sense — I should not have opened this without a confirmed reproduction. I will close this PR. I will be more careful to verify issues with actual reproduction steps before submitting. Thanks for the guidance!


-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Crash in credentials list error handler when Axios error has no response [apisix-dashboard]

Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop commented on issue #3370:
URL: https://github.com/apache/apisix-dashboard/issues/3370#issuecomment-4205787202

   I think this question is largely unnecessary:
   
   - If the network goes down, all API calls will fail, not just credentials.
   
   - The Dashboard is completely unusable without a network connection; this isn't a credentials issue.
   
   - This isn't a scenario users would actually encounter.


-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Crash in credentials list error handler when Axios error has no response [apisix-dashboard]

Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop commented on issue #3370:
URL: https://github.com/apache/apisix-dashboard/issues/3370#issuecomment-4221720355

   I think if you have clear steps to reproduce a specific issue, and that issue is affecting users, then we can accept the fix. Please don’t speculate about the issue based on the code.


-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Crash in credentials list error handler when Axios error has no response [apisix-dashboard]

Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop closed issue #3370: Crash in credentials list error handler when Axios error has no response
URL: https://github.com/apache/apisix-dashboard/issues/3370


-- 
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@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org