# Troubleshooting

What Shonin says when something goes wrong, and what to do.

## Sign-in and second factor

- **Too many wrong codes: wait a moment, then try again.** After ten wrong codes in a row, your installation makes you wait longer and longer, up to an hour. It never locks your account for good.
- **Too many wrong codes. Sign out, then sign in again.** After five wrong codes of the authenticator app, or backup codes, in the same sign-in, that sign-in stops. Choose **Sign out**, sign in again and enter a new code.
- **<your Shonin org> requires an authenticator app: set one up before you continue.** A primary admin raised the security level. Set up an authenticator app or a passkey: see [Second factor](second-factor.md).
- **Lost your passkey.** On the sign-in page choose **I lost my passkey** and use a code of your authenticator app or a backup code: you then register a new passkey. Without either, an administrator resets your second factor in **Org settings**, panel **People**.
- **Your installation could not be reached. Try again in a moment.** Shonin could not get an answer from the installation in your management account. If it lasts, check in Amazon ECS that the service of the stack `shonin-installation` is running.

## Console and command line

- **The management account needs a code from your authenticator app.** The management account of your AWS organization never opens with a code by email. Set up an authenticator app or a passkey in **Personal settings**, then try again.
- **AWS CLI, SDKs or Terraform say the credentials expired.** Run `shonin login <your Shonin org>` again: it renews your profiles. See [Command line and SDKs](command-line.md).
- **this code is not valid or was already used.** A sign-in code of the command works once, for a few minutes. Copy a new command from **Access keys**, or run `shonin login` again.
- **The install script says "nothing installed in /usr/local/bin".** Installing there needs the password of your computer, and the script was not run in a terminal, for example by an AI agent. Run the command yourself in a terminal, or choose a folder of yours with `SHONIN_INSTALL_DIR`.
- **The install script says "Another shonin comes first in your PATH".** An older copy runs instead of the one just installed. Remove it with the `rm` command the script shows.

## Connecting an AWS organization

- **this code is not valid, or the installation stopped asking for it.** Copy the code again from the page of the **ConnectUrl** output of the stack `shonin-installation`.
- **The email on the connect page is not the one you are signed in with.** The AWS organization is connected, but its installation has no primary admin yet. Open the connect page again and enter the email you sign in to Shonin with: see [Connect your AWS organization](connect-aws-organization.md).
- **Only a primary admin connects another AWS organization.** Ask a primary admin of your Shonin org.

## Events

- **update the installation's stack for faster search.** The stack of that installation is older than its container: update the CloudFormation stack `shonin-installation` with the latest template. Until then the Events page reads the events the slower way, without a total.

Still stuck? Write to info@polarity.dev.
