{"record":{"id":"5f1832710af7968f","repo":"github/github-mcp-server","slug":"failed-to-parse-host-for-github-app-authentication","errorCode":null,"errorMessage":"failed to parse host for GitHub App authentication: %w","messagePattern":"failed to parse host for GitHub App authentication: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/github-mcp-server/main.go","lineNumber":323,"sourceCode":"\tviper.AutomaticEnv()\n}\n\nfunc main() {\n\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","sourceCodeStart":305,"sourceCodeEnd":341,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/cmd/github-mcp-server/main.go#L305-L341","documentation":"Error \"failed to parse host for GitHub App authentication: %w\" thrown in github/github-mcp-server.","triggerScenarios":"Thrown at cmd/github-mcp-server/main.go:323 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"}