Skip to main content
Watch: I Built an AI App Without Leaving Databricks

OpenCode error

OpenCode: Error: Unexpected error, check log file at...

Error message
Error: Unexpected error, check log file at [user-home]/.local/share/opencode/log/2025-08-26T215857.log for more details

Status: WorkaroundLast verified 4 documented fixes3 sources

What it means

A generic fatal error wrapper. The real cause is written to the log file named in the message. Examples from issues include an EACCES permission error (#2267) and ProviderModelNotFoundError (#916).

Causes

  • Example from #2267: EACCES: permission denied, open '[user-home]/.local/share/opencode/project/[project-path]/app.json'.
  • Example from #916: a fatal ProviderModelNotFoundError logged just before this message.

How to fix it

  1. Fix 1.

    Read the log. Logs live in ~/.local/share/opencode/log/ (macOS/Linux) or %USERPROFILE%\.local\share\opencode\log (Windows), and the 10 most recent are kept. Run with --print-logs to see output in the terminal, or raise the log level.

    Terminal
    opencode --print-logs
    opencode --log-level DEBUG
  2. Fix 2.

    Make sure you are on the latest version (official docs, "OpenCode won't start").

    Terminal
    opencode upgrade
  3. Fix 3.

    For the permission error, a maintainer asked to inspect ownership of the file named in the log (#2267).

    Snippet
    ls -la ~/.local/share/opencode/project/[project-path]/app.json
  4. Fix 4.

    For a clean reinstall, the docs provide opencode uninstall. A maintainer listed the data directories it uses (#2267).

    Terminal
    opencode uninstall
    # directories listed by a maintainer:
    # ~/.local/share/opencode ~/.cache/opencode ~/.local/state/opencode ~/.config/opencode

More OpenCode errors

All 17 OpenCode errors

FAQ

What does "Error: Unexpected error, check log file at..." mean in OpenCode?

A generic fatal error wrapper. The real cause is written to the log file named in the message. Examples from issues include an EACCES permission error (#2267) and ProviderModelNotFoundError (#916).

How do I fix "Error: Unexpected error, check log file at..."?

There are 4 documented fixes. Start with the first: Read the log. Logs live in ~/.local/share/opencode/log/ (macOS/Linux) or %USERPROFILE%\.local\share\opencode\log (Windows), and the 10 most recent are kept. Run with --print-logs to see output in the terminal, or raise the log level.

Is this OpenCode error fixed?

Status: Workaround. No release removes the cause. The documented fixes work around it. Affected versions: Seen across versions (e.g. 0.4.45, 0.5.28).

Sources

Last verified against 3 sources: official docs, maintainer replies and release notes.

Newsletter

Fixes for the tools you use, weekly

One email per week. New coding agent releases, what broke, and how developers are working around it.