Using the Web IDE Web Terminal leads to error 500 when accessing the dashboard/projects list
Summary
Using the Web IDE Web Terminal leads to error 500 when accessing the dashboard/projects list.
More info
The problem was revealed by qa/specs/features/ee/browser_ui/3_create/web_ide/web_terminal_spec.rb
. It passed but caused subsequent tests to fail.
To reproduce the error on GDK I ran the test via:
$ cd qa
$ bin/qa Test::Instance::All http://localhost:3000 -- qa/specs/features/ee/browser_ui/3_create/web_ide/web_terminal_spec.rb --tag quarantine
And then I see undefined method
detailed_status' for nil:NilClass` when I try to navigate to the dashboard or projects list.
The error goes away when I delete the pipeline that runs the web terminal.
I reproduced it using a docker executor and docker runner (same as the test uses), but I don't know if it can also be reproduced with other executors.
Steps to reproduce
concurrent = 1
[session_server]
listen_address = "0.0.0.0:8093"
advertise_address = "localhost:8093"
session_timeout = 120
- Register the runner to a project.
-
Add
.gitlab/.gitlab-webide.yml
so that it can run the terminal:
terminal:
script: sleep 60
- Start the web terminal.
- Try to load GitLab's dashboard.
What is the current bug behavior?
undefined method 'detailed_status' for nil:NilClass
What is the expected correct behavior?
The dashboard/projects list loads.
Relevant logs
Here's a stack trace from omnibus-gitlab
==> /var/log/gitlab/gitlab-rails/production.log <==
Started GET "/" for 192.168.20.9 at 2020-01-16 04:29:48 +0000
Processing by RootController#index as HTML
Completed 500 Internal Server Error in 203ms (ActiveRecord: 18.0ms | Elasticsearch: 0.0ms)
ActionView::Template::Error (undefined method `detailed_status' for nil:NilClass):
65: - if show_pipeline_status_icon
66: - pipeline_path = pipelines_project_commit_path(project.pipeline_status.project, project.pipeline_status.sha, ref: project.pipeline_status.ref)
67: %span.icon-wrapper.pipeline-status
68: = render 'ci/status/icon', status: project.last_pipeline.detailed_status(current_user), tooltip_placement: 'top', path: pipeline_path
69:
70: = render_if_exists 'shared/projects/archived', project: project
71: - if stars
app/views/shared/projects/_project.html.haml:68:in `block in _app_views_shared_projects__project_html_haml__3891499285487184179_70335375767000'
app/views/shared/projects/_project.html.haml:21:in `_app_views_shared_projects__project_html_haml__3891499285487184179_70335375767000'
app/views/shared/projects/_list.html.haml:42:in `block in _app_views_shared_projects__list_html_haml__1643999374384091770_70335377151280'
app/views/shared/projects/_list.html.haml:40:in `each_with_index'
app/views/shared/projects/_list.html.haml:40:in `_app_views_shared_projects__list_html_haml__1643999374384091770_70335377151280'
app/views/dashboard/projects/_projects.html.haml:1:in `_app_views_dashboard_projects__projects_html_haml__3398684358779887154_70335369580920'
app/views/dashboard/projects/index.html.haml:15:in `_app_views_dashboard_projects_index_html_haml___4405354157944001200_70335439790900'
app/controllers/application_controller.rb:120:in `render'
app/controllers/dashboard/projects_controller.rb:60:in `block in render_projects'
lib/gitlab/gitaly_client.rb:297:in `allow_n_plus_1_calls'
app/controllers/dashboard/projects_controller.rb:59:in `render_projects'
ee/app/controllers/ee/dashboard/projects_controller.rb:16:in `render_projects'
app/controllers/dashboard/projects_controller.rb:19:in `block (2 levels) in index'
app/controllers/dashboard/projects_controller.rb:17:in `index'
app/controllers/root_controller.rb:20:in `block in index'
lib/gitlab/gitaly_client.rb:297:in `allow_n_plus_1_calls'
app/controllers/root_controller.rb:19:in `index'
ee/lib/gitlab/ip_address_state.rb:10:in `with'
ee/app/controllers/ee/application_controller.rb:43:in `set_current_ip_address'
lib/gitlab/session.rb:11:in `with_session'
app/controllers/application_controller.rb:458: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:452:in `set_locale'
lib/gitlab/error_tracking.rb:34:in `with_context'
app/controllers/application_controller.rb:536:in `sentry_context'
lib/gitlab/middleware/rails_queue_duration.rb:27: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'
ee/lib/gitlab/jira/middleware.rb:19:in `call'
lib/gitlab/middleware/go.rb:20:in `call'
lib/gitlab/etag_caching/middleware.rb:13:in `call'
lib/gitlab/middleware/correlation_id.rb:16:in `block in call'
lib/gitlab/middleware/correlation_id.rb:15:in `call'
lib/gitlab/middleware/multipart.rb:117:in `call'
lib/gitlab/middleware/read_only/controller.rb:48:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/basic_health_check.rb:25:in `call'
lib/gitlab/request_context.rb:32:in `call'
config/initializers/fix_local_cache_middleware.rb:9:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:49:in `call'
lib/gitlab/middleware/release_env.rb:12:in `call'
Results of GitLab environment info
Reproduced on GDK on master and via the latest nightly omnibus-gitlab image.