Skip to content
The 38 guidesFREN中文
Guides
Appendix Level: Easy Reading time: 10 min

It isn't working: common problems and how to fix them

Slow Ollama, SSH or sign-in failures, rejected keys, busy ports, services that stop, full disks, and unreachable machines. Find the command that diagnoses each problem and see how to fix it.

In this guide
  1. 01Ollama is slow or the machine feels sluggish
  2. 02The model won’t load
  3. 03SSH won’t connect
  4. 04Account sign-in fails over SSH
  5. 05The API key is rejected
  6. 06‘Address already in use’: the port is taken
  7. 07The service stops when I close the terminal
  8. 08‘Command not found’ just after installation
  9. 09The disk is full
  10. 10The mini-PC is unreachable
  11. 11The public site doesn’t show my changes
  12. 12The agent goes in circles or stops halfway through
  13. 13When none of these symptoms fit
  14. 14Frequently asked questions

In short

Common failures usually come down to the same few causes. If Ollama is slow, the context may be too large for GPU memory. Check with ollama ps. If Claude Code, Codex, or an MCP server can't sign in over SSH, the callback points to localhost. Copy the sign-in address or use an SSH tunnel. A rejected key often means a misnamed or unexported variable, or an ANTHROPIC_API_KEY that takes precedence over your subscription. Use ss -ltnp to find what's using a port, and tmux or systemd with enable-linger to keep work running after logout. For a full disk, check models and Docker images. For an unreachable machine, check Tailscale key expiry and sleep settings. If the agent keeps going in circles, start a new session, raise the effort, or give it a more precise instruction.

Do this first: Maintain and update

Something broke. It happens to everyone. The good news is that the same problems come up on most AI mini-PCs, and each has a command to help diagnose it. Find your symptom below (Ctrl+F works well), run the command, and apply the fix.

Ollama is slow or the machine feels sluggish

Likely cause: the context is set too high. The model cache grows with the context window. When it no longer fits in GPU memory, some work moves to the CPU and performance drops sharply.

ollama ps     # the PROCESSOR column should read '100% GPU'

If you see 48%/52% CPU/GPU or 100% CPU, you’ve found the problem. Try these fixes in order:

If ollama ps says 100% CPU even for a small model, Ollama can’t see the GPU. Check its logs with journalctl -u ollama --since "10 min ago" and look for GPU, ROCm, CUDA, or Vulkan.

The model won’t load

Typical error: model requires more system memory, or the process exits abruptly while loading.

The model won’t fit in available memory. Allow about 0.6 GB per billion parameters at 4 bits, plus the context. On a machine with unified memory, check how much the BIOS or kernel reserves for the GPU. See Choosing hardware. Free up memory (free -h shows how much is available and htop shows what’s using it), or use a smaller version of the model.

SSH won’t connect

Typical error: Permission denied (publickey).

ssh -v vous@mini-pc     # verbose mode shows which key SSH tries and why it is rejected

Check these in order:

  1. The mini-PC is missing your public key. Run ssh-copy-id vous@mini-pc from your computer while password login is still enabled. Otherwise, add the key manually to ~/.ssh/authorized_keys.
  2. The permissions are too broad. SSH rejects a key in a directory other users can read. Run chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys on the mini-PC.
  3. The username is wrong. Your account on the mini-PC may have a different name from the one on your computer.

See Securing access for the recommended setup.

Account sign-in fails over SSH

Symptom: Claude Code, Codex, or an MCP server tries to open a browser and nothing happens, or the final page says it can’t connect to localhost.

At the end of OAuth sign-in, the browser redirects to http://localhost:PORT. Over SSH, the browser’s localhost is your own computer. The tool waiting for that redirect is on the mini-PC.

When you first launch it, press c to copy the sign-in address. Open it on your computer, then paste the code from the page into the terminal. For an MCP server, use claude mcp login nom-du-serveur. If the localhost redirect fails, set a callback port (--callback-port 8080 when adding the server) and open a tunnel from your computer:

ssh -L 8080:localhost:8080 vous@mini-pc

The API key is rejected

Typical errors: 401, invalid x-api-key, Incorrect API key provided, authentication_error.

Check these in order:

  1. The variable is available in this terminal. echo ${ANTHROPIC_API_KEY:0:8} displays the first eight characters without showing the whole key. Empty output? Add export NOM=valeur to ~/.bashrc, then run source ~/.bashrc or open a new terminal.
  2. The variable name is right. Each tool expects a specific name (ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, OPENAI_API_KEY, or the name set by env_key in Codex). The tool only reads the name it expects.
  3. The key has no extra spaces or line breaks. Copying from a document often adds a trailing space.
  4. The endpoint is right. A key from a Chinese coding plan works only at that plan’s endpoint, and sometimes only in one region. See Chinese LLMs.
  5. The key is still valid. The provider console will tell you if the key was revoked or expired, or if you’ve hit a spending cap.

‘Address already in use’: the port is taken

Another program is already listening on the port. It’s often an old copy of your own server still in the background.

sudo ss -ltnp 'sport = :8300'     # replace 8300 with your port to see the program and its PID
  • For a service, run systemctl --user stop nom-du-service (or sudo systemctl stop … for a system service).
  • For another process, stop it by its specific PID with kill 12345. Avoid matching a pattern with pkill. It can catch other programs with the same word in their command line, including the one you’re typing.

