{"record":{"id":"f922e0e4bced36f7","repo":"glanceapp/glance","slug":"w-could-not-create-request-with-repository-v","errorCode":null,"errorMessage":"%w: could not create request with repository: %v","messagePattern":"%w: could not create request with repository: (.+?)","errorType":"exception","errorClass":"errNoContent","httpStatus":null,"severity":"error","filePath":"internal/glance/widget-repository.go","lineNumber":117,"sourceCode":"\t\tTitle     string `json:\"title\"`\n\t} `json:\"items\"`\n}\n\ntype gitHubCommitResponseJson struct {\n\tSha    string `json:\"sha\"`\n\tCommit struct {\n\t\tAuthor struct {\n\t\t\tName string `json:\"name\"`\n\t\t\tDate string `json:\"date\"`\n\t\t} `json:\"author\"`\n\t\tMessage string `json:\"message\"`\n\t} `json:\"commit\"`\n}\n\nfunc fetchRepositoryDetailsFromGithub(repo string, token string, maxPRs int, maxIssues int, maxCommits int) (repository, error) {\n\trepositoryRequest, err := http.NewRequest(\"GET\", fmt.Sprintf(\"https://api.github.com/repos/%s\", repo), nil)\n\tif err != nil {\n\t\treturn repository{}, fmt.Errorf(\"%w: could not create request with repository: %v\", errNoContent, err)\n\t}\n\n\tPRsRequest, _ := http.NewRequest(\"GET\", fmt.Sprintf(\"https://api.github.com/search/issues?q=is:pr+is:open+repo:%s&per_page=%d\", repo, maxPRs), nil)\n\tissuesRequest, _ := http.NewRequest(\"GET\", fmt.Sprintf(\"https://api.github.com/search/issues?q=is:issue+is:open+repo:%s&per_page=%d\", repo, maxIssues), nil)\n\tCommitsRequest, _ := http.NewRequest(\"GET\", fmt.Sprintf(\"https://api.github.com/repos/%s/commits?per_page=%d\", repo, maxCommits), nil)\n\n\tif token != \"\" {\n\t\ttoken = fmt.Sprintf(\"Bearer %s\", token)\n\t\trepositoryRequest.Header.Add(\"Authorization\", token)\n\t\tPRsRequest.Header.Add(\"Authorization\", token)\n\t\tissuesRequest.Header.Add(\"Authorization\", token)\n\t\tCommitsRequest.Header.Add(\"Authorization\", token)\n\t}\n\n\tvar repositoryResponse githubRepositoryResponseJson\n\tvar detailsErr error\n\tvar PRsResponse githubTicketResponseJson\n\tvar PRsErr error","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/glanceapp/glance/blob/91324e8de762702e97b0ac5c8e36271d644d8642/internal/glance/widget-repository.go#L99-L135","documentation":"Returned by fetchRepositoryDetailsFromGithub (internal/glance/widget-repository.go:117) when http.NewRequest for GET https://api.github.com/repos/{repo} fails, wrapped in errNoContent. NewRequest only fails on an unparseable URL, which in practice means the configured repository string contains characters that break URL parsing (control characters, spaces in malformed ways). It is a pre-flight config-level failure, not an HTTP failure — those surface later as 130.","triggerScenarios":"The repo string interpolated into the URL contains control chars, a stray newline from YAML multiline formatting, or other characters that make url.Parse reject the request. Extremely rare with normal 'owner/repo' values.","commonSituations":"YAML block scalar or trailing whitespace/control character sneaking into the repository key; copy-paste with an invisible character; almost never occurs with hand-typed config.","solutions":["Retype the repository value as a clean 'owner/repo' string","Check the glance.yml for invisible characters (YAML multiline '>' or '|' scalars, tabs, trailing spaces)","Read the wrapped %v — Go's url.Parse error pinpoints the offending character position"],"exampleFix":"// before (glance.yml)\nwidget:\n  type: repository\n  repository: >\n    go-gitea/gitea\n// after\nwidget:\n  type: repository\n  repository: go-gitea/gitea","handlingStrategy":"validation","validationCode":"// Reject repo strings that cannot form a valid URL\nif strings.ContainsAny(repo, \"\\n\\r\\t\") || url.PathEscape(repo) != repo {\n    return errors.New(\"repository must be a clean owner/name string\")\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"could not create request with repository\") {\n    // config hygiene issue: retype the repository value\n}","preventionTips":["Keep repository values as plain single-line owner/name strings","Avoid YAML multiline scalars for this field","Inspect for invisible characters when pasting"],"tags":["repository","config","url-parsing","github"],"backgroundTag":null,"analyzedSha":"91324e8de762702e97b0ac5c8e36271d644d8642","analyzedAt":"2026-08-15T14:12:54.279Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}