{"record":{"id":"7188aaa7d4ee2752","repo":"goharbor/harbor","slug":"unmarshal-repos-list-s-error-v","errorCode":null,"errorMessage":"unmarshal repos list %s error: %v","messagePattern":"unmarshal repos list (.+?) error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/reg/adapter/dockerhub/adapter.go","lineNumber":432,"sourceCode":"\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tbody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif resp.StatusCode/100 != 2 {\n\t\tlog.Errorf(\"list repos error: %d -- %s\", resp.StatusCode, string(body))\n\t\treturn nil, fmt.Errorf(\"%d -- %s\", resp.StatusCode, string(body))\n\t}\n\n\trepos := &ReposResp{}\n\terr = json.Unmarshal(body, repos)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unmarshal repos list %s error: %v\", string(body), err)\n\t}\n\n\treturn repos, nil\n}\n\n// getTags gets a page of tags for a repo from DockerHub\nfunc (a *adapter) getTags(namespace, repo string, page, pageSize int) (*TagsResp, error) {\n\tresp, err := a.client.Do(http.MethodGet, listTagsPath(namespace, repo, page, pageSize), nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tbody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n","sourceCodeStart":414,"sourceCodeEnd":450,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/reg/adapter/dockerhub/adapter.go#L414-L450","documentation":"getRepos received a 2xx response from Docker Hub but json.Unmarshal of the body into ReposResp failed — the payload does not match the expected schema (API change or HTML error page); the raw body and parse error are wrapped.","triggerScenarios":"Thrown at src/pkg/reg/adapter/dockerhub/adapter.go:432 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Log the body snippet to see what Docker Hub actually returned","Check for API changes or an HTML login page due to bad credentials","Update the response struct to match the current Docker Hub API"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","contentChangedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}