production_json.log fails to log user information for pushes when using kerberos

Summary

Logging in general is lacking username information, but the new production_json.log is has the user_id and username set to null. This scrubs some of the most useful information of tracking pushes and pulls.

Steps to reproduce

  1. Enable kerberos
  2. Push to a repository using kerberos
  3. Notice that user_id and username are null in production_json.log, as well as all other logs.

What is the current bug behavior?

Log messages look like this

{"method":"POST","path":"/namespace/project.git/git-upload-pack","format":"application/x-git-upload-pack-result","controller":"Projects::GitHttpController","action":"git_upload_pack","status":200,"duration":33.32,"view":0.27,"db":2.33,"time":"2017-10-02T19:24:33.218Z","params":{"namespace_id":"namespace","project_id":"project.git"},"remote_ip":"aaa.bbb.ccc.ddd","user_id":null,"username":null}
{"method":"POST","path":"/namespace/project.git/git-upload-pack","format":"application/x-git-upload-pack-result","controller":"Projects::GitHttpController","action":"git_upload_pack","status":200,"duration":31.62,"view":0.21,"db":2.21,"time":"2017-10-02T19:24:33.230Z","params":{"namespace_id":"namespace","project_id":"project.git"},"remote_ip":"aaa.bbb.ccc.ddd","user_id":null,"username":null}

The project is set to private, so the 200 status code is there because the user has authenticated successfully, however the username is missing from the logs.

What is the expected correct behavior?

The user_id and username to be populated with the user doing the push or pull.

Results of GitLab environment info

Expand for output related to GitLab environment info

gitlab-rake gitlab:env:info

System information System: Debian 7.11 Proxy: no Current User: git Using RVM: no Ruby Version: 2.3.5p376 Gem Version: 2.6.6 Bundler Version:1.13.7 Rake Version: 12.0.0 Redis Version: 3.2.5 Git Version: 2.13.5 Sidekiq Version:5.0.4 Go Version: unknown

GitLab information Version: 9.5.6-ee Revision: 4a39ef8 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql DB Version: 9.6.3 URL: https://gitlab.example.com HTTP Clone URL: https://gitlab.example.com/some-group/some-project.git SSH Clone URL: git@gitlab.example.com:some-group/some-project.git Elasticsearch: yes Geo: no Using LDAP: yes Using Omniauth: yes Omniauth Providers: kerberos_spnego

GitLab Shell Version: 5.8.0 Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git

Possible fixes

(If you can, link to the line of code that might be responsible for the problem)

Assignee Loading
Time tracking Loading