```bash
ollama launch opencode --model qwen3.6
```
<details>
<summary>Output:</summary>

```
This will modify your OpenCode configuration:
/scratch/loison_benjamin/.config/opencode/opencode.json
/scratch/loison_benjamin/.local/state/opencode/model.json
Backups will be saved to /tmp/ollama-backups/

Proceed?

Yes No

←/→ navigate • enter confirm • esc cancel
```
</details>

*Yes* results in:

```
Error: setup failed: backup failed: open /tmp/ollama-backups/model.json.1778194704: permission denied
```

How can I solve this issue?
May 7, 11:02pm

The error indicates that the ollama launch opencode command is failing because it cannot create a backup file in /tmp/ollama-backups/ due to permission denied on the target directory or file.

How to Solve This

1. Check /tmp Permissions

  • /tmp is typically world-writable, but sometimes restrictions apply (e.g., on shared systems or custom configurations).
  • Run:
    bash
    ls -ld /tmp
  • If /tmp is not writable by your user, contact your system administrator.

2. Create the Backup Directory Manually

  • Try creating the directory yourself:
    bash
    mkdir -p /tmp/ollama-backups/
    chmod 755 /tmp/ollama-backups/
  • Then retry the ollama launch opencode command.

3. Use a Different Backup Location

  • If /tmp is restricted, specify a different directory for backups.
  • Set the TMPDIR environment variable to a writable location:
    bash
    export TMPDIR=$HOME/tmp
    mkdir -p $TMPDIR
    ollama launch opencode --model qwen3.6

4. Run as Root (Not Recommended)

  • If you have admin rights and are sure about the action, try:
    bash
    sudo ollama launch opencode --model qwen3.6
  • Warning: Running as root can be risky. Only do this if you understand the implications.

5. Check for Existing Backups

  • If /tmp/ollama-backups/ already exists but is owned by another user, either:
    • Delete it (if safe):
      bash
      sudo rm -rf /tmp/ollama-backups/
    • Or change ownership:
      bash
      sudo chown -R $USER:$USER /tmp/ollama-backups/

Next Steps

Try option 2 or 3 first. If the issue persists, check the exact permissions of /tmp and the backup directory.

May 7, 11:02pm

This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.