{"record":{"id":"da41ac14dba9bbf8","repo":"argoproj/argo-workflows","slug":"failed-waiting-for-debug-pause-after-marker-w","errorCode":null,"errorMessage":"failed waiting for debug-pause-after marker: %w","messagePattern":"failed waiting for debug-pause-after marker: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/argoexec/commands/emissary.go","lineNumber":279,"sourceCode":"\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tlogger.WithField(\"containerName\", containerName).WithError(err).Error(innerCtx, \"failed to terminate/kill container\")\n\t\t\t\t\t}\n\t\t\t\t}()\n\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\treturn osspecific.Wait(command.Process)\n\t})\n\tlogger.WithError(cmdErr).Info(ctx, \"sub-process exited\")\n\n\tif os.Getenv(\"ARGO_DEBUG_PAUSE_AFTER\") == \"true\" {\n\t\t// User can create the file: /ctr/NAME_OF_THE_CONTAINER/after\n\t\t// in order to break out of the wait and release the container from\n\t\t// the debugging state.\n\t\tif waitErr := file.WaitForCreate(ctx, varRunArgo+\"/ctr/\"+containerName+\"/after\"); waitErr != nil {\n\t\t\treturn fmt.Errorf(\"failed waiting for debug-pause-after marker: %w\", waitErr)\n\t\t}\n\t}\n\n\texitCode = exitCodeFromErr(cmdErr, exitCode)\n\n\tif containerName == common.MainContainerName {\n\t\tfor _, x := range template.Outputs.Parameters {\n\t\t\tif x.ValueFrom != nil && x.ValueFrom.Path != \"\" {\n\t\t\t\tif err := saveParameter(ctx, template, x.ValueFrom.Path); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor _, x := range template.Outputs.Artifacts {\n\t\t\tif x.Path != \"\" {\n\t\t\t\tif err := saveArtifact(ctx, template, x.Path); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argoexec/commands/emissary.go#L261-L297","documentation":"When ARGO_DEBUG_PAUSE_AFTER=true, argoexec pauses after the container command exits and waits for the marker file /var/run/argo/ctr/<container>/after to be created, letting a developer inspect state. This error is thrown when that wait is interrupted — almost always because the surrounding context was cancelled or its deadline expired before the marker appeared.","triggerScenarios":"ARGO_DEBUG_PAUSE_AFTER env set to \"true\" but nobody creates the /ctr/<name>/after file before the context is cancelled (workflow terminated, pod deleted, debug timeout elapsed).","commonSituations":"Developer enables the debug pause but forgets to exec into the pod and touch the marker file; the pod's grace period or the workflow's activeDeadlineSeconds kills it first; kubectl exec session fails so the file is never created.","solutions":["Exec into the pod and create the marker: kubectl exec <pod> -c <container> -- touch /argo/ctr/<containerName>/after.","Extend or remove activeDeadlineSeconds / termination grace while debugging.","Unset ARGO_DEBUG_PAUSE_AFTER when not actively debugging.","Do not delete/terminate the workflow while paused."],"exampleFix":"// before (pod deleted while paused)\nARGO_DEBUG_PAUSE_AFTER: \"true\"  # no one creates the marker\n// after\n# in another terminal, before the deadline:\nkubectl exec -it <pod> -c main -- touch /argo/ctr/main/after","handlingStrategy":"try-catch","validationCode":"// Before relying on the pause, confirm the env and that you can exec in:\n// kubectl exec <pod> -c <ctr> -- sh -c 'test -w /argo/ctr && echo ok'","typeGuard":null,"tryCatchPattern":"try {\n  await waitPodTermination(pod)\n} catch (e) {\n  if (String(e).includes('debug-pause-after')) {\n    // create the marker or release the workflow:\n    // kubectl exec <pod> -c <ctr> -- touch /argo/ctr/<ctr>/after\n  }\n}","preventionTips":["Only set ARGO_DEBUG_PAUSE_AFTER while actively debugging, and unset afterwards.","Script the marker creation immediately after the pod starts.","Raise activeDeadlineSeconds while debugging."],"tags":["kubernetes","argo-workflows","debugging","context-cancelled"],"backgroundTag":"context-cancelled","analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}