{"record":{"id":"bcf69c48ae3d98cb","repo":"gastownhall/beads","slug":"notion-create-database-response-did-not-include-a","errorCode":null,"errorMessage":"Notion create database response did not include a child data source","messagePattern":"Notion create database response did not include a child data source","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/notion.go","lineNumber":660,"sourceCode":"\t}\n\n\tfor _, raw := range issue.Labels {\n\t\tlabel := strings.ToLower(strings.TrimSpace(raw))\n\t\tif _, ok := configured[label]; ok {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc runNotionInitAfterValidation(ctx context.Context, client *notion.Client, parent, title string, setter notionConfigSetter, deleter notionConfigDeleter) (notionSetupResult, error) {\n\tdb, err := client.CreateDatabase(ctx, parent, title)\n\tif err != nil {\n\t\treturn notionSetupResult{}, err\n\t}\n\tif len(db.DataSources) == 0 || strings.TrimSpace(db.DataSources[0].ID) == \"\" {\n\t\treturn notionSetupResult{}, fmt.Errorf(\"Notion create database response did not include a child data source\")\n\t}\n\tresult := notionSetupResult{\n\t\tAction:       \"init\",\n\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","sourceCodeStart":642,"sourceCodeEnd":678,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/notion.go#L642-L678","documentation":"During `bd notion init`, bd calls the Notion API to create a database under the given parent and expects the response to contain at least one child data source with a non-empty ID. If Notion returns a database without usable data sources (API version drift, unexpected response shape), bd cannot configure notion.data_source_id and fails with this error.","triggerScenarios":"runNotionInitAfterValidation calls client.CreateDatabase and receives a response where db.DataSources is empty or DataSources[0].ID is blank/whitespace.","commonSituations":"Notion API behavior/version change returning a new database whose data sources are provisioned asynchronously; Notion incident/partial response; API client out of date relative to Notion's current response schema.","solutions":["Retry `bd notion init` — data source provisioning on Notion's side can be transient.","Update bd to the latest version so the Notion client matches current API response shapes.","Check Notion status/incidents; retry later if Notion is degraded.","As a workaround, create/locate the database manually and use `bd notion connect --url <notion-url>` instead."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"result, err := runNotionInit(cmd, args)\nif err != nil && strings.Contains(err.Error(), \"did not include a child data source\") {\n    // transient/provisioning issue: back off and retry init once\n    time.Sleep(2 * time.Second)\n    return runNotionInit(cmd, args)\n}","preventionTips":["Keep bd updated so the Notion client matches current API responses","Fall back to `bd notion connect --url` if init keeps failing","Check Notion service status before bulk provisioning","Retry init rather than assuming permanent breakage"],"tags":["go","notion","api","init"],"backgroundTag":"unexpected-api-response","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}