Skip to content

Config initialization crashes when os.userInfo() fails in containers #29292

Closed

Description

@LifeJiggy

Description

In src/config/config.ts, the loadInstanceState function calls os.userInfo().username to set a default username when none is configured. In minimal Docker/OCI containers or sandboxed environments where the passwd entry is unavailable, os.userInfo() throws an error (ENOENT), causing the entire config initialization to fail.

The effect is wrapped with .pipe(Effect.orDie) at line 794, so the error propagates as a defect and prevents the application from starting.

Steps to reproduce

  1. Run opencode in a minimal Docker container without /etc/passwd
  2. Config initialization fails

Expected behavior

Config should fall back to a default username like "user" when os.userInfo() is unavailable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions