NoMethodError in check_trueup when adding licence key

Summary

We received a trial licence key and during the upload we received an error 500

Steps to reproduce

Load the Licence (available from @teemo or see email sent to support@gitlab.com) via paste-t-field in the latest EE container (currently 11.0.3-ee.0)

Example Project

N/A

What is the current bug behavior?

HTTP 500 error

What is the expected correct behavior?

Licence is loaded properly

Relevant logs and/or screenshots

==> /var/log/gitlab/gitlab-rails/production.log <==
Started POST "/admin/license" for 172.27.235.101 at 2018-07-06 09:58:05 +0000
Processing by Admin::LicensesController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "license_type"=>"key", "license"=>{"data"=>"eyJkYXRhIjoiankvMXI3dk5Hb3J0VFNuZ1ZNdEtkc3ZndnFENXpUM1cvK3k4\r\na2XXXXXXXXXXX\r\nbiIsIml2IjoiT21HNXdtMUoyT0hFTWtoZVJ3SWJqZz09XG4ifQ==\r\n"}}
Completed 500 Internal Server Error in 26ms (ActiveRecord: 5.8ms | Elasticsearch: 0.0ms)

==> /var/log/gitlab/gitlab-rails/production.log <==
 
NoMethodError (undefined method `<' for nil:NilClass):
  ee/app/models/license.rb:397:in `check_trueup'
  ee/app/controllers/admin/licenses_controller.rb:35:in `block in create'
  ee/app/controllers/admin/licenses_controller.rb:34:in `create'
  lib/gitlab/i18n.rb:50:in `with_locale'
  lib/gitlab/i18n.rb:56:in `with_user_locale'
  app/controllers/application_controller.rb:370:in `set_locale'
  lib/gitlab/middleware/multipart.rb:95:in `call'
  lib/gitlab/request_profiler/middleware.rb:14:in `call'
  ee/lib/gitlab/jira/middleware.rb:15:in `call'
  lib/gitlab/middleware/go.rb:17:in `call'
  lib/gitlab/etag_caching/middleware.rb:11:in `call'
  lib/gitlab/middleware/read_only/controller.rb:28:in `call'
  lib/gitlab/middleware/read_only.rb:16:in `call'
  lib/gitlab/request_context.rb:18:in `call'
  lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call'
  lib/gitlab/middleware/release_env.rb:10:in `call'

Output of checks

(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)

Results of GitLab environment info

Expand for output related to GitLab environment info

root@gitlab-ee-test:/# gitlab-rake gitlab:env:info

System information System: Proxy: no Current User: gitrepos Using RVM: no Ruby Version: 2.4.4p296 Gem Version: 2.7.6 Bundler Version:1.16.2 Rake Version: 12.3.1 Redis Version: 3.2.11 Git Version: 2.17.1 Sidekiq Version:5.1.3 Go Version: unknown

GitLab information Version: 11.0.3-ee Revision: f25aa33 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql DB Version: 9.6.8 URL: https://gitlab-ee-test.FQDN.net HTTP Clone URL: https://gitlab-ee-test.FQDN.net/some-group/some-project.git SSH Clone URL: gitrepos@gitlab-ee-test.FQDN.net:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: yes Using Omniauth: no

GitLab Shell Version: 7.1.4 Repository storage paths:

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

Results of GitLab application Check

Expand for output related to the GitLab application check

root@gitlab-ee-test:/# gitlab-rake gitlab:check SANITIZE=true Checking GitLab Shell ...

GitLab Shell version >= 7.1.4 ? ... OK (7.1.4) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by gitrepos:root, or gitrepos:gitrepos? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... can't check, you have no projects 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 Sidekiq ...

Running? ... no Try fixing it: sudo -u gitrepos -H RAILS_ENV=production bin/background_jobs start For more information see: doc/install/installation.md in section "Install Init Script" see log/sidekiq.log for possible errors Please fix the error above and rerun the checks.

Checking Sidekiq ... Finished

Reply by email is disabled in config/gitlab.yml Checking LDAP ...

Server: ldapmain LDAP authentication... Success LDAP users with access to your GitLab server (only showing the first 100 results) rake aborted! Gitlab::Auth::LDAP::LDAPConnectionError: LDAP search timed out after 10 seconds

(this is not a problem, the number of results is quite big :)

Possible fixes

Assignee Loading
Time tracking Loading