gastownhall/beads · error

setting up stealth mode: %v

Error message

setting up stealth mode: %v

What it means

When --stealth is passed, runInitProxiedServer delegates to fsUseCase.SetupStealthMode to configure stealth (hidden .beads) layout. A failure there is wrapped with this message and init aborts; hooks are skipped because in.skipHooks is only set after stealth setup succeeds.

Source

Thrown at cmd/bd/init_proxied_server.go:104

		fmt.Fprintf(os.Stderr, "Warning: failed to initialize config: %v\n", err)
	}

	if err := checkExistingBeadsData(in.prefix); err != nil {
		return err
	}

	cwd, err := os.Getwd()
	if err != nil {
		return fmt.Errorf("failed to get current directory: %v", err)
	}

	fsProvider := fs.NewFileSystemProvider(cwd, newBeadsDirTemplates(), newFileSystemAdapters())
	fsUseCase := fsProvider.BeadsDirFSUseCase()
	gitUC := git.NewGitProvider(cwd).GitUseCase()

	if in.stealth {
		if err := fsUseCase.SetupStealthMode(ctx, !in.quiet); err != nil {
			return fmt.Errorf("setting up stealth mode: %v", err)
		}
		in.skipHooks = true
	}

	prefix, err := resolveInitPrefix(in.prefix)
	if err != nil {
		return err
	}

	proxiedInit, err := fsUseCase.ResolveProxiedInit(ctx, domain.ResolveProxiedInitParams{
		Prefix: prefix,
		DBFlag: in.database,
	})
	if err != nil {
		return fmt.Errorf("resolving proxied init: %v", err)
	}
	beadsDir, hasExplicitBeadsDir := proxiedInit.BeadsDir, proxiedInit.HasExplicit
	dbName, projectID := proxiedInit.DBName, proxiedInit.ProjectID

View on GitHub (pinned to 71377f2769)

Solutions

  1. Read the wrapped cause after the colon to see whether it's permissions, conflicts, or IO.
  2. Fix permissions on the repo root so stealth layout changes can be applied, then re-run.
  3. Remove or resolve any conflicting existing .beads directory before using --stealth.
  4. Retry without --stealth to confirm the failure is specific to stealth setup.

Example fix

// before
bd init --proxied-server --stealth  // setting up stealth mode: permission denied
// after
chmod u+w /path/to/repo/.beads  # or resolve conflicting .beads
bd init --proxied-server --stealth
Defensive patterns

Strategy: try-catch

Validate before calling

// Ensure repo root and .beads are writable before stealth setup
if fi, err := os.Stat(".beads"); err == nil && fi.Mode()&0200 == 0 {
    return errors.New(".beads not writable for stealth setup")
}

Try / catch

if err := fsUseCase.SetupStealthMode(ctx, !in.quiet); err != nil {
    // wrapped as: setting up stealth mode: %v — inspect cause, fix perms/conflict, retry
    return err
}

Prevention

When it happens

Trigger: SetupStealthMode(ctx, !in.quiet) returns an error while setting up the stealth-mode directory layout — typically filesystem permission or IO errors creating/renaming the stealth .beads structure.

Common situations: Read-only or restricted filesystems blocking the stealth layout changes, conflicts with an existing non-stealth .beads directory, or sandboxed environments that disallow the required renames.

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/337e65c5f757c035. Report an issue: GitHub.