[SOLVED] 404 oauth (No route matches GET /oauth/authorize)

I’m having trouble logging in to my Gitlab ci instance. We used the omnibus 7.7.2 installer so everything is running on a single server.

Here are the steps I follow when trying to log in:

  1. Go to our Gitlab ci page. Correctly displays “No public projects”
  2. Click the ‘Login’ button which takes me to a page with a button in the middle that says “Login with Gitlab”.
  3. Clicking the “Login with Gitlab” button takes me to /oauth/authorize (with some params in the URL) which returns a 404.

The gitlab-ci production log shows:

ActionController::RoutingError (No route matches [GET] "/oauth/authorize"):
  actionpack (4.0.10) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (4.0.10) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.0.10) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.0.10) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.0.10) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.0.10) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.0.10) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.0.10) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.0.10) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
  rack (1.5.2) lib/rack/runtime.rb:17:in `call'
  activesupport (4.0.10) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
  rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
  railties (4.0.10) lib/rails/engine.rb:511:in `call'
  railties (4.0.10) lib/rails/application.rb:97:in `call'
  railties (4.0.10) lib/rails/railtie/configurable.rb:30:in `method_missing'
  rack (1.5.2) lib/rack/builder.rb:138:in `call'
  rack (1.5.2) lib/rack/urlmap.rb:65:in `block in call'
  rack (1.5.2) lib/rack/urlmap.rb:50:in `each'
  rack (1.5.2) lib/rack/urlmap.rb:50:in `call'
  unicorn (4.8.2) lib/unicorn/http_server.rb:572:in `process_client'
  unicorn (4.8.2) lib/unicorn/http_server.rb:666:in `worker_loop'
  unicorn (4.8.2) lib/unicorn/http_server.rb:521:in `spawn_missing_workers'
  unicorn (4.8.2) lib/unicorn/http_server.rb:140:in `start'
  unicorn (4.8.2) bin/unicorn:126:in `<top (required)>'
  /opt/gitlab/embedded/service/gem/ruby/2.1.0/bin/unicorn:23:in `load'
  /opt/gitlab/embedded/service/gem/ruby/2.1.0/bin/unicorn:23:in `<main>'

I have ci_nginx['enable'] = true in my gitlab.rb file and I have configured the callback as specified in the /help/oauth2 page. The callback is called ‘Gitlab ci’. Does it need a specific name?

Have you configured

gitlab_ci['gitlab_server'] = { 'url' => 'http://gitlab.example.com', 'app_id' => "1234", 'app_secret' => 'qwertyuio'}

like in https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/gitlab-ci/README.md ?

Hi Axil,

I have that configuration in place as per the instructions on that website.


Are you sure that you have indicated:

'gitlab_ci['gitlab_server'] = { 'url' => 'http://gitlab.example.com'…' 

and not

'gitlab_ci['gitlab_server'] = { 'url' => 'http://ci.example.com'…' ?

Yeah, it would be helpful to provide your gitlab.rb. Just blur out the private info.

Yeah this was exactly the problem. Epic facepalm.

Thanks, all.

Great that you found the error! - I’ll give you three guesses why I knew exactly that this could be the problem… :wink: