{"record":{"id":"7b47ce86592e4851","repo":"goharbor/harbor","slug":"d-s-7b47ce","errorCode":null,"errorMessage":"%d -- %s","messagePattern":"%d -- %s","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/reg/adapter/quay/adapter.go","lineNumber":226,"sourceCode":"\t}\n\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tresp, err := a.client.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode/100 == 2 {\n\t\treturn nil\n\t}\n\n\tbody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\tlog.Errorf(\"create namespace error: %d -- %s\", resp.StatusCode, string(body))\n\treturn fmt.Errorf(\"%d -- %s\", resp.StatusCode, body)\n}\n\n// getNamespace get namespace from Quay, if the namespace not found, two nil would be returned.\nfunc (a *adapter) getNamespace(namespace string) (*model.Namespace, error) {\n\treq, err := http.NewRequest(http.MethodGet, buildOrgURL(a.registry.URL, namespace), nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := a.client.Do(req)\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","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/reg/adapter/quay/adapter.go#L208-L244","documentation":"Returned by createNamespace when the Quay POST to create a namespace returns a non-2xx status. The message embeds the HTTP status code and response body, revealing why Quay rejected creation (permission denied, invalid name, or already exists). Note the body is passed as bytes, so it may render as a byte-slice in logs.","triggerScenarios":"Thrown at src/pkg/reg/adapter/quay/adapter.go:226 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the embedded status code and body to identify the Quay rejection reason","Grant the token namespace-creation permission or pre-create the namespace manually","Use a valid Quay namespace name (lowercase alphanumeric)","Retry only if the status indicates a transient server error"],"exampleFix":null,"handlingStrategy":"retry","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"}