Import Project from Github is not working with "Integration of GitLab instance with GitHub"
Summary
Getting a redirect_uri_mismatch when trying to import a project from Github. The user is redirected to the homepage after clicking on Github icon. Error from console is below. This is with following the steps that are found on Integration with Github - https://docs.gitlab.com/ee/integration/github.html
error: redirect_uri_mismatch
error_description: The redirect_uri MUST match the registered callback URL for this application.
error_uri: https://developer.github.com/apps/managing-oauth-apps/troubleshooting-authorization-request-errors/#redirect-uri-mismatch
However login via github works.
Steps to reproduce
This is issue is present under both Docker Gitlab Instance and via Omnibus package installation.
Clean installation of Gitlab with HTTPS external_url. Create Github OAuth App on Github (with HTTPS urls for Homepage URL and Authorization callback URL) Connect (associate) Github to Gitlab account under user's Gitlab account. Login via Github into Gitlab account Try to import new project and select Github
What is the current bug behavior?
User is redirected to Dashboard. Browser console error refers to redirect_uri_mismatch. Please note that login via Github works.
What is the expected correct behavior?
To see a list of github repos to import
Relevant logs and/or screenshots
error: redirect_uri_mismatch
error_description: The redirect_uri MUST match the registered callback URL for this application.
error_uri: https://developer.github.com/apps/managing-oauth-apps/troubleshooting-authorization-request-errors/#redirect-uri-mismatch
Output of checks
This bug happens on self-hosted version of Gitlab.
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Ubuntu 18.04 Proxy: no Current User: git Using RVM: no Ruby Version: 2.5.3p105 Gem Version: 2.7.9 Bundler Version:1.17.3 Rake Version: 12.3.2 Redis Version: 3.2.12 Git Version: 2.21.0 Sidekiq Version:5.2.7 Go Version: unknownGitLab information Version: 11.11.0-ee Revision: deb6f84e91f Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 9.6.11 URL: https://gitlabd.somyx.com HTTP Clone URL: https://gitlabd.somyx.com/some-group/some-project.git SSH Clone URL: git@gitlabd.somyx.com:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers: github
GitLab Shell Version: 9.1.0 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab subtasks ...
Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 9.1.0 ? ... OK (9.1.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... skipped (no tmp uploads folder yet) Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... can't check, you have no projects Redis version >= 2.8.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.5.3) Git version >= 2.21.0 ? ... yes (2.21.0) Git user has default SSH configuration? ... yes Active users: ... 1 Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished