On first OmniAuth login: Redis::InheritedError (Tried to use a connection from a child process without reconnecting. You need to reconnect to Redis after forking.)
Created by: cakoose
Just installed and configured GitLab 4.0 and I get a 500 when logging in for the first time using OmniAuth. OmniAuth is configured as follows:
omniauth:
enabled: true
allow_single_sign_on: true
block_auto_created_users: false
providers:
- { name: 'google_oauth2', ..., args: { access_type: 'offline', approval_prompt: '' } }
- Go to the GitLab login page
- Click on the Google icon at the bottom.
- On the Google app approval page, click "Allow access"
- GitLab returns an HTTP 500
production.log contains:
Started GET "/users/auth/google_oauth2" for 127.0.0.1 at 2012-12-28 01:49:28 -0800
Started GET "/users/auth/google_oauth2/callback?state=***" for 127.0.0.1 at 2012-12-28 01:49:35 -0800
Processing by OmniauthCallbacksController#google_oauth2 as HTML
Parameters: {"state"=>"***", "code"=>"***"}
Completed 500 Internal Server Error in 207ms
Redis::InheritedError (Tried to use a connection from a child process without reconnecting. You need to reconnect to Redis after forking.):
app/observers/user_observer.rb:5:in `after_create'
lib/gitlab/auth.rb:46:in `create_from_omniauth'
lib/gitlab/auth.rb:61:in `find_or_new_for_omniauth'
app/models/user.rb:105:in `find_or_new_for_omniauth'
app/controllers/omniauth_callbacks_controller.rb:40:in `handle_omniauth'
app/controllers/omniauth_callbacks_controller.rb:4:in `block (2 levels) in <class:OmniauthCallbacksController>'
This only happens the first time I sign in with a particular Google user account. If I go through the Google auth flow again with the same user, it works fine. If I delete that user account from GitLab and try again, it works fine.