docs/users/support/troubleshooting.md
This guide provides solutions to common issues and debugging tips, including topics on:
Error: Qwen OAuth free tier was discontinued on 2026-04-15
qwen → /auth and choose one of:
Error: UNABLE_TO_GET_ISSUER_CERT_LOCALLY, UNABLE_TO_VERIFY_LEAF_SIGNATURE, or unable to get local issuer certificate
NODE_EXTRA_CA_CERTS environment variable to the absolute path of your corporate root CA certificate file.
export NODE_EXTRA_CA_CERTS=/path/to/your/corporate-ca.crtError: Device authorization flow failed: fetch failed
UNABLE_TO_VERIFY_LEAF_SIGNATURE). Note: this error is specific to the legacy Qwen OAuth flow./auth.qwen --proxy <url> (or the proxy setting in settings.json).NODE_EXTRA_CA_CERTS as described above.Issue: Unable to display UI after authentication failure
security.auth.selectedType setting may be persisted in settings.json. On restart, the CLI may get stuck trying to authenticate with the failed auth type and fail to display the UI.security.auth.selectedType configuration item in your settings.json file:
~/.qwen/settings.json (or ./.qwen/settings.json for project-specific settings)security.auth.selectedType fieldQ: How do I update Qwen Code to the latest version?
npm, update it using the command npm install -g @qwen-code/qwen-code@latest. If you compiled it from source, pull the latest changes from the repository, and then rebuild using the command npm run build.Q: Where are the Qwen Code configuration or settings files stored?
A: The Qwen Code configuration is stored in two settings.json files:
~/.qwen/settings.json../.qwen/settings.json.Refer to Qwen Code Configuration for more details.
Q: Why don't I see cached token counts in my stats output?
/stats command.Error: EADDRINUSE (Address already in use) when starting an MCP server.
Error: Command not found (when attempting to run Qwen Code with qwen).
PATH.qwen globally, check that your npm global binary directory is in your PATH. You can update using the command npm install -g @qwen-code/qwen-code@latest.qwen from source, ensure you are using the correct command to invoke it (e.g. node packages/cli/dist/index.js ...). To update, pull the latest changes from the repository, and then rebuild using the command npm run build.Error: MODULE_NOT_FOUND or import errors.
npm install to ensure all dependencies are present.npm run build to compile the project.npm run start.Error: "Operation not permitted", "Permission denied", or similar.
Qwen Code is not running in interactive mode in "CI" environments
CI_ (e.g. CI_TOKEN) is set. This is because the is-in-ci package, used by the underlying UI framework, detects these variables and assumes a non-interactive CI environment.is-in-ci package checks for the presence of CI, CONTINUOUS_INTEGRATION, or any environment variable with a CI_ prefix. When any of these are found, it signals that the environment is non-interactive, which prevents the CLI from starting in its interactive mode.CI_ prefixed variable is not needed for the CLI to function, you can temporarily unset it for the command. e.g. env -u CI_TOKEN qwenDEBUG mode not working from project .env file
DEBUG=true in a project's .env file doesn't enable debug mode for the CLI.DEBUG and DEBUG_MODE variables are automatically excluded from project .env files to prevent interference with the CLI behavior..qwen/.env file instead, or configure the advanced.excludedEnvVars setting in your settings.json to exclude fewer variables.QWEN_CODE_IDE_WORKSPACE_PATHQWEN_CODE_IDE_SERVER_PORThost.docker.internal resolves. Otherwise, map the host appropriately./ide install and use “Qwen Code: Run” in the Command Palette to verify it launches.The Qwen Code uses specific exit codes to indicate the reason for termination. This is especially useful for scripting and automation.
| Exit Code | Error Type | Description |
|---|---|---|
| 41 | FatalAuthenticationError | An error occurred during the authentication process. |
| 42 | FatalInputError | Invalid or missing input was provided to the CLI. (non-interactive mode only) |
| 44 | FatalSandboxError | An error occurred with the sandboxing environment (e.g. Docker, Podman, or Seatbelt). |
| 52 | FatalConfigError | A configuration file (settings.json) is invalid or contains errors. |
| 53 | FatalTurnLimitedError | The maximum number of conversational turns for the session was reached. (non-interactive mode only) |
CLI debugging:
--verbose flag (if available) with CLI commands for more detailed output.Core debugging:
node --inspect) if you need to step through server-side code.Tool issues:
run_shell_command, check that the command works directly in your shell first.Pre-flight checks:
npm run preflight before committing code. This can catch many common issues related to formatting, linting, and type errors.If you encounter an issue that was not covered here in this Troubleshooting guide, consider searching the Qwen Code Issue tracker on GitHub. If you can't find an issue similar to yours, consider creating a new GitHub Issue with a detailed description. Pull requests are also welcome!