# Troubleshooting

> Common UiPath CLI errors, their causes, and fixes, including PATH issues, authentication failures, and tool installation problems.

Common errors, their causes, and how to fix them. Each section lists the error message or symptom first, then what it means and what to do.

## Installation

### uip: command not found after npm install -g

The npm global prefix is not on your `PATH`. Find it:

```bash
npm config get prefix
```

On macOS/Linux, add the returned prefix + `/bin` to your shell profile (`~/.zshrc`, `~/.bashrc`). On Windows, `%APPDATA%\npm` should be on `PATH` by default — open a new terminal to pick up the update.

Full reference: [Installing UiPath CLI — Troubleshooting](./installing-uipath-cli.md#troubleshooting).

### EACCES: permission denied during install

You are trying to write to a system-owned npm prefix. **Do not use `sudo`.** Instead, set a user-local prefix:

```bash
mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global
export PATH="$HOME/.npm-global/bin:$PATH"
npm install -g @uipath/cli
```

## Authentication

### AuthenticationError (exit code 2) on every command

No valid session. Either:

- Run `uip login` to start an interactive session, or
- In CI, pass External App credentials: `uip login --client-id env.UIPATH_CLIENT_ID --client-secret env.UIPATH_CLIENT_SECRET --tenant "$UIPATH_TENANT"`, or
- For containers with a pre-issued token: set `UIPATH_CLI_ENABLE_ENV_AUTH=true` plus the `UIPATH_CLI_AUTH_TOKEN` / `UIPATH_CLI_ORGANIZATION_*` / `UIPATH_CLI_TENANT_*` variables.

Check status: `uip login status`.

See [Authentication](./authentication.md).

### Token expired or Expired in uip login status

The refresh token is no longer valid — usually after weeks of inactivity or an admin-forced sign-out. Re-run `uip login`.

For env-var auth, the token is opaque to `uip`; rotate `UIPATH_CLI_AUTH_TOKEN` from the issuing side.

### No tenant selected after uip login

The login completed without a tenant choice — either the picker was cancelled or `--tenant` was passed but the value doesn't match any accessible tenant. Retry with `uip login --interactive` to pick from a list, or `uip login --tenant <exact-name>`.

### UIPATH_CLIENT_ID / UIPATH_CLIENT_SECRET env vars seem to be ignored

They are. UiPath CLI removed implicit env-var reading for these values. Pass explicitly:

```bash
uip login --client-id env.UIPATH_CLIENT_ID --client-secret env.UIPATH_CLIENT_SECRET --tenant "$UIPATH_TENANT"
```

The `env.` prefix tells `uip` to resolve from the environment at runtime, without exposing the value on the command line.

### Warning: Environment-variable authentication is on

The full warning on stderr reads:

```
Environment-variable authentication is on (UIPATH_CLI_ENABLE_ENV_AUTH=true), so commands sign in with the UIPATH_CLI_* variables, not profile "<name>". Unset UIPATH_CLI_ENABLE_ENV_AUTH to use it.
```

`UIPATH_CLI_ENABLE_ENV_AUTH=true` is set, so the `--profile` you passed is not used. `uip login` prints the same warning, with `the login saved here` in place of the profile, because the login it saves is not used either. The command still runs with the credentials from the `UIPATH_CLI_*` variables.

To use the profile or the saved login, unset `UIPATH_CLI_ENABLE_ENV_AUTH`. To keep environment-variable authentication, remove `--profile` from the command. See [Authentication — environment-variable auth](./authentication.md#flow-4-environment-variable-auth-access-token-already-in-hand).

## Tools

### Tool '<verb>' not installed — attempting auto-install

Informational — the host is downloading a tool on first use. Subsequent calls reuse the installed copy. To avoid this log message in CI, pre-install:

```bash
uip tools install @uipath/orchestrator-tool @uipath/solution-tool
```

See [Controlling tool auto-install](./installing-uipath-cli.md#controlling-tool-auto-install).

### Failed to auto-install '<verb>'

The tool download failed. Common causes:

- **No network** — check connectivity or proxy settings.
- **Corporate proxy blocks npm** — set `HTTPS_PROXY=http://proxy.example.com:8080`.
- **npm registry not resolvable** — verify `npm config get registry` points somewhere reachable.

Retry manually: `uip tools install <verb>`.

### Tool commands vanish from uip --help after an upgrade

Tool version is out of step with the host. Fix:

```bash
uip tools update
```

This brings every installed tool to the latest version within the host's MAJOR.MINOR line. See [Versioning and stability](./versioning.md).

### ValidationError: package '<name>' is not on the whitelist

You tried to install a tool that isn't `@uipath/`. 1.x only supports the whitelisted set; third-party tools are not available yet.

### The project at <folder> has its own @uipath/cli

You ran `uip` from a project folder that has its own `@uipath/cli` in `node_modules`, and the `uip` on your `PATH` is another install. Only the project's own CLI installs, updates, or removes the project's tools. A tool auto-install, `uip tools install`, `uip tools update`, and `uip tools uninstall` fail with `ErrorCode: configuration_error` and exit code `1`, and change nothing.

Run the command with the project's CLI:

```bash
npx uip tools update
```

Alternatively, run your `uip` from a folder outside the project. To see which install each tool loads from, check the `Path` field of `uip tools list`.

## Output and filtering

### ValidationError: invalid --output-filter (exit 3)

The JMESPath expression couldn't be parsed. The CLI validates at parse time before running the command — fix the filter and retry. JMESPath reference: [jmespath.org](https://jmespath.org/).

A common pitfall: `--output-filter "Jobs[0].Key"` works, but `--output-filter "Jobs[-1].Key"` does not — JMESPath `[-1]` is not supported. Use `Data.Jobs | [-1:][0].Key` instead, or post-process with `jq`.

### I expected a table but got JSON

Default output is **JSON**. Pass `--output table` for the reading-friendly view. See [Output formats](./output-formats.md).

### Pipeline step fails to parse JSON — non-JSON text appears in stdout

Logs, progress bars, and some error messages go to **stderr**, not stdout. If something non-JSON is on stdout, you probably redirected both streams into the same file. Redirect them separately:

```bash
uip or folders list > folders.json 2> uip.log
```

## Commands and exit codes

### Command exits with 0 but I expected it to fail

A `Success` `Result` maps to exit code `0` even when the payload is empty. For example, `uip or folders list --all --name Nonexistent` exits `0` with `Data: []`. Branch on payload shape:

```bash
COUNT=$(uip or folders list --limit 50 --all --name Foo --output-filter "length(@)" --output plain)
[[ "$COUNT" -eq 0 ]] && { echo "no match"; exit 1; }
```

### unknown option '--top' or '--take'

`uip` list commands limit their results with `--limit`, not with `--top` or `--take`. On a command that has `--limit`, the `Instructions` field of the error names it:

```bash
uip or folders list --limit 5
```

The command fails with `ValidationError` and exit code `3`.

### unknown option — Several options arrived as one argument

The shell passed several options to `uip` as one argument, for example `"--limit 5 --output json"`. This happens when the options are in a quoted shell variable, or in any variable in zsh, which does not split a variable into words. The command fails with `ValidationError` and exit code `3`.

Pass each option and each value as a separate argument. In bash and zsh, keep the options in an array:

```bash
FLAGS=(--limit 5 --output json)
uip or folders list "${FLAGS[@]}"
```

### Confirmation required: this will … and cannot be undone

The command changes or deletes something and needs an explicit confirmation. The CLI never prompts for it. The command fails with `Result: "Failure"`, `ErrorCode: "confirmation_required"`, and exit code `1`, and changes nothing.

Run the command again with the option that `Instructions` names, usually `--yes`. In a script, branch on `ErrorCode` to tell a missing confirmation from a failed operation.

### uip tm wait exits with 1 or 4 — what happened?

Exit code `1` with `Code: "ExecutionTestsFailed"` or `Code: "ExecutionCancelled"` means the execution reached a terminal state, and a test failed or the run was cancelled. Exit code `4` means `--timeout` elapsed first: the envelope reads `Result: "TimeoutError"` with a `Timed out after <n>s waiting for execution` message. Exit code `2` is an authentication or permission failure, as on every other command. See [`uip tm wait` exit codes](./uip-test-manager-wait.md#exit-codes).

### uip tm testsets run succeeded but my tests are failing

Correct by design. `tm testsets run` exits `0` once Orchestrator accepts the run — the verdict comes later. Chain the three-step idiom:

```bash
EXEC_ID=$(uip tm testsets run --test-set-key "$TESTSET" --output-filter "ExecutionId" --output plain)
uip tm wait --execution-id "$EXEC_ID" --timeout 1800
FAILED=$(uip tm report get --execution-id "$EXEC_ID" --output-filter "Failed" --output plain)
[[ "$FAILED" -gt 0 ]] && { echo "$FAILED tests failed"; exit 1; }
```

`uip tm wait` itself exits `1` when a test failed or the run was cancelled, so a script that runs under `set -e` stops at that line. `uip tm testsets run --wait` launches and waits in one command, with the same exit codes.

See [Scripting patterns](./scripting-patterns.md), [uip tm testsets](./uip-test-manager-testsets.md), and [uip tm executions](./uip-test-manager-executions.md).

## Configuration

### Environment variable changes don't take effect

A long-running process (an agent, a watched script) reads its environment once at startup. Restart the process after changing environment variables. For one-shot commands, a fresh `uip` invocation always reads the current environment.

Verify the precedence: CLI flag > environment variable > built-in default. See [Configuration](./configuration.md).

## Shell completion

### Tab completion doesn't complete

Open a new terminal after `uip completion` so the shell rc file is re-sourced. If still missing, run `uip completion --print` to see what block `uip` thinks is installed; compare against your `~/.zshrc` / `~/.bashrc` / `$PROFILE`.

### uip or packages upload --package-name <TAB> doesn't suggest names

Dynamic flag-value completion is **zsh-only** and needs `jq` on the `PATH`. Install `jq` or switch to zsh. Static subcommand + option-name completion works in all four shells regardless.

## Shell and CI integration

### CI step hangs on uip login or uip skills install

The command is waiting on an interactive prompt. Pass the necessary flags:

- `uip login --tenant <name>` (skip tenant picker)
- `uip skills install --agent <name>` (skip agent picker)

If you are not sure which prompt is interactive, run the failing command under `uip --log-level debug …` locally in a non-TTY context (redirect stdout) and inspect what prompt appeared.

### uip or jobs start returns immediately — I wanted it to wait

By default `jobs start` accepts the run and exits. Add `--wait-for-completion`:

```bash
uip or jobs start <process-key> --wait-for-completion --timeout 600
```

## Something I couldn't find here

Check the reference page for the command you're running — each has its own exit codes and examples section. Then search the release notes for a similar symptom. If nothing matches, gather:

- `uip --version`
- `uip tools list`
- The exact command and the full stderr / stdout
- The `Result` field from the JSON envelope

…and open an issue with the UiPath CLI team.

## See also

- [Exit codes](./exit-codes.md) — what each code means.
- [Scripting patterns](./scripting-patterns.md) — retry, polling, stream separation, idempotent pipelines.
- [Authentication](./authentication.md) — the four auth flows in detail.
- [Installing UiPath CLI — Troubleshooting](./installing-uipath-cli.md#troubleshooting) — install-specific errors.
