Troubleshoot Contrast CLI
If a Contrast CLI command doesn’t work, find the symptom below and follow the recommended resolution.
All platforms
Issue | Resolution |
|---|---|
Sign-in stops with an error about port 41000. | The browser returns to 127.0.0.1 on port 41000, and the CLI can’t use a different port. If the error says another program is using the port, or says the address is already in use, close that program and run contrast-cli configure again. |
The CLI says your stored credentials are corrupted. | Run contrast-cli sign-out and then contrast-cli configure. |
The CLI says Docker isn’t installed or isn’t on PATH. | Install Docker, or add it to your PATH, and run the command again. This applies to agent enable, agent disable, and demo commands. |
The CLI says the Docker daemon could not be reached. | Start Docker Desktop or the Docker Engine service and run the command again. |
You connect to the machine over SSH. | If sign-in doesn’t finish, disconnect and reconnect with port forwarding, then run contrast-cli configure, and open the sign-in URL in a browser on your own computer: ssh -L 41000:127.0.0.1:41000 <host> |
On Windows
Issue | Resolution |
|---|---|
PowerShell says | A PowerShell window keeps the PATH it started with, so it can’t find a CLI installed after it opened. Run the following command to refresh the PATH in your current window, or open a new PowerShell window: $env:Path = [Environment]::GetEnvironmentVariable('Path','User') + ';' + [Environment]::GetEnvironmentVariable('Path','Machine') |
Sign-in stops and says port 41000 is reserved by Windows or held by a program. | Sign-in needs port 41000 and the CLI can’t use a different one. Closing an app may not help, so find out which case you have:
|
The CLI says it cannot open your saved sign-in. | Windows can only decrypt your saved sign-in in a session where you signed in with your password, so this happens over SSH with key authentication. Run the CLI from a desktop session, or connect over SSH with a password. If it happens in a desktop session, for example after an administrator reset your Windows password, run contrast-cli sign-out and then contrast-cli configure. |
In WSL
Issue | Resolution |
|---|---|
demo, agent enable, or agent disable CLI commands say the Docker daemon could not be reached. | Turn on Docker Desktop’s WSL integration for your distribution. In Docker Desktop, open Settings, go to Resources, select WSL integration, and turn on your distribution. Then run the CLI command again. |
The sign-in page doesn’t open. | Copy the sign-in URL that the CLI prints and paste it into a browser on Windows. |