{"record":{"id":"c5cd96575a6f3d59","repo":"dapr/dapr","slug":"err-publish-outbox","errorCode":"ERR_PUBLISH_OUTBOX","errorMessage":"error publishing internal outbox message: could not find outbox configuration on state store %s","messagePattern":"error publishing internal outbox message: could not find outbox configuration on state store (.+?)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"pkg/runtime/pubsub/outbox.go","lineNumber":167,"sourceCode":"\tuid, err := uuid.NewRandom()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn state.SetRequest{\n\t\tKey:   outboxStatePrefix + \"-\" + uid.String(),\n\t\tValue: \"0\",\n\t}, nil\n}\n\n// PublishInternal publishes the state to an internal topic for outbox processing and returns the updated list of transactions\nfunc (o *outboxImpl) PublishInternal(ctx context.Context, stateStore string, operations []state.TransactionalStateOperation, source, traceID, traceState string) ([]state.TransactionalStateOperation, error) {\n\to.lock.RLock()\n\tc, ok := o.outboxStores[stateStore]\n\to.lock.RUnlock()\n\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"error publishing internal outbox message: could not find outbox configuration on state store %s\", stateStore)\n\t}\n\n\tprojections := map[string]state.SetRequest{}\n\n\tfor i, op := range operations {\n\t\tsr, ok := op.(state.SetRequest)\n\n\t\tif ok {\n\t\t\tfor k, v := range sr.Metadata {\n\t\t\t\tif k == \"outbox.projection\" && kitstrings.IsTruthy(v) {\n\t\t\t\t\tprojections[sr.Key] = sr\n\n\t\t\t\t\toperations = append(operations[:i], operations[i+1:]...)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/dapr/dapr/blob/74ad41702745709bb15fe2114ff693b8c59bc3cc/pkg/runtime/pubsub/outbox.go#L149-L185","documentation":"Outbox error (code ERR_PUBLISH_OUTBOX): PublishInternal was invoked for a state store that has no entry in outboxStores. Entries are only created by AddOrUpdateOutbox when the state store component declares both 'outboxPublishPubsub' and 'outboxPublishTopic' metadata (pkg/runtime/pubsub/outbox.go:102-135). The transactional state save therefore cannot be forwarded to the outbox topic.","triggerScenarios":"Saving state transactionally with outbox metadata naming a state store whose component YAML lacks outboxPublishPubsub/outboxPublishTopic; a typo in those metadata keys (they are case-sensitive); publishing before the state store component finished processing; deleting and re-adding the store without the outbox metadata.","commonSituations":"App sets 'outbox.' metadata on a /state/transaction request assuming outbox is enabled globally; enabling outbox on the pubsub side only; renaming the state store without updating the app's metadata; hot reload dropping the metadata.","solutions":["Add both metadata entries to the state store component: outboxPublishPubsub (and optionally outboxPubsub, outboxDiscardWhenMissingState) plus outboxPublishTopic","Check exact spelling/case of the metadata keys - 'outboxPublishPubsub', 'outboxPublishTopic'","Ensure the named state store has initialized successfully (a failed init can skip outbox registration)","Retry the transaction after re-applying the corrected component"],"exampleFix":"# before (state store without outbox metadata)\nspec:\n  type: state.postgres\n  version: v1\n  metadata: []\n# after\nspec:\n  type: state.postgres\n  version: v1\n  metadata:\n    - name: outboxPublishPubsub\n      value: redis-pubsub\n    - name: outboxPublishTopic\n      value: outbox-events","handlingStrategy":"validation","validationCode":"// Check outbox enablement before sending a transactional save with outbox metadata\nif !outbox.Enabled(stateStoreName) {\n    return fmt.Errorf(\"state store %s lacks outboxPublishPubsub/outboxPublishTopic metadata\", stateStoreName)\n}","typeGuard":"func outboxConfigured(storeName string, stores map[string]struct{}) bool {\n    _, ok := stores[storeName]\n    return ok\n}","tryCatchPattern":"On ERR_PUBLISH_OUTBOX, fail the state transaction explicitly - do not retry with the same metadata. Surface to the operator that the state store component is missing outbox configuration, fix the manifest, then re-issue the transaction.","preventionTips":["Always declare outboxPublishPubsub and outboxPublishTopic together on the state store (exact casing)","Add a manifest lint rule: if the app uses outbox metadata, the named state store must carry both keys","Re-check configuration after renaming state stores"],"tags":["outbox","state","pubsub","configuration","transactions"],"backgroundTag":null,"analyzedSha":"74ad41702745709bb15fe2114ff693b8c59bc3cc","analyzedAt":"2026-08-16T04:22:26.543Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}