Skip to main content

Troubleshooting

Most SageCode messages say what to do next. Here are the common ones in full.

Install​

You seeWhat to do
sagex: command not foundOpen a new terminal so your PATH is reloaded. Still missing? Run uv tool update-shell, then open another terminal.
sagex --version shows an old versionUpgrade with the tool you installed with: uv tool upgrade sagex-cli (or pipx upgrade sagex-cli, pip install -U sagex-cli).

Signing in​

You seeWhat to do
This sign-in request expiredApprove within 10 minutes of running sagex auth login. Run it again for a new code.
The sign-in was denied in the browserSomeone clicked Deny on the approval page. If that was a mistake, run sagex auth login again.
"That code isn't valid or has expired" (in the browser)Check you typed the code from your terminal, or run sagex auth login again for a new one.
The browser didn't openOver SSH or on a machine with no display, SageCode prints the link instead. Open it on any device, or go to autosagex.web.app/cli-auth and enter the code.
You already have 25 active SageCode sessionsRevoke sessions you no longer use on your profile's SageCode tab, then sign in again.
No OS keychain is available on this machineCommon on servers and CI runners. Create an access token on your profile and set it in your environment: SAGEX_API_KEY=<token>.
That doesn't look like a SageCode tokenWith --with-token: access tokens start with sgx_. Copy the whole token and try again.

Sessions​

You seeWhat to do
This SageCode session expired after 90 days without useRun sagex auth login to sign in again.
This SageCode session was signed outsagex auth logout ran, or a newer sign-in on the same machine replaced this one. Run sagex auth login.
This SageCode session was revokedIt was revoked from your profile. Run sagex auth login to start a new session.
Not logged in. Run: sagex auth loginThis machine has no saved session and SAGEX_API_KEY isn't set.
A CI job fails with one of the messages aboveThe token was revoked or went 90 days unused. Create a new one and update the SAGEX_API_KEY secret. See Sessions & Access Tokens.

Running things​

You seeWhat to do
Unable to reach the Autosage serverCheck your internet connection and try again. For details, run the command again with SAGEX_DEBUG=1.
A plan-limit message when starting a runRuns started from SageCode count toward your plan's monthly limits, just like runs in the web app.
A prompt for a parameter in CIPipelines can't answer prompts. Save the value in the workflow, or pass it with -p NAME=VALUE. Secret parameters must be saved in the workflow.
More than one match for a nameSageCode lists the matches with their ids. Use the id, or add --vault for a server or key name that exists in more than one vault.

Something else? Open an issue with the command you ran and what it printed, or contact support.