Error 500 for /api/v4/projects/ID/services/jira - NoMethodError (undefined method `slice' for nil:NilClass)
Summary
Can't get Jira service of project
Steps to reproduce
GET https://HOSTNAME/api/v4/projects/PROJECTID/services/jira
The error disappears after PUT https://HOSTNAME/api/v4/projects/PROJECTID/services/jira or saving the service with https://HOSTNAME/PATH_WITH_NAMESPACE/-/settings/integrations
GET https://HOSTNAME/api/v4/projects/PROJECTID/services/bamboo does not have this problem
What is the current bug behavior?
Returns
{"message":"500 Internal Server Error"}
What is the expected correct behavior?
Output from https://docs.gitlab.com/ee/api/services.html#get-jira-service-settings or better error message
Relevant logs and/or screenshots
production.log:
NoMethodError (undefined method `slice' for nil:NilClass):
/opt/gitlab/embedded/service/gitlab-rails/lib/api/entities.rb:1067:in `block in <class:ProjectService>'
/opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/grape-entity-0.7.1/lib/grape_entity/entity.rb:496:in `instance_exec'
/opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/grape-entity-0.7.1/lib/grape_entity/entity.rb:496:in `exec_with_object'
/opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/block_exposure.rb:10:in `value'
/opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/base.rb:82:in `valid_value'
/opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/base.rb:66:in `serializable_value'
/opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:41:in `block in serializable_value'
/opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:120:in `block (2 levels) in map_entity_exposures'
/opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/base.rb:116:in `block in with_attr_path'
/opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/grape-entity-0.7.1/lib/grape_entity/options.rb:90:in `with_attr_path'
/opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/base.rb:115:in `with_attr_path'
/opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:119:in `block in map_entity_exposures'
/opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:118:in `each'
/opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:118:in `each_with_object'
/opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:118:in `map_entity_exposures'
/opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/grape-entity-0.7.1/lib/grape_entity/exposure/nesting_exposure.rb:40:in `serializable_value'
/opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/grape-entity-0.7.1/lib/grape_entity/entity.rb:489:in `serializable_hash'
/opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/grape-entity-0.7.1/lib/grape_entity/entity.rb:520:in `to_json'
/opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/grape-1.1.0/lib/grape/formatter/json.rb:6:in `call'
...
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Debian 9.11 Proxy: no Current User: git Using RVM: no Ruby Version: 2.6.3p62 Gem Version: 2.7.9 Bundler Version:1.17.3 Rake Version: 12.3.3 Redis Version: 3.2.12 Git Version: 2.22.0 Sidekiq Version:5.2.7 Go Version: unknownGitLab information Version: 12.4.0-ee Revision: 572e09f5e8f Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 10.9 URL: https://git HTTP Clone URL: https://git/some-group/some-project.git SSH Clone URL: git@git:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: yes Using Omniauth: yes Omniauth Providers:
GitLab Shell Version: 10.2.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 >= 10.2.0 ? ... OK (10.2.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: 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: ... Server: ldapmain LDAP authentication... Success LDAP users with access to your GitLab server (only showing the first 100 results) User output sanitized. Found 32 users of 100 limit.
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? ... yes 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: ... 5/1 ... yes 5/2 ... yes 5/3 ... yes 5/4 ... yes 5/5 ... yes 13/6 ... yes 5/7 ... yes 5/8 ... yes 5/9 ... yes 5/10 ... yes 5/11 ... yes 11/12 ... yes 11/13 ... yes 11/14 ... yes 5/15 ... yes 5/16 ... yes 5/17 ... yes 5/18 ... yes 5/19 ... yes 5/20 ... yes 5/21 ... yes 5/22 ... yes 5/23 ... yes 3/24 ... yes 22/27 ... yes 5/28 ... yes 5/29 ... yes 5/30 ... yes 22/31 ... yes 22/32 ... yes 5/33 ... yes 39/34 ... yes 10/35 ... yes 3/36 ... yes 6/37 ... yes 3/38 ... yes 39/39 ... yes 22/40 ... yes 3/41 ... yes 3/42 ... yes 27/43 ... yes 27/44 ... yes 27/45 ... yes 39/46 ... yes 39/47 ... yes 17/70 ... yes 3/71 ... yes 6/72 ... yes 3/75 ... yes 3/76 ... yes 27/77 ... yes 27/78 ... yes 27/79 ... yes 12/80 ... yes 12/82 ... yes 61/85 ... yes 39/86 ... yes 27/87 ... yes 39/88 ... yes 11/89 ... yes 27/100 ... yes 30/102 ... yes 27/103 ... yes 3/107 ... yes 27/108 ... yes 27/109 ... yes 6/110 ... yes 6/111 ... yes 6/113 ... yes 25/114 ... yes 27/115 ... yes 14/116 ... yes 55/118 ... yes 43/119 ... yes 43/120 ... yes 43/125 ... yes 5/127 ... yes 44/128 ... yes 27/129 ... yes 55/132 ... yes 5/133 ... yes 43/134 ... yes 27/135 ... yes 44/136 ... yes 44/137 ... yes 42/138 ... yes 6/139 ... yes 48/140 ... yes 27/141 ... yes 10/144 ... yes 42/145 ... yes 4/146 ... yes 3/147 ... yes 6/149 ... yes 43/150 ... yes 10/151 ... yes 55/152 ... yes 6/153 ... yes 10/154 ... yes 13/155 ... yes 27/157 ... yes 39/158 ... yes 39/159 ... yes 39/160 ... yes 39/161 ... yes 27/162 ... yes 52/163 ... yes 42/166 ... yes 6/168 ... yes 42/169 ... yes 10/170 ... yes 52/171 ... yes 10/172 ... yes 52/173 ... yes 27/174 ... yes 52/175 ... yes 13/176 ... yes 6/177 ... yes 14/180 ... yes 54/182 ... yes 14/183 ... yes 14/184 ... yes 42/185 ... yes 13/186 ... yes 14/187 ... yes 56/188 ... yes 14/189 ... yes 7/190 ... yes 6/194 ... yes 59/200 ... yes 39/202 ... yes 39/203 ... yes 39/204 ... yes 60/205 ... yes 60/206 ... yes 60/207 ... yes 39/210 ... yes 39/211 ... yes 58/212 ... yes 39/215 ... yes 39/217 ... yes 39/219 ... yes 39/220 ... yes 39/221 ... yes 5/222 ... yes 56/223 ... yes 7/224 ... yes 6/225 ... yes 9/227 ... yes 15/228 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.3) Git version >= 2.22.0 ? ... yes (2.22.0) Git user has default SSH configuration? ... yes Active users: ... 33 Is authorized keys file accessible? ... yes Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished