{"record":{"id":"9931100e6e573a6a","repo":"github/github-mcp-server","slug":"owner-not-specified","errorCode":null,"errorMessage":"owner not specified","messagePattern":"owner not specified","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/github/repository_resource_completions.go","lineNumber":127,"sourceCode":"\tusers, _, err := client.Search.Users(ctx, argValue, &github.SearchOptions{ListOptions: github.ListOptions{PerPage: 100 - len(values)}})\n\tif err != nil || users == nil {\n\t\treturn nil, err\n\t}\n\tfor _, user := range users.Users {\n\t\tvalues = append(values, user.GetLogin())\n\t}\n\n\tif len(values) > 100 {\n\t\tvalues = values[:100]\n\t}\n\treturn values, nil\n}\n\nfunc completeRepo(ctx context.Context, client *github.Client, resolved map[string]string, argValue string) ([]string, error) {\n\tvar values []string\n\towner := resolved[\"owner\"]\n\tif owner == \"\" {\n\t\treturn values, errors.New(\"owner not specified\")\n\t}\n\n\tquery := fmt.Sprintf(\"org:%s\", owner)\n\n\tif argValue != \"\" {\n\t\tquery = fmt.Sprintf(\"%s %s\", query, argValue)\n\t}\n\trepos, _, err := client.Search.Repositories(ctx, query, &github.SearchOptions{ListOptions: github.ListOptions{PerPage: 100}})\n\tif err != nil || repos == nil {\n\t\treturn values, errors.New(\"failed to get repositories\")\n\t}\n\t// filter repos based on argValue\n\tfor _, repo := range repos.Repositories {\n\t\tname := repo.GetName()\n\t\tif argValue == \"\" || strings.HasPrefix(name, argValue) {\n\t\t\tvalues = append(values, name)\n\t\t}\n\t}","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/pkg/github/repository_resource_completions.go#L109-L145","documentation":"Thrown by the list_repository_collaborators tool handler when deps.GetClient(ctx) fails before Repositories.ListCollaborators runs. In remote/server deployments (RequestDeps) the REST client is built per call from token info in the context plus configured API hosts, so the wrapped cause is 'no token info in context', 'failed to get base REST URL'/'failed to get upload URL', or 'failed to create REST client'. Stdio BaseDeps stores the client and cannot produce this error.","triggerScenarios":"Calling list_repository_collaborators when the context has no token info, when enterprise API host env vars are malformed so URL resolution fails, or when go-github rejects the configured enterprise URLs.","commonSituations":"Missing/expired GITHUB_PERSONAL_ACCESS_TOKEN; gateway stripping Authorization; enterprise URL misconfig; token lacking access to the target repository's collaborator listing.","solutions":["Inspect the wrapped cause to route the fix (auth vs host config)","Provide a valid token to the server process or incoming request","Correct GITHUB_API_HOSTS / GITHUB_BASE_URL / GITHUB_UPLOAD_URL and restart","Verify with an authenticated read like get_me before listing collaborators"],"exampleFix":"// before: no token reaches the handler\n//   list_repository_collaborators -> \"failed to get GitHub client: no token info in context\"\n\n// after\nexport GITHUB_PERSONAL_ACCESS_TOKEN=ghp_xxxxxxxxxxxx\nexport GITHUB_API_HOSTS=api.github.com","handlingStrategy":"try-catch","validationCode":"func preflightGitHubClient() error {\n\tif os.Getenv(\"GITHUB_PERSONAL_ACCESS_TOKEN\") == \"\" {\n\t\treturn fmt.Errorf(\"missing token: list_repository_collaborators cannot build a client\")\n\t}\n\treturn nil\n}","typeGuard":"func isGitHubClientError(err error) bool {\n\treturn err != nil && strings.Contains(err.Error(), \"failed to get GitHub client\")\n}","tryCatchPattern":"result, _, err := callListRepositoryCollaborators(ctx, owner, repo)\nif err != nil {\n\tif isGitHubClientError(err) {\n\t\t// auth/host config fault: fix env and restart; do not retry\n\t\treturn fmt.Errorf(\"server auth/host misconfiguration: %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Verify the token can read the target repository before listing collaborators","Smoke-test with get_me at startup","Keep API host env vars consistent and absolute","Treat client-construction errors as operator alerts, never retry loops"],"tags":["go","github","authentication","configuration"],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}