{"record":{"id":"fa09e2d75bd0ef04","repo":"argoproj/argo-workflows","slug":"neither-s-nor-s-is-available","errorCode":null,"errorMessage":"neither %s nor %s is available","messagePattern":"neither (.+?) nor (.+?) is available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argoexec/commands/emissary.go","lineNumber":330,"sourceCode":"// sets ARGO_TEMPLATE directly on main in that case.\n//\n// Offload-sentinel resolution is shared with the legacy init container via\n// common.ResolveTemplateEnvValue.\nfunc readTemplate() ([]byte, error) {\n\treturn readTemplateAt(varRunArgo+\"/template\", common.EnvConfigMountPath)\n}\n\n// readTemplateAt is the path-parameterized form used by tests; production\n// calls readTemplate with the constants.\nfunc readTemplateAt(filePath, offloadDir string) ([]byte, error) {\n\tif data, err := os.ReadFile(filePath); err == nil {\n\t\treturn data, nil\n\t} else if !errors.Is(err, os.ErrNotExist) {\n\t\treturn nil, err\n\t}\n\tenvVal, ok := os.LookupEnv(common.EnvVarTemplate)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"neither %s nor %s is available\", filePath, common.EnvVarTemplate)\n\t}\n\treturn common.ResolveTemplateEnvValue(envVal, offloadDir)\n}\n\nfunc stageInputArtifacts(ctx context.Context, tmpl *wfv1.Template) error {\n\treturn stageInputArtifactsAt(ctx, common.ExecutorArtifactBaseDir, tmpl)\n}\n\n// stageInputArtifactsAt is the parameterized form used by tests; production\n// calls stageInputArtifacts with the constants. It links each input artifact\n// into place and re-enters the working directory afterwards, stepping off it\n// for the duration: linking replaces the cwd when an artifact's path is the\n// container's workingDir, Windows refuses to delete a directory in use as a\n// working directory, and a child forked with the deleted directory as cwd\n// would see getcwd() fail and relative paths resolve to nothing. The final\n// chdir follows the symlink to whatever now sits at the path.\nfunc stageInputArtifactsAt(ctx context.Context, baseDir string, tmpl *wfv1.Template) error {\n\torigWd, err := os.Getwd()","sourceCodeStart":312,"sourceCodeEnd":348,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argoexec/commands/emissary.go#L312-L348","documentation":"The executor reads the workflow template from /var/run/argo/template, falling back to the ARGO_TEMPLATE environment variable. This error means neither source exists, so argoexec has no template to run and cannot proceed. It indicates a broken pod setup — the component responsible for injecting the template (init container or supervisor) never delivered it.","triggerScenarios":"readTemplateAt finds os.ErrNotExist for /var/run/argo/template AND os.LookupEnv(ARGO_TEMPLATE) reports the env var is unset — e.g. running the emissary binary manually outside a workflow pod, or the init/supervisor stage failed before writing the template file.","commonSituations":"Developers exec-ing `argoexec emissary <cmd>` directly in a pod for testing without setting ARGO_TEMPLATE; a custom/modified pod spec dropping the /var/run/argo emptyDir mount; upgraded controller where init-less templates still expect the supervisor to write the file; local unit-style experiments with a bare docker run.","solutions":["Run argoexec only through a real workflow pod where the controller injects the template.","For manual testing, export ARGO_TEMPLATE with the serialized template JSON (or point to the offloaded sentinel value).","Check the init/wait or supervisor container logs — if it crashed, /var/run/argo/template was never written.","Ensure the /var/run/argo emptyDir volume is present in the pod spec.","Set ARGO_DEBUG_PAUSE or inspect the pod's init container status to find why setup failed."],"exampleFix":"// before (manual exec, no template)\nargoexec emissary -- mycmd\n// after\nexport ARGO_TEMPLATE='{\"name\":\"main\",...}'\nargoexec emissary -- mycmd","handlingStrategy":"validation","validationCode":"// Before running argoexec manually, ensure a template source exists:\nif [ ! -f /var/run/argo/template ] && [ -z \"$ARGO_TEMPLATE\" ]; then\n  echo \"set ARGO_TEMPLATE or run inside a workflow pod\" >&2; exit 1\nfi","typeGuard":null,"tryCatchPattern":"try {\n  await executor.run()\n} catch (e) {\n  if (String(e).includes('neither /var/run/argo/template nor ARGO_TEMPLATE')) {\n    // supply ARGO_TEMPLATE or fix init/supervisor injection\n  }\n}","preventionTips":["Run argoexec only via real workflow pods.","Keep the /var/run/argo emptyDir volume intact in pod specs.","Check init/wait and supervisor container logs first when a pod misbehaves.","For local experiments, always export a valid ARGO_TEMPLATE JSON."],"tags":["kubernetes","argo-workflows","missing-env-var","executor"],"backgroundTag":"missing-env-var","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"}