{"record":{"id":"c35299230ca8589c","repo":"argoproj/argo-workflows","slug":"aggregateerror-string","errorCode":null,"errorMessage":"aggregateError.String()","messagePattern":"aggregateError\\.String\\(\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"workflow/executor/executor.go","lineNumber":481,"sourceCode":"\t}\n\n\tvar aggregateError strings.Builder\n\tfor _, art := range we.Template.Outputs.Artifacts {\n\t\tspan.AddEvent(\"upload artifact\",\n\t\t\ttrace.WithAttributes(attribute.KeyValue{Key: \"file\", Value: attribute.StringValue(art.Name)}))\n\t\tsaved, err := we.saveArtifact(ctx, common.MainContainerName, &art)\n\t\tif err != nil {\n\t\t\taggregateError.WriteString(err.Error())\n\t\t\taggregateError.WriteString(\"; \")\n\t\t}\n\t\tif saved {\n\t\t\tartifacts = append(artifacts, art)\n\t\t}\n\t}\n\tif aggregateError.Len() == 0 {\n\t\treturn artifacts, nil\n\t}\n\treturn artifacts, errors.New(aggregateError.String())\n}\n\n// save artifact\n// return whether artifact was in fact saved, and if there was an error\nfunc (we *WorkflowExecutor) saveArtifact(ctx context.Context, containerName string, art *wfv1.Artifact) (bool, error) {\n\tlogger := logging.RequireLoggerFromContext(ctx)\n\t// Determine the file path of where to find the artifact\n\terr := art.CleanPath()\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tctx, span := we.Tracing.StartSaveArtifact(ctx)\n\tdefer span.End()\n\tfileName, localArtPath, err := we.stageArchiveFile(ctx, containerName, art)\n\tif err != nil {\n\t\tif art.Optional && argoerrs.IsCode(argoerrs.CodeNotFound, err) {\n\t\t\tlogger.WithField(\"name\", art.Name).WithField(\"path\", art.Path).WithError(err).Warn(ctx, \"Ignoring optional artifact which does not exist in path\")\n\t\t\treturn false, nil","sourceCodeStart":463,"sourceCodeEnd":499,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/workflow/executor/executor.go#L463-L499","documentation":"SaveArtifacts aggregates the per-artifact upload errors from saveArtifact into one error, joined by '; '. It fires only after all output artifacts were attempted; successfully saved artifacts are still returned alongside the error.","triggerScenarios":"Thrown at workflow/executor/executor.go:481 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the semicolon-separated segments to find which artifact upload failed","Check artifact repository credentials, bucket existence, and network from the pod","Fix the failing artifact config and retry the workflow"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}