{"record":{"id":"922885b223ee5664","repo":"github/github-mcp-server","slug":"failed-to-resolve-rest-url-for-github-app-authenti","errorCode":null,"errorMessage":"failed to resolve REST URL for GitHub App authentication: %w","messagePattern":"failed to resolve REST URL for GitHub App authentication: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/github-mcp-server/main.go","lineNumber":327,"sourceCode":"\tif err := rootCmd.Execute(); err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"%v\\n\", err)\n\t\tos.Exit(1)\n\t}\n}\n\nfunc newGitHubAppTokenProvider(appID, installationID, keyPath, keyInline, host string) (func() string, error) {\n\tkeyBytes, err := loadAppPrivateKey(keyPath, keyInline)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tapiHost, err := utils.NewAPIHost(host)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse host for GitHub App authentication: %w\", err)\n\t}\n\trestURL, err := apiHost.BaseRESTURL(context.Background())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to resolve REST URL for GitHub App authentication: %w\", err)\n\t}\n\n\tprovider, err := githubapp.NewProvider(githubapp.Config{\n\t\tAppID:          appID,\n\t\tInstallationID: installationID,\n\t\tPrivateKeyPEM:  keyBytes,\n\t\tBaseRESTURL:    restURL.String(),\n\t}, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to configure GitHub App authentication: %w\", err)\n\t}\n\treturn provider.AccessToken, nil\n}\n\nfunc loadAppPrivateKey(path, inline string) ([]byte, error) {\n\tswitch {\n\tcase path != \"\":\n\t\tdata, err := os.ReadFile(path) //#nosec G304 -- operator-supplied path to their own key","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/cmd/github-mcp-server/main.go#L309-L345","documentation":"Error \"failed to resolve REST URL for GitHub App authentication: %w\" thrown in github/github-mcp-server.","triggerScenarios":"Thrown at cmd/github-mcp-server/main.go:327 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":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}