{"record":{"id":"0c07ec20c4519b15","repo":"portainer/portainer","slug":"failed-to-get-repository-root-item-with-a-status","errorCode":null,"errorMessage":"failed to get repository root item with a status \"%v\"","messagePattern":"failed to get repository root item with a status \"(.+?)\"","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/git/azure.go","lineNumber":217,"sourceCode":"\tif err != nil {\n\t\treturn nil, errors.WithMessage(err, \"failed to create a new HTTP request\")\n\t}\n\n\tclient := newHttpClientForAzure(opt.InsecureSkipTLS)\n\tdefer client.CloseIdleConnections()\n\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn nil, errors.WithMessage(err, \"failed to make an HTTP request\")\n\t}\n\tdefer func() {\n\t\tif err := resp.Body.Close(); err != nil {\n\t\t\tlog.Warn().Err(err).Msg(\"failed to close response body\")\n\t\t}\n\t}()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, checkAzureStatusCode(fmt.Errorf(\"failed to get repository root item with a status \\\"%v\\\"\", resp.Status), resp.StatusCode)\n\t}\n\n\tvar items struct {\n\t\tValue []azureItem\n\t}\n\n\tif err := json.NewDecoder(resp.Body).Decode(&items); err != nil {\n\t\treturn nil, errors.Wrap(err, \"could not parse Azure items response\")\n\t}\n\n\tif len(items.Value) == 0 || items.Value[0].CommitId == \"\" {\n\t\treturn nil, errors.Errorf(\"failed to get latest commitID in the repository\")\n\t}\n\n\treturn &items.Value[0], nil\n}\n\nfunc parseUrl(rawUrl string) (*azureOptions, error) {","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/portainer/portainer/blob/17e74456ff6e794b9d5439ec3fa06922aa18a3f8/api/git/azure.go#L199-L235","documentation":"Error \"failed to get repository root item with a status \"%v\"\" thrown in portainer/portainer.","triggerScenarios":"Thrown at api/git/azure.go:217 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"17e74456ff6e794b9d5439ec3fa06922aa18a3f8","analyzedAt":"2026-08-26T23:09:01.915Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}