{"record":{"id":"b1763dbafac119e0","repo":"gitlabhq/gitlabhq","slug":"missing-oauth-configuration-for-github","errorCode":null,"errorMessage":"Missing OAuth configuration for GitHub.","messagePattern":"Missing OAuth configuration for GitHub\\.","errorType":"exception","errorClass":"Import::GithubOauth::OAuthConfigMissingError","httpStatus":401,"severity":"error","filePath":"app/controllers/concerns/import/github_oauth.rb","lineNumber":30,"sourceCode":"\n    private\n\n    def provider_auth\n      return if session[access_token_key].present?\n\n      go_to_provider_for_permissions unless ci_cd_only?\n    end\n\n    def ci_cd_only?\n      %w[1 true].include?(params[:ci_cd_only])\n    end\n\n    def go_to_provider_for_permissions\n      redirect_to authorize_url\n    end\n\n    def oauth_client\n      raise OAuthConfigMissingError unless oauth_config\n\n      oauth_client_from_config\n    end\n\n    def oauth_client_from_config\n      @oauth_client_from_config ||= ::OAuth2::Client.new(\n        oauth_config.app_id,\n        oauth_config.app_secret,\n        oauth_options.merge(ssl: { verify: oauth_config['verify_ssl'] })\n      )\n    end\n\n    def oauth_config\n      @oauth_config ||= Gitlab::Auth::OAuth::Provider.config_for('github')\n    end\n\n    def oauth_options\n      return unless oauth_config","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/gitlabhq/gitlabhq/blob/55ee20384a1f55cb0e362dee1d07149613b1b9bf/app/controllers/concerns/import/github_oauth.rb#L12-L48","documentation":"The GitHub import OAuth concern's oauth_client method raises OAuthConfigMissingError unless an oauth_config exists - i.e. the instance's gitlab.yml / omniauth configuration has no 'github' provider section with app_id and app_secret. The import flow cannot build an OAuth2::Client without it.","triggerScenarios":"Starting the GitHub import flow (GET /import/github or /import/github/status) on an instance where the GitHub OmniAuth provider was never configured or its credentials env vars are empty (typical in fresh GDK/dev setups).","commonSituations":"Development environments omitting the github provider block; production instances where the provider secret was not provisioned after deploy; provider key renamed or yml indentation broken so the section is ignored.","solutions":["Omnibus: add a github entry under gitlab_rails['omniauth_providers'] with app_id/app_secret from github.com/settings/developers, then gitlab-ctl reconfigure","GDK/source: fill in the providers: github: section in config/gitlab.yml and restart","Restart GitLab after changing configuration so the YAML is reloaded","Alternative: import with a GitHub personal access token instead of OAuth (the ci_cd_only / token-based flow does not need the OAuth client)"],"exampleFix":"# gitlab.yml (before)\nproduction: &base\n  omniauth:\n    enabled: true\n    providers: []\n\n# gitlab.yml (after)\nproduction: &base\n  omniauth:\n    enabled: true\n    providers:\n      - { name: 'github', app_id: 'YOUR_CLIENT_ID',\n          app_secret: 'YOUR_CLIENT_SECRET',\n          args: { scope: 'user:email,repo' } }","handlingStrategy":"validation","validationCode":"# Guard the import entry point on config presence\nrequire 'gitlab_config'\ncfg = Gitlab.config\nhas_github = cfg.omniauth&.providers&.any? { |p| p['name'] == 'github' && p['app_id'].present? }\nraise 'Configure the GitHub OAuth provider before importing' unless has_github","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provision OAuth app credentials before enabling GitHub imports","Use the PAT-based import flow when OAuth setup is not possible","Smoke-test the import page after instance config changes"],"tags":["github-import","oauth","omniauth","configuration","importers"],"backgroundTag":"missing-oauth-config","analyzedSha":"55ee20384a1f55cb0e362dee1d07149613b1b9bf","analyzedAt":"2026-08-21T14:22:27.782Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}