{"record":{"id":"d1026c20c0a5813c","repo":"gastownhall/beads","slug":"source-db-and-output-are-required","errorCode":null,"errorMessage":"--source-db and --output are required","messagePattern":"--source-db and --output are required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/legacy_sqlite_reader.go","lineNumber":22,"sourceCode":"\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/spf13/cobra\"\n\t\"github.com/steveyegge/beads/internal/migration/legacysqlite\"\n)\n\nvar legacySQLiteCmd = &cobra.Command{\n\tUse:           \"legacy-sqlite --source-db PATH --output PATH|-\",\n\tShort:         \"Read an authenticated legacy SQLite database as JSONL\",\n\tAnnotations:   map[string]string{skipStoreAnnotation: \"1\"},\n\tArgs:          cobra.NoArgs,\n\tSilenceUsage:  true,\n\tSilenceErrors: true,\n\tRunE: func(cmd *cobra.Command, _ []string) error {\n\t\tsource, _ := cmd.Flags().GetString(\"source-db\")\n\t\toutput, _ := cmd.Flags().GetString(\"output\")\n\t\tif source == \"\" || output == \"\" {\n\t\t\treturn fmt.Errorf(\"--source-db and --output are required\")\n\t\t}\n\t\treturn legacysqlite.Export(cmd.Context(), source, output, os.Stdout)\n\t},\n}\n\nfunc init() {\n\tmigrateCmd.AddCommand(legacySQLiteCmd)\n\tlegacySQLiteCmd.Flags().String(\"source-db\", \"\", \"Legacy SQLite database (read-only)\")\n\tlegacySQLiteCmd.Flags().String(\"output\", \"\", \"JSONL output path, or - for stdout\")\n}\n","sourceCodeStart":4,"sourceCodeEnd":33,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/legacy_sqlite_reader.go#L4-L33","documentation":"Validation error in the legacy SQLite export subcommand: both --source-db and --output flags must be provided. RunE checks the flag values and refuses to run the export when either is empty. The command has SilenceUsage/SilenceErrors, so this message is delivered through the command's own error handling.","triggerScenarios":"Invoking the legacy SQLite export command without --source-db, without --output, or with either flag set to an empty string.","commonSituations":"Scripting the one-time migration export from an old beads SQLite database and omitting flags; copying an invocation example but dropping required arguments; flags defined but never bound to defaults.","solutions":["Re-run with both flags: --source-db <path-to-legacy.db> --output <export-path>","Check your script/wrapper passes non-empty values (quote paths, verify with set -x)","Run the command's --help to confirm exact flag names"],"exampleFix":"// before\nbd legacy-sqlite-export --source-db old.db\n// after\nbd legacy-sqlite-export --source-db old.db --output issues.jsonl","handlingStrategy":"validation","validationCode":"// shell pre-check before invoking the command\n[ -n \"$SOURCE_DB\" ] && [ -n \"$OUTPUT\" ] && [ -f \"$SOURCE_DB\" ] || { echo \"--source-db and --output are required\"; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass both flags explicitly in scripts; never rely on defaults","Validate the source DB path exists before exporting","Pin the exact command invocation in migration runbooks to avoid dropped flags"],"tags":["cli","validation","missing-argument","migration"],"backgroundTag":"missing-required-flag","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}