{"record":{"id":"7c8bf15c099f2c6d","repo":"dapr/dapr","slug":"failed-to-load-declarative-subscriptions-s","errorCode":null,"errorMessage":"failed to load declarative subscriptions: %s","messagePattern":"failed to load declarative subscriptions: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/runtime/runtime.go","lineNumber":758,"sourceCode":"\t\treturn fmt.Errorf(\"failed to load components: %s\", err)\n\t}\n\n\tif err = a.flushOutstandingComponents(ctx); err != nil {\n\t\treturn err\n\t}\n\n\terr = a.loadHTTPEndpoints(ctx)\n\tif err != nil {\n\t\tlog.Warnf(\"failed to load HTTP endpoints: %s\", err)\n\t}\n\n\tif err = a.flushOutstandingHTTPEndpoints(ctx); err != nil {\n\t\treturn err\n\t}\n\n\terr = a.loadDeclarativeSubscriptions(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to load declarative subscriptions: %s\", err)\n\t}\n\n\tif err = a.channels.Refresh(); err != nil {\n\t\tlog.Warnf(\"failed to open %s channel to app: %s\", string(a.runtimeConfig.appConnectionConfig.Protocol), err)\n\t}\n\n\t// Setup allow/deny list for secrets\n\ta.populateSecretsConfiguration()\n\n\ta.namespace = security.CurrentNamespace()\n\n\t// Create and start the external gRPC server\n\ta.daprUniversal = universal.New(universal.Options{\n\t\tAppID:                       a.runtimeConfig.id,\n\t\tNamespace:                   a.namespace,\n\t\tLogger:                      logger.NewLogger(\"dapr.api\"),\n\t\tCompStore:                   a.compStore,\n\t\tResiliency:                  a.resiliency,","sourceCodeStart":740,"sourceCodeEnd":776,"githubUrl":"https://github.com/dapr/dapr/blob/74ad41702745709bb15fe2114ff693b8c59bc3cc/pkg/runtime/runtime.go#L740-L776","documentation":"loadDeclarativeSubscriptions failed: the subscription loader (disk path for standalone, operator client for Kubernetes) returned an error, or committing one of the subscriptions to the processor returned an error. Declarative subscriptions are read before StartAppSubscriptions so that first-declared-per-topic dedup works; any failure here aborts init.","triggerScenarios":"A Subscription YAML in the resources path that fails schema validation: missing required pubsubname/topic/route, invalid scopes, bad apiVersion/kind; kubernetes mode with an operator stream error; or the pending-subscription processing loop returning an error for one resource.","commonSituations":"Hand-edited subscription files missing 'route'; mixing v1alpha1 and v2alpha1 apiVersions incorrectly; leftover test subscriptions in the components folder; operator/RBAC problems in-cluster.","solutions":["Inspect the nested error to see which subscription and which field failed","Fix each Subscription manifest: required fields are pubsubname, topic, route; validate scopes and apiVersion against the docs","Remove subscriptions you no longer use from the resources path/namespace","In k8s, confirm the operator is healthy and RBAC allows listing subscriptions"],"exampleFix":"# before\napiVersion: dapr.io/v1alpha1\nkind: Subscription\nmetadata:\n  name: orders-sub\nspec:\n  pubsubname: redis-pubsub\n  topic: orders\n# after\nspec:\n  pubsubname: redis-pubsub\n  topic: orders\n  route: /orders","handlingStrategy":"validation","validationCode":"func validateSubscription(s subapi.Subscription) error {\n    if s.Spec.PubsubName == \"\" || s.Spec.Topic == \"\" || s.Spec.Route == \"\" {\n        return fmt.Errorf(\"subscription %s: pubsubname, topic, and route are required\", s.Name)\n    }\n    return nil\n}","typeGuard":"func isDeclarativeSubscription(obj runtime.Object) bool {\n    _, ok := obj.(*subapi.Subscription)\n    return ok\n}","tryCatchPattern":null,"preventionTips":["Require pubsubname/topic/route in subscription manifest templates","Keep subscription files out of unrelated folders scanned by --resources-path","Validate Subscription resources with kubectl --dry-run=server to catch schema errors pre-deploy"],"tags":["pubsub","subscription","manifest","configuration"],"backgroundTag":null,"analyzedSha":"74ad41702745709bb15fe2114ff693b8c59bc3cc","analyzedAt":"2026-08-16T04:22:26.543Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}