{"record":{"id":"b9ae8d88cdbd2202","repo":"glanceapp/glance","slug":"invalid-repository-name-s","errorCode":null,"errorMessage":"invalid repository name: %s","messagePattern":"invalid repository name: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/glance/widget-releases.go","lineNumber":279,"sourceCode":"type dockerHubRepositoryTagsResponse struct {\n\tResults []dockerHubRepositoryTagResponse `json:\"results\"`\n}\n\ntype dockerHubRepositoryTagResponse struct {\n\tName       string `json:\"name\"`\n\tLastPushed string `json:\"tag_last_pushed\"`\n}\n\nconst dockerHubOfficialRepoTagURLFormat = \"https://hub.docker.com/_/%s/tags?name=%s\"\nconst dockerHubRepoTagURLFormat = \"https://hub.docker.com/r/%s/tags?name=%s\"\nconst dockerHubTagsURLFormat = \"https://hub.docker.com/v2/namespaces/%s/repositories/%s/tags\"\nconst dockerHubSpecificTagURLFormat = \"https://hub.docker.com/v2/namespaces/%s/repositories/%s/tags/%s\"\n\nfunc fetchLatestDockerHubRelease(request *releaseRequest) (*appRelease, error) {\n\tnameParts := strings.Split(request.Repository, \"/\")\n\n\tif len(nameParts) > 2 {\n\t\treturn nil, fmt.Errorf(\"invalid repository name: %s\", request.Repository)\n\t} else if len(nameParts) == 1 {\n\t\tnameParts = []string{\"library\", nameParts[0]}\n\t}\n\n\ttagParts := strings.SplitN(nameParts[1], \":\", 2)\n\tvar requestURL string\n\n\tif len(tagParts) == 2 {\n\t\trequestURL = fmt.Sprintf(dockerHubSpecificTagURLFormat, nameParts[0], tagParts[0], tagParts[1])\n\t} else {\n\t\trequestURL = fmt.Sprintf(dockerHubTagsURLFormat, nameParts[0], nameParts[1])\n\t}\n\n\thttpRequest, err := http.NewRequest(\"GET\", requestURL, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/glanceapp/glance/blob/91324e8de762702e97b0ac5c8e36271d644d8642/internal/glance/widget-releases.go#L261-L297","documentation":"Returned by fetchLatestDockerHubRelease (internal/glance/widget-releases.go:279) when the configured Docker Hub repository string splits on '/' into more than 2 parts. Docker Hub names are at most namespace/repository (e.g. library/nginx); a string like 'docker.io/library/nginx:latest' or 'registry.example.com/team/app' yields 3+ parts and is rejected before any HTTP call. Single-part names ('nginx') are auto-prefixed with the library namespace.","triggerScenarios":"Configuring 'docker-hub: docker.io/library/nginx:1.27' (hostname included), 'docker-hub: registry.corp.io/team/app', or a typo adding extra slashes ('user//repo'). Only bare 'namespace/repo[:tag]' or 'repo[:tag]' forms are accepted.","commonSituations":"Copy-pasting the full image reference from a docker pull command or docker-compose file into the widget config; assuming the widget accepts registry hostnames; private-registry images (not supported — this widget is Docker Hub only).","solutions":["Strip the hostname: use 'docker-hub: library/nginx:1.27' or just 'docker-hub: nginx:1.27'","Keep at most one slash: namespace/repository, with optional :tag","For images on other registries, this widget cannot track them — use a different mechanism"],"exampleFix":"// before (glance.yml)\n- docker-hub: docker.io/library/postgres:16\n// after\n- docker-hub: postgres:16\n// or\n- docker-hub: library/postgres:16","handlingStrategy":"validation","validationCode":"// Validate a Docker Hub image reference before configuring\nparts := strings.Split(repo, \"/\")\nif len(parts) > 2 {\n    // strip hostname: use last two segments, or reject private registries\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"invalid repository name\") {\n    // strip registry hostname from the config entry\n}","preventionTips":["Configure bare namespace/repo[:tag], never registry hostnames","Docker Hub only — other registries are unsupported","Single-name images are auto-prefixed with library/"],"tags":["dockerhub","config","validation","releases"],"backgroundTag":null,"analyzedSha":"91324e8de762702e97b0ac5c8e36271d644d8642","analyzedAt":"2026-08-15T14:12:54.279Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}