gastownhall/beads · error

--from-jsonl specified but %s does not exist

Error message

--from-jsonl specified but %s does not exist

What it means

`bd init --from-jsonl` imports issues from a local JSONL file (the configured import path under .beads). If that file does not exist, bd closes the store and aborts initialization with this error naming the missing path.

Source

Thrown at cmd/bd/init.go:1818

		// sync state that must not be written into the shared, server-owned database.
		//
		// It is NOT part of the bootstrap, and neither are the fingerprints
		// above: those four values are refreshed on EVERY init, adopt or not,
		// while the identity is written once and adopted forever.
		if shouldWriteInitStateToDB(doltCfg.Gateway) {
			if err := store.SetMetadata(ctx, "last_import_time", time.Now().Format(time.RFC3339)); err != nil {
				fmt.Fprintf(os.Stderr, "Warning: failed to initialize last_import_time: %v\n", err)
				// Non-fatal - continue anyway
			}
		}

		// Import from local JSONL if requested (GH#2023).
		// This must run after the store is created and prefix is set.
		if fromJSONL {
			localJSONLPath := configuredImportJSONLPath(beadsDir)
			if _, statErr := os.Stat(localJSONLPath); os.IsNotExist(statErr) {
				_ = store.Close()
				return fmt.Errorf("--from-jsonl specified but %s does not exist", localJSONLPath)
			}
			issueCount, importErr := importFromLocalJSONL(ctx, store, localJSONLPath)
			if importErr != nil {
				_ = store.Close()
				return fmt.Errorf("failed to import from JSONL: %v", importErr)
			}
			if !quiet {
				fmt.Printf("  Imported %d issues from %s\n", issueCount, localJSONLPath)
			}
		}

		// Prompt for contributor mode if:
		// - In a git repo (needed to set beads.role config)
		// - Interactive terminal (stdin is TTY) and not --non-interactive
		// - No explicit --contributor or --team flag provided
		// - No explicit --role flag provided
		if isGitRepo() && !contributor && !team && roleFlag == "" && !nonInteractive && shouldPromptForRole() {
			promptedContributor, err := promptContributorMode()

View on GitHub (pinned to 71377f2769)

Solutions

  1. Create or restore the expected file at the path named in the error (typically .beads/issues.jsonl)
  2. Run bd init from the project root so the .beads path resolves where the JSONL lives
  3. If the data is elsewhere, move/copy it to the configured import path, or set the config/env that changes configuredImportJSONLPath
  4. Drop --from-jsonl if no local import is actually needed

Example fix

// before (fails)
$ bd init --from-jsonl   # .beads/issues.jsonl missing
// after
$ cp backup/issues.jsonl .beads/issues.jsonl
$ bd init --from-jsonl
Defensive patterns

Strategy: validation

Validate before calling

jsonl=.beads/issues.jsonl
if [ "$FROM_JSONL" = 1 ] && [ ! -f "$jsonl" ]; then
  echo "$jsonl missing — provide it or drop --from-jsonl"; exit 1
fi

Try / catch

bd init --from-jsonl || { echo "check the path named in the error"; ls .beads; }

Prevention

When it happens

Trigger: `bd init --from-jsonl` is passed, configuredImportJSONLPath(beadsDir) is stat'd, and os.Stat returns os.IsNotExist.

Common situations: User assumes bd will import from a repo's issues.jsonl that is absent or named differently, running from the wrong working directory so beadsDir resolves elsewhere, or the JSONL was gitignored/deleted before init.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


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