{"record":{"id":"92644899ac83d84a","repo":"gastownhall/beads","slug":"dependency-created-by-is-empty-for-s-s","errorCode":null,"errorMessage":"dependency created_by is empty for %s -> %s","messagePattern":"dependency created_by is empty for (.+?) -> (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/migration/legacysqlite/reader.go","lineNumber":901,"sourceCode":"\t}\n\tif err := checkUTF8(\n\t\tcurrentString{\"dependency issue_id\", id},\n\t\tcurrentString{\"dependency depends_on_id\", to},\n\t\tcurrentString{\"dependency type\", typ},\n\t\tcurrentString{\"dependency created_by\", by},\n\t); err != nil {\n\t\treturn err\n\t}\n\tif err := checkCurrentVarchars(\n\t\tcurrentVarchar{\"dependency issue_id\", id, types.MaxFieldLen},\n\t\tcurrentVarchar{\"dependency depends_on_id\", to, types.MaxFieldLen},\n\t\tcurrentVarchar{\"dependency type\", typ, currentShortVarcharRunes},\n\t\tcurrentVarchar{\"dependency created_by\", by, types.MaxFieldLen},\n\t); err != nil {\n\t\treturn err\n\t}\n\tif by == \"\" {\n\t\treturn fmt.Errorf(\"dependency created_by is empty for %s -> %s\", id, to)\n\t}\n\tissue := byID[id]\n\tif issue == nil || byID[to] == nil {\n\t\treturn fmt.Errorf(\"orphan dependency %s -> %s\", id, to)\n\t}\n\tif issue.Ephemeral != byID[to].Ephemeral {\n\t\treturn fmt.Errorf(\"dependency %s -> %s crosses ephemeral storage\", id, to)\n\t}\n\tkey := id + \"\\x00\" + to\n\tif seenDeps[key] {\n\t\treturn fmt.Errorf(\"multiple legacy dependencies for %s -> %s\", id, to)\n\t}\n\tseenDeps[key] = true\n\tcreated, e := parseTime(at)\n\tif e != nil {\n\t\treturn e\n\t}\n\tif created.IsZero() {","sourceCodeStart":883,"sourceCodeEnd":919,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/migration/legacysqlite/reader.go#L883-L919","documentation":"Every legacy dependency row must record who created it (created_by), but this row's created_by column is empty. The reader enforces non-empty created_by because the current schema and audit features rely on dependency provenance; an edge without an author cannot be faithfully imported.","triggerScenarios":"The legacy SQLite dependencies table has a row where created_by is '' (or NULL read as empty string) for the given issue_id -> depends_on_id pair, encountered in appendLegacyDependencyRow after UTF-8/VARCHAR validation passes.","commonSituations":"Very old bd versions that allowed anonymous dependency creation before created_by became mandatory; imports from other trackers that didn't track authors; manual INSERT INTO dependencies statements omitting created_by.","solutions":["Backfill the empty created_by in the legacy DB with a known actor (e.g. the issue creator or a migration placeholder): UPDATE dependencies SET created_by = 'legacy-import' WHERE created_by = ''.","If provenance truly is unknown and the edge is unimportant, DELETE the dependency row before migrating.","Sweep for all empty values at once: SELECT issue_id, depends_on_id FROM dependencies WHERE created_by IS NULL OR created_by = ''.","Then re-run the migration; ensure the placeholder value is a valid actor string within VARCHAR limits."],"exampleFix":"// before: created_by = ''\nUPDATE dependencies SET created_by = 'legacy-import' WHERE created_by = '' OR created_by IS NULL;\n// after: every edge has provenance","handlingStrategy":"validation","validationCode":"rows, err := legacyDB.Query(`SELECT issue_id, depends_on_id FROM dependencies WHERE created_by IS NULL OR created_by = ''`)\n// backfill or delete these rows before migrating","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enforce NOT NULL / non-empty created_by in any tool inserting dependency rows.","Backfill with a documented placeholder actor (e.g. 'legacy-import') when provenance is unknown.","Audit dependencies with SELECT ... WHERE created_by = '' as a pre-migration gate."],"tags":["migration","sqlite","data-integrity","dependency"],"backgroundTag":"missing-required-field","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}