Forking git repository yields error 500
Summary
Trying to fork a git repository (with the button on the repo site) yields error 500.
Steps to reproduce
Press the fork button on a git repository's site.
docker-compose logs
heptapod_1 | ==> /var/log/gitlab/gitlab-rails/production.log <==
heptapod_1 | Started GET "/gitlab/hermann/t2/-/forks/new" for 192.168.11.20 at 2021-12-10 12:10:55 +0000
heptapod_1 | Processing by Projects::ForksController#new as HTML
heptapod_1 | Parameters: {"namespace_id"=>"hermann", "project_id"=>"t2"}
heptapod_1 | Rendered layout layouts/project.html.haml (Duration: 234.1ms | Allocations: 45057)
heptapod_1 | Completed 500 Internal Server Error in 502ms (ActiveRecord: 96.4ms | Elasticsearch: 0.0ms | Allocations: 107653)
heptapod_1 |
heptapod_1 | ==> /var/log/gitlab/gitlab-rails/production_json.log <==
heptapod_1 | {"method":"GET","path":"/gitlab/hermann/t2/-/forks/new","format":"html","controller":"Projects::ForksController","action":"new","status":500,"time":"2021-12-10T12:10:56.584Z","params":[{"key":"namespace_id","value":"hermann"},{"key":"project_id","value":"t2"}],"remote_ip":"192.168.11.20","user_id":2,"username":"hermann","ua":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0","correlation_id":"01FPJ41RP40TFY96QWG5WQ0W6F","meta.user":"hermann","meta.project":"hermann/t2","meta.root_namespace":"hermann","meta.caller_id":"Projects::ForksController#new","meta.remote_ip":"192.168.11.20","meta.feature_category":"source_code_management","meta.client_id":"user/2","redis_calls":13,"redis_duration_s":0.004601,"redis_read_bytes":1941,"redis_write_bytes":1521,"redis_cache_calls":10,"redis_cache_duration_s":0.003309,"redis_cache_read_bytes":1760,"redis_cache_write_bytes":591,"redis_shared_state_calls":3,"redis_shared_state_duration_s":0.001292,"redis_shared_state_read_bytes":181,"redis_shared_state_write_bytes":930,"db_count":10,"db_write_count":0,"db_cached_count":1,"db_replica_count":0,"db_replica_cached_count":0,"db_replica_wal_count":0,"db_replica_wal_cached_count":0,"db_primary_count":10,"db_primary_cached_count":1,"db_primary_wal_count":0,"db_primary_wal_cached_count":0,"db_replica_duration_s":0.0,"db_primary_duration_s":0.026,"cpu_s":0.79445,"mem_objects":255113,"mem_bytes":47015802,"mem_mallocs":187538,"mem_total_bytes":57220322,"pid":942,"queue_duration_s":0.308312,"exception.class":"ActionView::Template::Error","exception.message":"undefined local variable or method `project' for #<ActionView::Base:0x000000000568b0>\nDid you mean? @project","exception.backtrace":["app/views/projects/forks/new.html.haml:3","app/controllers/application_controller.rb:136:in `render'","app/controllers/application_controller.rb:521:in `set_current_admin'","lib/gitlab/session.rb:11:in `with_session'","app/controllers/application_controller.rb:512:in `set_session_storage'","lib/gitlab/i18n.rb:105:in `with_locale'","lib/gitlab/i18n.rb:111:in `with_user_locale'","app/controllers/application_controller.rb:506:in `set_locale'","app/controllers/application_controller.rb:500:in `set_current_context'","lib/gitlab/metrics/elasticsearch_rack_middleware.rb:16:in `call'","lib/gitlab/middleware/rails_queue_duration.rb:33:in `call'","lib/gitlab/middleware/speedscope.rb:13:in `call'","lib/gitlab/request_profiler/middleware.rb:17:in `call'","lib/gitlab/database/load_balancing/rack_middleware.rb:23:in `call'","lib/gitlab/metrics/rack_middleware.rb:16:in `block in call'","lib/gitlab/metrics/web_transaction.rb:21:in `run'","lib/gitlab/metrics/rack_middleware.rb:16:in `call'","lib/gitlab/jira/middleware.rb:19:in `call'","lib/gitlab/middleware/go.rb:20:in `call'","lib/gitlab/etag_caching/middleware.rb:21:in `call'","lib/gitlab/middleware/multipart.rb:173:in `call'","lib/gitlab/middleware/read_only/controller.rb:50:in `call'","lib/gitlab/middleware/read_only.rb:18:in `call'","lib/gitlab/middleware/same_site_cookies.rb:27:in `call'","lib/gitlab/middleware/handle_malformed_strings.rb:21:in `call'","lib/gitlab/middleware/basic_health_check.rb:25:in `call'","lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call'","lib/gitlab/middleware/request_context.rb:21:in `call'","config/initializers/fix_local_cache_middleware.rb:11:in `call'","lib/gitlab/middleware/rack_multipart_tempfile_factory.rb:19:in `call'","lib/gitlab/middleware/sidekiq_web_static.rb:20:in `call'","lib/gitlab/metrics/requests_rack_middleware.rb:75:in `call'","lib/gitlab/middleware/release_env.rb:12:in `call'"],"db_duration_s":0.09636,"view_duration_s":0.0,"duration_s":0.50255}
heptapod_1 |
heptapod_1 | ==> /var/log/gitlab/gitlab-rails/production.log <==
heptapod_1 |
heptapod_1 | ActionView::Template::Error (undefined local variable or method `project' for #<ActionView::Base:0x000000000568b0>
heptapod_1 | Did you mean? @project):
heptapod_1 | 1: - page_title s_("ForkProject|Fork project")
heptapod_1 | 2:
heptapod_1 | 3: - if Feature.enabled?(:fork_project_form, @project, default_enabled: :yaml) && !project.mercurial?
heptapod_1 | 4: #fork-groups-mount-element{ data: { fork_illustration: image_path('illustrations/project-create-new-sm.svg'),
heptapod_1 | 5: endpoint: new_project_fork_path(@project, format: :json),
heptapod_1 | 6: new_group_path: new_group_path,
heptapod_1 |
heptapod_1 | app/views/projects/forks/new.html.haml:3
heptapod_1 | app/controllers/application_controller.rb:136:in `render'
heptapod_1 | app/controllers/application_controller.rb:521:in `set_current_admin'
heptapod_1 | lib/gitlab/session.rb:11:in `with_session'
heptapod_1 | app/controllers/application_controller.rb:512:in `set_session_storage'
heptapod_1 | lib/gitlab/i18n.rb:105:in `with_locale'
heptapod_1 | lib/gitlab/i18n.rb:111:in `with_user_locale'
heptapod_1 | app/controllers/application_controller.rb:506:in `set_locale'
heptapod_1 | app/controllers/application_controller.rb:500:in `set_current_context'
heptapod_1 | lib/gitlab/metrics/elasticsearch_rack_middleware.rb:16:in `call'
heptapod_1 | lib/gitlab/middleware/rails_queue_duration.rb:33:in `call'
heptapod_1 | lib/gitlab/middleware/speedscope.rb:13:in `call'
heptapod_1 | lib/gitlab/request_profiler/middleware.rb:17:in `call'
heptapod_1 | lib/gitlab/database/load_balancing/rack_middleware.rb:23:in `call'
heptapod_1 | lib/gitlab/metrics/rack_middleware.rb:16:in `block in call'
heptapod_1 | lib/gitlab/metrics/web_transaction.rb:21:in `run'
heptapod_1 | lib/gitlab/metrics/rack_middleware.rb:16:in `call'
heptapod_1 | lib/gitlab/jira/middleware.rb:19:in `call'
heptapod_1 | lib/gitlab/middleware/go.rb:20:in `call'
heptapod_1 | lib/gitlab/etag_caching/middleware.rb:21:in `call'
heptapod_1 | lib/gitlab/middleware/multipart.rb:173:in `call'
heptapod_1 | lib/gitlab/middleware/read_only/controller.rb:50:in `call'
heptapod_1 | lib/gitlab/middleware/read_only.rb:18:in `call'
heptapod_1 | lib/gitlab/middleware/same_site_cookies.rb:27:in `call'
heptapod_1 | lib/gitlab/middleware/handle_malformed_strings.rb:21:in `call'
heptapod_1 | lib/gitlab/middleware/basic_health_check.rb:25:in `call'
heptapod_1 | lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call'
heptapod_1 | lib/gitlab/middleware/request_context.rb:21:in `call'
heptapod_1 | config/initializers/fix_local_cache_middleware.rb:11:in `call'
heptapod_1 | lib/gitlab/middleware/rack_multipart_tempfile_factory.rb:19:in `call'
heptapod_1 | lib/gitlab/middleware/sidekiq_web_static.rb:20:in `call'
heptapod_1 | lib/gitlab/metrics/requests_rack_middleware.rb:75:in `call'
heptapod_1 | lib/gitlab/middleware/release_env.rb:12:in `call'
heptapod_1 |
heptapod_1 | ==> /var/log/gitlab/nginx/gitlab_access.log <==
heptapod_1 | 192.168.11.20 - - [10/Dec/2021:12:10:56 +0000] "GET /gitlab/hermann/t2/-/forks/new HTTP/1.1" 500 12146 "https://host/gitlab/hermann/t2" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0" -
heptapod_1 |
heptapod_1 | ==> /var/log/gitlab/gitlab-workhorse/current <==
heptapod_1 | {"content_type":"text/html; charset=utf-8","correlation_id":"01FPJ41RP40TFY96QWG5WQ0W6F","duration_ms":1050,"host":"host","level":"info","method":"GET","msg":"access","proto":"HTTP/1.1","referrer":"https://host/gitlab/hermann/t2","remote_addr":"127.0.0.1:0","remote_ip":"127.0.0.1","route":"","status":500,"system":"http","time":"2021-12-10T12:10:56Z","ttfb_ms":1050,"uri":"/gitlab/hermann/t2/-/forks/new","user_agent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0","written_bytes":12146}
Details about the Heptapod instance where the bug occurs
- Docker
- Heptapod 0.27.1