Skip to content

500 error when opening project with external issue tracker (Jira) - ActionView::Template::Error

Summary

While opening projects pages after migration from v10.3.0 to v12.10.3 (with temp migration to latest 11.11.8 for the database) i got 500 error for various projects.

Steps to reproduce

Migrate an already existing and running gitlab env to a new one. From v10.3.0 to v12.10.3 (with temp migration to latest 11.11.8 for the database)

Example Project

The problem cannot really reproduced because of sensitive data.

What is the current bug behavior?

Getting 500 Error responses on various projects within the gitlab env.

What is the expected correct behavior?

Access to all project pages.

Relevant logs and/or screenshots

ActionView::Template::Error ():
    123:       - if project_nav_tab? :external_issue_tracker
    124:         = nav_link do
    125:           - issue_tracker = @project.external_issue_tracker
    126:           = link_to issue_tracker.issue_tracker_path, class: 'shortcuts-external_tracker' do
    127:             .nav-icon-container
    128:               = sprite_icon('external-link')
    129:             %span.nav-item-name

app/models/project_services/data_fields.rb:14:in `url'
app/models/project_services/issue_tracker_service.rb:92:in `issue_tracker_path'
app/views/layouts/nav/sidebar/_project.html.haml:126
app/helpers/tab_helper.rb:78:in `nav_link'
app/views/layouts/nav/sidebar/_project.html.haml:124
app/views/layouts/_page.html.haml:3
app/views/layouts/application.html.haml:13
app/views/layouts/project.html.haml:13
app/controllers/application_controller.rb:125:in `render'
app/controllers/projects/merge_requests_controller.rb:74:in `block (2 levels) in show'
app/controllers/projects/merge_requests_controller.rb:55:in `show'
app/controllers/application_controller.rb:564:in `block in allow_gitaly_ref_name_caching'
lib/gitlab/gitaly_client.rb:350:in `allow_ref_name_caching'
app/controllers/application_controller.rb:563:in `allow_gitaly_ref_name_caching'
app/controllers/application_controller.rb:479:in `set_current_admin'
lib/gitlab/session.rb:11:in `with_session'
app/controllers/application_controller.rb:470:in `set_session_storage'
lib/gitlab/i18n.rb:55:in `with_locale'
lib/gitlab/i18n.rb:61:in `with_user_locale'
app/controllers/application_controller.rb:464:in `set_locale'
lib/gitlab/error_tracking.rb:48:in `with_context'
app/controllers/application_controller.rb:559:in `sentry_context'
lib/gitlab/application_context.rb:52:in `block in use'
lib/gitlab/application_context.rb:52:in `use'
lib/gitlab/application_context.rb:20:in `with_context'
app/controllers/application_controller.rb:455:in `set_current_context'
lib/gitlab/middleware/rails_queue_duration.rb:29:in `call'
lib/gitlab/metrics/rack_middleware.rb:17:in `block in call'
lib/gitlab/metrics/transaction.rb:62:in `run'
lib/gitlab/metrics/rack_middleware.rb:17:in `call'
lib/gitlab/request_profiler/middleware.rb:17:in `call'
lib/gitlab/middleware/go.rb:20:in `call'
lib/gitlab/etag_caching/middleware.rb:13:in `call'
lib/gitlab/middleware/multipart.rb:124:in `call'
lib/gitlab/middleware/read_only/controller.rb:53:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/same_site_cookies.rb:27:in `call'
lib/gitlab/middleware/basic_health_check.rb:25:in `call'
lib/gitlab/middleware/request_context.rb:23:in `call'
config/initializers/fix_local_cache_middleware.rb:9:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:60:in `call'
lib/gitlab/middleware/release_env.rb:12:in `call

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

gitlab-rake gitlab:env:info

System information
System:
Current User:   git
Using RVM:      no
Ruby Version:   2.6.5p114
Gem Version:    2.7.10
Bundler Version:1.17.3
Rake Version:   12.3.3
Redis Version:  5.0.7
Git Version:    2.26.2
Sidekiq Version:5.2.7
Go Version:     unknown

GitLab information
Version:        12.10.3
Revision:       e01ceba1b49
Directory:      /opt/gitlab/embedded/service/gitlab-rails
DB Adapter:     PostgreSQL
DB Version:     12.2
URL:            https://some-domain.com
HTTP Clone URL: https://some-domain/some-group/some-project.git
SSH Clone URL:  git@some-host.com:some-group/some-project.git
Using LDAP:     yes
Using Omniauth: yes
Omniauth Providers: 

GitLab Shell
Version:        12.2.0

Results of GitLab application Check

Expand for output related to the GitLab application check

gitlab:check is Okay

Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 12.2.0 ? ... OK (12.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: ... Checking Reply by email ...

IMAP server credentials are correct? ... yes Init.d configured correctly? ... skipped MailRoom running? ... skipped

Checking Reply by email ... Finished

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 100 users of 100 limit.

Checking LDAP ... Finished

Checking GitLab App ...

Git configured correctly? ... yes [4557/34925] 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: ...

17/3 ... -> 446/5603 ... yes

Redis version >= 4.0.0? ... no Try fixing it: Support for your Redis version 3.2.12 has been deprecated and will be removed soon. Update your Redis server to a version >= 4.0.0 For more information see: doc/administration/high_availability/redis.md#provide-your-own-redis-instance-core-only Please fix the error above and rerun the checks. Ruby version >= 2.5.3 ? ... yes (2.6.5) Git version >= 2.22.0 ? ... yes (2.26.2) Git user has default SSH configuration? ... yes Active users: ... 700 Is authorized keys file accessible? ... yes

Checking GitLab App ... Finished Checking GitLab subtasks ... Finished

The Redis Version isnt the culprit of the above mentioned issue but i will upgrade this anyway.

db:migrate:status says everything it up too.

Possible fixes

tried to clean issue_tracker_data and jira_tracker_data like explained in #198938 (closed) but the tables were already empty.

gitlab-rake db:migrate:redo VERSION=x also didn't solved the problem.

So i cleaned any entry in table services where type='JiraService' and it worked out and seems to run properly.

Unfortunately by doing this, we lose all of our jira integration setup. Is there any way to avoid this and bringing the problem not back to the using community? Could there be any other sideffect (except from the already mentioned above) by cleaning up in service table for the upcoming new production env?

Issues which seems to relate to this: #198938 (closed) #220342 (closed)