multica-ai/multica · error

open %s %s: %w

Error message

open %s %s: %w

What it means

The source file to copy into the task home (e.g. shared config.toml or auth.json referenced by the config) could not be opened with os.Open. The '%s' key names which config setting supplied the path, so the operator knows what to fix.

Source

Thrown at server/internal/daemon/execenv/codex_home.go:1032

	}
	defer root.Close()

	if dir := filepath.Dir(relPath); dir != "." {
		if err := root.MkdirAll(dir, 0o755); err != nil {
			return fmt.Errorf("create %s directory %s: %w", key, dir, err)
		}
	}
	if _, err := root.Lstat(relPath); err == nil {
		if err := root.Remove(relPath); err != nil {
			return fmt.Errorf("remove stale %s copy %s: %w", key, relPath, err)
		}
	} else if !os.IsNotExist(err) {
		return fmt.Errorf("stat %s copy %s: %w", key, relPath, err)
	}

	in, err := os.Open(src)
	if err != nil {
		return fmt.Errorf("open %s %s: %w", key, src, err)
	}
	defer in.Close()

	out, err := root.OpenFile(relPath, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0o644)
	if err != nil {
		return fmt.Errorf("create %s copy %s: %w", key, relPath, err)
	}
	defer out.Close()

	if _, err := io.Copy(out, in); err != nil {
		return fmt.Errorf("copy %s %s to %s: %w", key, src, relPath, err)
	}
	// Close explicitly so a deferred write-back failure cannot be swallowed; the
	// deferred Close then no-ops.
	if err := out.Close(); err != nil {
		return fmt.Errorf("close %s copy %s: %w", key, relPath, err)
	}
	return nil

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Create or restore the missing source file named in the error
  2. Fix the path in the Codex config key identified by the error's key field
  3. Adjust ownership/permissions so the daemon user can read it
Defensive patterns

Strategy: validation

Validate before calling

if _, err := os.Stat(src); err != nil {
	return fmt.Errorf("config source %s missing: %w", src, err)
}

Prevention

When it happens

Trigger: A config-referenced path (absolute, ~/-expanded, or shared-home-relative) points to a file that does not exist or is unreadable by the daemon user.

Common situations: auth.json or config.toml missing from the shared Codex home; a ~/ path on a host where that file was never created; file owned by another user with mode 600.

Related errors


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/04c2cddd60c54f3e. Report an issue: GitHub.