{"record":{"id":"d355686e12d91b27","repo":"gastownhall/beads","slug":"target-is-missing-required-notion-properties-s","errorCode":null,"errorMessage":"target is missing required Notion properties: %s","messagePattern":"target is missing required Notion properties: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/notion.go","lineNumber":682,"sourceCode":"\t\tDatabaseID:   strings.TrimSpace(db.ID),\n\t\tDataSourceID: strings.TrimSpace(db.DataSources[0].ID),\n\t\tViewURL:      strings.TrimSpace(db.URL),\n\t\tMessage:      \"Notion target initialized\",\n\t}\n\tif err := saveNotionTargetConfigWithWriter(ctx, setter, deleter, result.DataSourceID, result.ViewURL); err != nil {\n\t\treturn notionSetupResult{}, err\n\t}\n\treturn result, nil\n}\n\nfunc runNotionConnectAfterValidation(ctx context.Context, client *notion.Client, url string, setter notionConfigSetter, deleter notionConfigDeleter) (notionSetupResult, error) {\n\tresolved, err := notion.ResolveDataSourceReference(ctx, client, url)\n\tif err != nil {\n\t\treturn notionSetupResult{}, err\n\t}\n\tschema := notion.ValidateDataSourceSchema(resolved.DataSource)\n\tif len(schema.Missing) > 0 {\n\t\treturn notionSetupResult{}, fmt.Errorf(\"target is missing required Notion properties: %s\", strings.Join(schema.Missing, \", \"))\n\t}\n\tresult := notionSetupResult{\n\t\tAction:       \"connect\",\n\t\tDataSourceID: resolved.DataSourceID,\n\t\tViewURL:      strings.TrimSpace(url),\n\t\tMessage:      \"Notion target connected\",\n\t}\n\tif resolved.Database != nil {\n\t\tresult.DatabaseID = strings.TrimSpace(resolved.Database.ID)\n\t}\n\tif err := saveNotionTargetConfigWithWriter(ctx, setter, deleter, result.DataSourceID, result.ViewURL); err != nil {\n\t\treturn notionSetupResult{}, err\n\t}\n\treturn result, nil\n}\n\nfunc notionConfigDeleteTarget() notionConfigDeleter {\n\tif store == nil {","sourceCodeStart":664,"sourceCodeEnd":700,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/notion.go#L664-L700","documentation":"`bd notion connect` validates that the target Notion data source has the schema bd requires. notion.ValidateDataSourceSchema computes a list of missing required properties; if any are absent, connect is refused with the list so the user can fix the Notion database schema rather than failing later during sync.","triggerScenarios":"Running `bd notion connect --url <notion-url>` (or tests resolving a database URL) where the resolved data source lacks one or more required properties — e.g. a plain Notion database without the status/priority/title properties bd expects.","commonSituations":"Connecting an arbitrary pre-existing Notion database created by hand; a database created by an older bd version with an outdated schema; duplicating a database into a workspace that dropped properties; selecting a data source of the wrong type.","solutions":["Add the missing properties listed in the error to the Notion database (the message enumerates them).","Instead, run `bd notion init --parent <page-id>` to create a correctly-schemaed database automatically.","Re-run `bd notion connect --url <notion-url>` after the schema is fixed.","Confirm you connected to the bd-managed database, not a similarly named one."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Preflight the target database schema before connecting\nresolved, err := notion.ResolveDataSourceReference(ctx, client, url)\nif err != nil { return err }\nschema := notion.ValidateDataSourceSchema(resolved.DataSource)\nif len(schema.Missing) > 0 {\n    return fmt.Errorf(\"add missing properties to the Notion database first: %s\", strings.Join(schema.Missing, \", \"))\n}","typeGuard":null,"tryCatchPattern":"if _, err := runNotionConnect(cmd, args); err != nil {\n    if strings.Contains(err.Error(), \"missing required Notion properties\") {\n        // guide user to add the listed properties or use `bd notion init`\n    }\n    return err\n}","preventionTips":["Prefer `bd notion init` (creates a correct schema) over connecting hand-made databases","Compare the target database against a known-good bd-managed database","Re-check schema after duplicating or moving Notion databases","Keep bd updated in case required properties evolve"],"tags":["go","notion","schema","validation"],"backgroundTag":"schema-validation-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}