The service stops when I close the terminal

Processes tied to an SSH terminal stop when the connection closes. Pick the approach that fits:

  • For a work session (such as a long-running agent), use tmux. Detach with Ctrl+b followed by d. Return with tmux attach.
  • For a permanent service, use systemd with loginctl enable-linger "$USER" so it keeps running when you’re logged out. See the full example in Your first project from start to finish.

‘Command not found’ just after installation

The installer put the command in ~/.local/bin, which isn’t in your PATH yet.

echo $PATH | tr ':' '\n' | grep local/bin    # no output means the folder is missing from PATH
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

The disk is full

Typical error: No space left on device. Suddenly, databases, logging, and updates all stop working.

df -h /                                   # see how much space is left
sudo du -sh /usr/share/ollama/.ollama/models ~/.ollama/models 2>/dev/null   # Ollama models
docker system df                          # Docker images, containers, and volumes
sudo du -sh /var/log/journal              # system logs

Four places to clear space: unused models with ollama rm, dangling images with docker image prune (check broader variants before using them, as they may also delete volumes), logs with sudo journalctl --vacuum-size=500M, and node_modules or .venv folders from old projects. To catch it before it breaks, set up a check that alerts you early. See Knowing when it breaks.

The mini-PC is unreachable

tailscale status      # on your computer, check whether the mini-PC appears and how long it has been offline
  • The Tailscale key expired. By default, devices must reauthenticate every 180 days. For a server, disable key expiry from the Tailscale admin console (Tailscale).
  • The machine went to sleep. Keep server sleep disabled. See System settings.
  • It rebooted and is waiting for something. A kernel update or a disk check may be holding it up. Plug in a monitor or connect from another machine on the local network using its local address.

The public site doesn’t show my changes

If your site uses a Cloudflare tunnel with a cache rule, Cloudflare serves the old version until you purge it. Purge the cache after every deploy, from the dashboard or your deployment script, then reload without the browser cache with Ctrl+Shift+R.

The agent goes in circles or stops halfway through

  • It repeats the same mistake. Stop it with Esc, give it a hint or another approach, or raise reasoning effort one notch (Choosing a reasoning effort).
  • It forgets instructions late in a long session. Ask it to summarize the current state, then start a fresh session (/clear in Claude Code) or compact the conversation (/compact).
  • It hits a usage limit. You’ve used up your allowance for the current 5-hour window or the week. Wait for it to reset or switch models. See Claude Code and Codex with other models.
  • It refuses to run a command. A permission rule or the sandbox is often responsible. In Claude Code, /permissions shows what’s allowed and blocked.

When none of these symptoms fit

0 of 5 steps done Your ticks stay in this browser.

  1. Read the full error message

    The last line often tells you what failed, and the earlier lines tell you why. Copy the whole message, including the lines above the one in red.

  2. Check the logs

    Use journalctl -xe for the system, journalctl --user -u nom-du-service for a user service, or journalctl -u ollama for Ollama.

  3. Ask the agent to diagnose in read-only mode

    ‘Here’s the error and what I was doing. Diagnose it without changing anything, and give me the most likely cause and a command to check it.’

  4. Return to a known state

    Go back to the last working commit (git log, then git stash or git checkout) or use last night’s backup. Check the backup before rebuilding anything by hand.

  5. Tell us what's missing

    Ran into a problem this page doesn’t cover? The report button at the bottom of every guide sends it straight to us.

Frequently asked questions

Why is Ollama so slow on my machine?

Nine times out of ten, the context is too large. The model cache no longer fits in GPU memory, so some of the work moves to the CPU. Check the PROCESSOR column in ollama ps. Anything below 100% GPU means a substantial slowdown. Lower OLLAMA_CONTEXT_LENGTH (32,000 is enough for a coding agent) or use a smaller model.

How do I sign in to Claude Code or Codex on a server without a browser?

In Claude Code, press c to copy the sign-in address. Open it on your computer and paste the code shown into the terminal. In Codex, codex login --device-auth gives you a code to enter on a web page. For an MCP server whose OAuth redirect to localhost fails, open a tunnel to the callback port with ssh -L.

What does 'address already in use' mean?

Another program is already listening on the port, often an old copy of your own server still running in the background. sudo ss -ltnp 'sport = :8300' shows its name and process ID (PID). Stop it by that ID with kill, or use systemctl stop if it's a service.

Why is Claude Code billing me for API usage when I have a subscription?

An ANTHROPIC_API_KEY in your environment takes precedence over your account sign-in. The /status command shows the active authentication method. Remove the variable from ~/.bashrc, open a new terminal, and restart Claude Code.

My mini-PC is unreachable over Tailscale. What should I check?

Three common causes are an expired node key (180 days by default, with an option to disable expiry for servers in the admin console), a sleeping machine, or a stopped tailscaled service. Plug in a monitor or connect from another machine on the local network and run tailscale status.

Terms in this guide: Context windowAgentTokenQuantizationOllamaROCmCUDAParametersUnified memorySSHClaude CodeCodexMCPCoding planTerminal (command line)systemdTailscaleReasoning effort

Spotted a mistake?

A command stopped working, a price changed?

Tools change every month. Tell me what is wrong in this chapter and I will fix it and update its date.

Only the page, your message and the optional contact are kept. Nothing else.

The 38 guides no guides read yet Open the list of guides