{"record":{"id":"e6f8136a164fc240","repo":"ipfs/kubo","slug":"experimental-pubsub-feature-not-enabled-run-daemo","errorCode":null,"errorMessage":"experimental pubsub feature not enabled, run daemon with --enable-pubsub-experiment to use","messagePattern":"experimental pubsub feature not enabled, run daemon with --enable-pubsub-experiment to use","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/coreapi/pubsub.go","lineNumber":100,"sourceCode":"\t}\n\n\t_, err = api.checkNode()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t//nolint deprecated\n\tsub, err := api.pubSub.Subscribe(topic)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &pubSubSubscription{sub}, nil\n}\n\nfunc (api *PubSubAPI) checkNode() (routing.Routing, error) {\n\tif api.pubSub == nil {\n\t\treturn nil, errors.New(\"experimental pubsub feature not enabled, run daemon with --enable-pubsub-experiment to use\")\n\t}\n\n\terr := api.checkOnline(false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn api.routing, nil\n}\n\nfunc (sub *pubSubSubscription) Close() error {\n\tsub.subscription.Cancel()\n\treturn nil\n}\n\nfunc (sub *pubSubSubscription) Next(ctx context.Context) (coreiface.PubSubMessage, error) {\n\tctx, span := tracing.Span(ctx, \"CoreAPI.PubSubSubscription\", \"Next\")\n\tdefer span.End()","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/coreapi/pubsub.go#L82-L118","documentation":"PubSubAPI.checkNode guards every pubsub operation: if the node was constructed without the experimental pubsub feature, api.pubSub is nil and the call fails immediately. PubSub is opt-in in Kubo because it is experimental, so the daemon (or node constructor) must explicitly enable it.","triggerScenarios":"Calling PubSub().Ls, Peers, Publish, or Subscribe on a CoreAPI from a node started without --enable-pubsub-experiment (or with PubSub.Enabled=false in config), or a node built programmatically without wiring the pubsub service.","commonSituations":"Developers running `ipfs pubsub pub/sub` against a default-config daemon, embedding kubo as a library and forgetting to enable the experiment, and daemons started by tools that use stock config.","solutions":["Start the daemon with --enable-pubsub-experiment.","Set config: `ipfs config --json PubSub.Enabled true` and restart the daemon.","In library usage, construct the node with the pubsub option/experimental flag enabled.","Check PubSub.Enabled before calling pubsub APIs to fail early with a clearer message."],"exampleFix":"// before\nipfs daemon\n// after\nipfs daemon --enable-pubsub-experiment\n# or: ipfs config --json PubSub.Enabled true","handlingStrategy":"fallback","validationCode":"cfg, err := api.repoConfig() // or read $IPFS_PATH/config\nif !cfg.PubSub.Enabled {\n\treturn errors.New(\"pubsub disabled: set PubSub.Enabled or pass --enable-pubsub-experiment\")\n}","typeGuard":"func pubsubAvailable(ps iface.PubSubAPI) bool {\n\t// Ls on a disabled node fails fast; probe cheaply at startup\n\t_, err := ps.Ls(context.Background())\n\treturn err == nil || !strings.Contains(err.Error(), \"not enabled\")\n}","tryCatchPattern":"err := api.PubSub().Publish(ctx, topic, data)\nif err != nil && strings.Contains(err.Error(), \"pubsub feature not enabled\") {\n\treturn fmt.Errorf(\"start daemon with --enable-pubsub-experiment: %w\", err)\n}","preventionTips":["Enable PubSub.Enabled in config wherever the daemon is provisioned","Probe pubsub availability once at application startup, not per message","Pin the daemon launch flags in your deployment tooling so the experiment is always on"],"tags":["ipfs","pubsub","config","experimental-feature"],"backgroundTag":"feature-not-enabled","analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}