gastownhall/beads · error

store does not support config deletion

Error message

store does not support config deletion

What it means

saveNotionTargetConfigWithWriter deletes 'notion.view_url' when an empty view URL is supplied, but deletion requires a deleter capability. If the store passed in implements only notionConfigSetter and its deleter is nil, this error is thrown: the store does not support config deletion.

Source

Thrown at cmd/bd/notion.go:717

func notionConfigDeleteTarget() notionConfigDeleter {
	if store == nil {
		return nil
	}
	deleter, _ := storage.UnwrapStore(store).(notionConfigDeleter)
	return deleter
}

func saveNotionTargetConfigWithWriter(ctx context.Context, setter notionConfigSetter, deleter notionConfigDeleter, dataSourceID, viewURL string) error {
	if setter == nil {
		return fmt.Errorf("database not available")
	}
	if err := setter.SetConfig(ctx, "notion.data_source_id", strings.TrimSpace(dataSourceID)); err != nil {
		return fmt.Errorf("save notion.data_source_id: %w", err)
	}
	viewURL = strings.TrimSpace(viewURL)
	if viewURL == "" {
		if deleter == nil {
			return fmt.Errorf("store does not support config deletion")
		}
		if err := deleter.DeleteConfig(ctx, "notion.view_url"); err != nil {
			return fmt.Errorf("clear notion.view_url: %w", err)
		}
		return nil
	}
	if err := setter.SetConfig(ctx, "notion.view_url", viewURL); err != nil {
		return fmt.Errorf("save notion.view_url: %w", err)
	}
	return nil
}

func writeNotionJSON(cmd *cobra.Command, value interface{}) error {
	encoder := json.NewEncoder(cmd.OutOrStdout())
	encoder.SetIndent("", "  ")
	return encoder.Encode(value)
}

View on GitHub (pinned to 71377f2769)

Solutions

  1. Use a store that implements config deletion (upgrade beads / use the default Dolt store).
  2. Provide a non-empty --view-url so the deleter path is skipped and the URL is overwritten instead.
  3. Update the existing notion.view_url to a placeholder then remove it with a deletion-capable store.
  4. Check which store the --db flag points to; switch to a deletion-capable backend.

Example fix

// before
bd notion init --data-source-id abc            # clears view_url; store lacks deletion -> error
// after
bd notion init --data-source-id abc --view-url https://notion.so/my-view
Defensive patterns

Strategy: fallback

Validate before calling

if viewURL == "" {
    if deleter == nil {
        // pre-check: cannot clear view_url on this store
        return errors.New("current store cannot delete config; provide --view-url or upgrade")
    }
}

Type guard

func supportsConfigDelete(s interface{}) bool {
    d, ok := s.(interface{ DeleteConfig(context.Context, string) error })
    return ok && d != nil
}

Try / catch

if err := saveNotionTargetConfigWithWriter(ctx, setter, deleter, dsID, viewURL); err != nil {
    if strings.Contains(err.Error(), "does not support config deletion") {
        // retry with a non-empty viewURL or a deletion-capable store
    }
    return err
}

Prevention

When it happens

Trigger: Calling bd notion init/connect (or the anonymous caller) with viewURL == "" (to clear the view URL) against a store whose DeleteConfig capability is nil — i.e. a store implementation that lacks the config-deletion interface.

Common situations: Users clearing the Notion view URL ('bd notion init --data-source-id X' with no --view-url) while connected to a store/remote or older storage backend that doesn't implement config deletion.

Related errors


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