{"record":{"id":"3e418640e303e1dd","repo":"argoproj/argo-workflows","slug":"failed-to-fetch-v-w","errorCode":null,"errorMessage":"failed to fetch %v: %w","messagePattern":"failed to fetch (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"workflow/artifacts/git/git.go","lineNumber":164,"sourceCode":"\t\t}\n\t\tif err = r.CreateBranch(&config.Branch{Name: branchName, Remote: git.DefaultRemoteName, Merge: plumbing.Master}); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to create branch %q: %w\", branchName, err)\n\t\t}\n\t\treturn nil\n\t} else if err != nil {\n\t\treturn fmt.Errorf(\"failed to clone %q: %w\", a.Repo, err)\n\t}\n\tif len(a.Fetch) > 0 {\n\t\trefSpecs := make([]config.RefSpec, len(a.Fetch))\n\t\tfor i, spec := range a.Fetch {\n\t\t\trefSpecs[i] = config.RefSpec(spec)\n\t\t}\n\t\topts := &git.FetchOptions{Auth: auth, RefSpecs: refSpecs, Depth: depth, InsecureSkipTLS: g.InsecureSkipTLS}\n\t\tif validateErr := opts.Validate(); validateErr != nil {\n\t\t\treturn fmt.Errorf(\"failed to validate fetch %v: %w\", refSpecs, validateErr)\n\t\t}\n\t\tif err = r.Fetch(opts); isFetchErr(err) {\n\t\t\treturn fmt.Errorf(\"failed to fetch %v: %w\", refSpecs, err)\n\t\t}\n\t}\n\tw, err := r.Worktree()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get work tree: %w\", err)\n\t}\n\n\tif a.Revision != \"\" {\n\t\trefSpecs := []config.RefSpec{\"refs/heads/*:refs/heads/*\"}\n\t\tif a.SingleBranch {\n\t\t\trefSpecs = []config.RefSpec{config.RefSpec(fmt.Sprintf(\"refs/heads/%s:refs/heads/%s\", a.Branch, a.Branch))}\n\t\t}\n\t\topts := &git.FetchOptions{Auth: auth, RefSpecs: refSpecs, InsecureSkipTLS: g.InsecureSkipTLS}\n\t\tif err := opts.Validate(); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to validate fetch %v: %w\", refSpecs, err)\n\t\t}\n\t\tif err := r.Fetch(opts); isFetchErr(err) {\n\t\t\treturn fmt.Errorf(\"failed to fetch %v: %w\", refSpecs, err)","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/workflow/artifacts/git/git.go#L146-L182","documentation":"During git artifact Load, the explicit fetch (a.Fetch refspecs) failed with an error other than 'already up-to-date' — bad refspec, missing ref on the remote, or auth failure. The refspecs are included in the message.","triggerScenarios":"Thrown at workflow/artifacts/git/git.go:164 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the fetch refspecs reference branches/tags that exist on the remote","Verify repo credentials (SSH key/username+password) are correct"],"exampleFix":null,"handlingStrategy":"try-catch","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"}