Kiro icon indicating copy to clipboard operation
Kiro copied to clipboard

Session timeout (?) leads to a dead end and "An unexpected error occurred, please retry"

Open bcdady opened this issue 9 months ago • 10 comments

Before opening, please confirm:

Operating System

linux

Kiro Version

0.10.32

Bug Description

It appears my session has timed out. I've tried closing open chats and opening a new one, but when I type 'do I need to login?', I keep getting "An unexpected error occurred, please retry".

Retrying isn't working, so this needs a better error message, and preferably, the ability to recognize when a session is expired and walk the user through refreshing/re-authenticating.

Steps to Reproduce

  1. Use Kiro successfully for multiple projects
  2. Be away from the session for several hours
  3. Come back to Kiro IDE and try to resume working in an existing or new chat session.
  4. Get chat error "An unexpected error occurred, please retry"

Expected Behavior

  1. Come back to Kiro IDE and try to resume working in an existing or new chat session.
  2. If my authentication session has timed out, the message I see should specify that, instead of providing a generic message with instructions (to "retry"), that do Not help.
  3. If my authentication session has timed out, I should be prompted to re-authenticate. I should Not feel stuck, and like my only option is to close the IDE and re-open it.

Conversation ID

88beca44-9942-4776-9dfe-c266f1930526 88beca44-9942-4776-9dfe-c266f1930526 88beca44-9942-4776-9dfe-c266f1930526 83350f48-9af8-4975-bfe1-68e7de7d77c7 1533fc31-67db-45cd-b155-2a9167019eb6

Additional Context

Image

The error message is the same as #6114, but the steps to get to the error message are distinct. The error message is the same as #5369, but the cause and fix are different.

bcdady avatar Mar 02 '26 03:03 bcdady

🤖 Potential Duplicate Detected

This issue appears to be similar to:

What happens next?

  • ⏰ This issue will be automatically closed in 3 days
  • 🏷️ If this is not a duplicate, you can prevent automatic closure by adding a comment or reacting with 👎 to this message.
  • 💬 Comment on the original issue if you have additional information

Why is this marked as duplicate? Both issues deal with authentication/login token expiration problems and the need for better re-authentication flows, though #5810 is specifically about Enterprise IAM Identity Center while the new issue is more general

github-actions[bot] avatar Mar 02 '26 04:03 github-actions[bot]

I just tried the Developer: Reload option from the Command Palette, and it brought me back to the KIRO splash screen with the "Sign in" button. This seems to confirm the earlier suspicion that the error messages are due to session timeout.

bcdady avatar Mar 02 '26 04:03 bcdady

Thank you for your feedback! 🙏

The duplicate label has been removed and this issue has been sent back for maintainer review.

A maintainer will review this issue shortly.

github-actions[bot] avatar Mar 02 '26 04:03 github-actions[bot]

I have encountered this same problem.

Bug

System becomes unusable with obtuse errors when SSO session expires. Long task sets will never complete without intervention, all tasks in flight ceasse, and all future attempts to continue or start conversations end with An unexpected error occurred, please retry.

Steps to repdroduce

  1. Log in to Kiro through an organisation's start page that uses SSO (We are using KeyCloak)
  2. Use the IDE until SSO session expires
  3. Note that all agents in flight stop, and any attempt to start or continue conversations end with an obtuse and unhelpful error.

Expected behaviour

The ideal behaviour would be that the IDE's validity isn't bound up with the SSO token length. If not possible, the system should advise that token has expired and take back to AWS start page to log in again.

luke-dingle avatar Mar 10 '26 20:03 luke-dingle

Additional context

This same error occurs with SSO sessions on the CLI, except the error is slightly more informative, but harder to work around as you need to kill off the whole session to log in again.

Kiro is having trouble responding right now:
   0: Failed to send the request: An unknown error occurred: dispatch failure
   1: An unknown error occurred: dispatch failure
   2: dispatch failure (other): No token
   3: dispatch failure
   4: other
   5: No token

Location:
   crates/chat-cli/src/cli/chat/mod.rs:1522

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

luke-dingle avatar Mar 11 '26 04:03 luke-dingle

I can confirm, I am facing same error, workaround of shutting down and starting again prompts for login.

Too much hassle for simple stuff

vikasSainiFacctum avatar Mar 18 '26 08:03 vikasSainiFacctum

Thank you for your feedback! 🙏

The duplicate label has been removed and this issue has been sent back for maintainer review.

A maintainer will review this issue shortly.

It appears this issue is still "pending-maintainer-response" since "3 weeks ago". @AnilMaktala You appear to be the most recently active contributor/maintainer. Is there someone you could ping to look at this and the linked, related issues, to determine what the best way to improve the session expiration experience?

bcdady avatar Mar 20 '26 03:03 bcdady

Who is looking into this ?

kunalgharate avatar Apr 04 '26 15:04 kunalgharate

Hey @bcdady, Thank you for reporting this. We were unable to replicate this issue on our end. Could you please provide the Kiro logs when this occurs? This will help us investigate further. If you are no longer experiencing this issue on the latest version (0.11.133), please let us know and we can close this.

AnilMaktala avatar Apr 23 '26 12:04 AnilMaktala

This issue has been automatically closed due to inactivity. It has been 7 days since we requested additional information.

If you still need help with this issue, please feel free to reopen it or create a new issue with the requested details.

github-actions[bot] avatar May 01 '26 00:05 github-actions[bot]