{"record":{"id":"9495ab7b2db7a990","repo":"temporalio/temporal","slug":"task-queue-user-data-replication-failed-v","errorCode":null,"errorMessage":"task queue user data replication failed: %v","messagePattern":"task queue user data replication failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/worker/migration/force_replication_workflow.go","lineNumber":192,"sourceCode":"\t\texecutionsCh.Close()\n\t})\n\n\tif err := enqueueReplicationTasks(ctx, executionsCh, metadataResp.NamespaceID, &params); err != nil {\n\t\treturn err\n\t}\n\n\tif listExecutions != nil {\n\t\treturn listExecutions\n\t}\n\n\tif params.NextPageToken == nil {\n\t\tif workflow.GetVersion(ctx, taskQueueUserDataReplicationVersionMarker, workflow.DefaultVersion, 1) > workflow.DefaultVersion {\n\t\t\terr := workflow.Await(ctx, func() bool { return params.TaskQueueUserDataReplicationStatus.Done })\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif params.TaskQueueUserDataReplicationStatus.FailureMessage != \"\" {\n\t\t\t\treturn fmt.Errorf(\"task queue user data replication failed: %v\", params.TaskQueueUserDataReplicationStatus.FailureMessage)\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\n\tparams.ContinuedAsNewCount++\n\n\t// There are still more workflows to replicate. Continue-as-new to process on a new run.\n\t// This prevents history size from exceeding the server-defined limit\n\treturn workflow.NewContinueAsNewError(ctx, ForceReplicationWorkflow, params)\n}\n\nfunc ForceReplicationWorkflowV2(ctx workflow.Context, params ForceReplicationParams) (retErr error) {\n\t// For now, we'll return the initial page token for simplicity.\n\t// If we want this to be more precise, we could track processed pages.\n\tstartPageToken := params.NextPageToken\n\n\t_ = workflow.SetQueryHandler(ctx, forceReplicationStatusQueryType, func() (ForceReplicationStatus, error) {","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/service/worker/migration/force_replication_workflow.go#L174-L210","documentation":"ForceReplicationWorkflow signals failure when its task-queue user-data replication activity reports a FailureMessage. The workflow waits (workflow.Await) for the replication status to be Done; if the status carries a non-empty FailureMessage it surfaces it as this workflow error, marking the whole force-replication workflow as failed.","triggerScenarios":"During force replication with the taskQueueUserDataReplicationVersionMarker version gate passed, the child activity replicating task queue user data sets TaskQueueUserDataReplicationStatus.FailureMessage; after Await returns, the workflow returns this error.","commonSituations":"Task queue user data (e.g. build IDs / versioning info) failed to replicate to the target cluster because the remote call errored or the target namespace/queue is invalid; the child workflow/activity that performs the replication recorded its error message into the shared status struct.","solutions":["Read the embedded FailureMessage in the workflow failure/result to find the underlying replication error.","Re-run the force-replication workflow after fixing the root cause reported in FailureMessage.","Verify the task queues and their user data exist and are valid on the target cluster.","Check connectivity/auth between clusters for the task queue user data replication path.","Ensure the migration worker is running a version that includes the taskQueueUserDataReplicationVersionMarker."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := workflow.ExecuteChildWorkflow(...).Get(ctx, &out)\nif err != nil {\n    var appErr *temporal.ApplicationError\n    if errors.As(err, &appErr) && strings.Contains(appErr.Error(), \"task queue user data replication failed\") {\n        // inspect FailureMessage and decide whether to retry the whole workflow\n    }\n    return err\n}","preventionTips":["Check the child replication activity's FailureMessage handling and retry policy before launching force-replication.","Verify target cluster task queues and versioning data exist before migration.","Monitor the TaskQueueUserDataReplicationStatus and alert on failure instead of relying on workflow failure.","Ensure both clusters run compatible migration worker versions."],"tags":["go","temporal","workflow","replication","task-queue"],"backgroundTag":"task-queue-user-data-replication-failed","analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}