{"record":{"id":"4cbf2667d6d91fe6","repo":"goharbor/harbor","slug":"repository-did-not-contain-a-namespace","errorCode":null,"errorMessage":"repository did not contain a namespace","messagePattern":"repository did not contain a namespace","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/reg/adapter/dtr/client.go","lineNumber":263,"sourceCode":"\t\t\tquery.Set(\"start\", nextPage)\n\t\t\tendpoint = urlAPI.Scheme + \"://\" + urlAPI.Host + urlAPI.Path + \"?\" + query.Encode()\n\t\t}\n\t}\n\n\treturn accounts, nil\n}\n\n// createRepository creates a repository in DTR.  The namespace/org/account must already exist.\nfunc (c *Client) createRepository(repository string) error {\n\tvar namespace string\n\tvar repositoryName string\n\n\tpath := strings.Split(repository, \"/\")\n\tif len(path) > 1 {\n\t\tnamespace = path[0]\n\t\trepositoryName = path[1]\n\t} else {\n\t\treturn errors.New(\"repository did not contain a namespace\")\n\t}\n\n\trepo := newDefaultDTRRepository(repositoryName)\n\tbody, err := json.Marshal(repo)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\turlAPI := fmt.Sprintf(\"%s/api/v0/repositories/%s\", c.url, namespace)\n\tlog.Debugf(\"Creating repo %s in DTR at %s\", repositoryName, urlAPI)\n\treq, err := http.NewRequest(http.MethodPost, urlAPI, bytes.NewReader(body))\n\tif err != nil {\n\t\treturn err\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\treq.SetBasicAuth(c.username, c.password)\n\n\tresp, err := c.client.Do(req)","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/reg/adapter/dtr/client.go#L245-L281","documentation":"Error \"repository did not contain a namespace\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/reg/adapter/dtr/client.go:263 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":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}