Cannot enable Wiki

We have a project where the Wiki was disabled. Today we would like to enable it but it fail with “Something went wrong on our end”. Looking into the log I have an error message : “ArgumentError (user must be a User, got Group)

We are running GitLab Enterprise Edition [13.4.1-ee] docker-image.

Here is a picture of the error and actual configuration of our project:

And the complete log:

Started PATCH “/OUR_ORG/OUR_PROJECT” for OUR_IP at 2020-12-18 09:00:30 +0000
Processing by ProjectsController#update as JS
Parameters: {“utf8”=>“✓”, “authenticity_token”=>"[FILTERED]", “update_section”=>“js-shared-permissions”, “project”=>{“visibility_level”=>“10”, “request_access_enabled”=>“true”, “project_feature_attributes”=>{“issues_access_level”=>“20”, “repository_access_level”=>“0”, “merge_requests_access_level”=>“0”, “forking_access_level”=>“20”, “builds_access_level”=>“0”, “wiki_access_level”=>“20”, “snippets_access_level”=>“0”, “metrics_dashboard_access_level”=>“10”}, “lfs_enabled”=>“true”, “packages_enabled”=>“false”, “emails_disabled”=>“false”, “project_setting_attributes”=>{“show_default_award_emojis”=>“true”}}, “commit”=>“Save changes”, “namespace_id”=>“OUR_ORG”, “id”=>“OUR_PROJECT”}
Completed 500 Internal Server Error in 176ms (ActiveRecord: 21.5ms | Elasticsearch: 0.0ms | Allocations: 87327)

==> /var/log/gitlab/gitlab-rails/production_json.log <==
{“method”:“PATCH”,“path”:"/OUR_ORG/OUR_PROJECT",“format”:“js”,“controller”:“ProjectsController”,“action”:“update”,“status”:500,“time”:“2020-12-18T09:00:30.625Z”,“params”:[{“key”:“utf8”,“value”:“✓”},{“key”:"_method",“value”:“patch”},{“key”:“authenticity_token”,“value”:"[FILTERED]"},{“key”:“update_section”,“value”:“js-shared-permissions”},{“key”:“project”,“value”:{“visibility_level”:“10”,“request_access_enabled”:“true”,“project_feature_attributes”:{“issues_access_level”:“20”,“repository_access_level”:“0”,“merge_requests_access_level”:“0”,“forking_access_level”:“20”,“builds_access_level”:“0”,“wiki_access_level”:“20”,“snippets_access_level”:“0”,“metrics_dashboard_access_level”:“10”},“lfs_enabled”:“true”,“packages_enabled”:“false”,“emails_disabled”:“false”,“project_setting_attributes”:{“show_default_award_emojis”:“true”}}},{“key”:“commit”,“value”:“Save changes”},{“key”:“namespace_id”,“value”:“OUR_ORG”},{“key”:“id”,“value”:“OUR_PROJECT”}],“remote_ip”:“OUR_IP”,“user_id”:14,“username”:“ME”,“ua”:“Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0”,“correlation_id”:“93kP8mXQp14”,“meta.user”:“ME”,“meta.project”:“OUR_ORG/OUR_PROJECT”,“meta.root_namespace”:“OUR_ORG”,“meta.caller_id”:“ProjectsController#update”,“redis_calls”:4,“redis_duration_s”:0.001512,“redis_read_bytes”:723,“redis_write_bytes”:727,“redis_cache_calls”:3,“redis_cache_duration_s”:0.001123,“redis_cache_read_bytes”:484,“redis_cache_write_bytes”:140,“redis_shared_state_calls”:1,“redis_shared_state_duration_s”:0.000389,“redis_shared_state_read_bytes”:239,“redis_shared_state_write_bytes”:587,“cpu_s”:0.21,“exception.class”:“ArgumentError”,“exception.message”:“user must be a User, got Group”,“exception.backtrace”:[“app/models/wiki.rb:38:in initialize'","app/services/projects/update_service.rb:138:in new’”,“app/services/projects/update_service.rb:138:in ensure_wiki_exists'","app/services/projects/update_service.rb:14:in execute’”,“ee/app/services/ee/projects/update_service.rb:31:in execute'","app/controllers/projects_controller.rb:84:in update’”,“ee/lib/gitlab/ip_address_state.rb:10:in with'","ee/app/controllers/ee/application_controller.rb:44:in set_current_ip_address’”,“app/controllers/application_controller.rb:491:in set_current_admin'","lib/gitlab/session.rb:11:in with_session’”,“app/controllers/application_controller.rb:482:in set_session_storage'","lib/gitlab/i18n.rb:73:in with_locale’”,“lib/gitlab/i18n.rb:79:in with_user_locale'","app/controllers/application_controller.rb:476:in set_locale’”,“lib/gitlab/error_tracking.rb:52:in with_context'","app/controllers/application_controller.rb:541:in sentry_context’”,“app/controllers/application_controller.rb:469:in block in set_current_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:462:in set_current_context'","lib/gitlab/request_profiler/middleware.rb:17:in call’”,“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/multipart.rb:217:in call’”,“lib/gitlab/middleware/read_only/controller.rb:51: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/handle_ip_spoof_attack_error.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’”],“db_duration_s”:0.02153,“view_duration_s”:0.0,“duration_s”:0.17664,“db_count”:0,“db_write_count”:0,“db_cached_count”:0}

==> /var/log/gitlab/gitlab-rails/production.log <==

ArgumentError (user must be a User, got Group):

app/models/wiki.rb:38:in initialize' app/services/projects/update_service.rb:138:in new’
app/services/projects/update_service.rb:138:in ensure_wiki_exists' app/services/projects/update_service.rb:14:in execute’
ee/app/services/ee/projects/update_service.rb:31:in execute' app/controllers/projects_controller.rb:84:in update’
ee/lib/gitlab/ip_address_state.rb:10:in with' ee/app/controllers/ee/application_controller.rb:44:in set_current_ip_address’
app/controllers/application_controller.rb:491:in set_current_admin' lib/gitlab/session.rb:11:in with_session’
app/controllers/application_controller.rb:482:in set_session_storage' lib/gitlab/i18n.rb:73:in with_locale’
lib/gitlab/i18n.rb:79:in with_user_locale' app/controllers/application_controller.rb:476:in set_locale’
lib/gitlab/error_tracking.rb:52:in with_context' app/controllers/application_controller.rb:541:in sentry_context’
app/controllers/application_controller.rb:469:in block in set_current_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:462:in set_current_context' lib/gitlab/request_profiler/middleware.rb:17:in call’
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/multipart.rb:217:in call’
lib/gitlab/middleware/read_only/controller.rb:51: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/handle_ip_spoof_attack_error.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’

==> /var/log/gitlab/gitlab-workhorse/current <==
{“correlation_id”:“93kP8mXQp14”,“duration_ms”:268,“host”:“OUR_GITLAB”,“level”:“info”,“method”:“POST”,“msg”:“access”,“proto”:“HTTP/1.1”,“referrer”:“https://OUR_GITLAB/OUR_ORG/OUR_PROJECT/edit”,“remote_addr”:“127.0.0.1:0”,“remote_ip”:“127.0.0.1”,“status”:500,“system”:“http”,“time”:“2020-12-18T09:00:30Z”,“uri”:"/OUR_ORG/OUR_PROJECT",“user_agent”:“Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0”,“written_bytes”:2926}

==> /var/log/gitlab/nginx/gitlab_access.log <==
OUR_IP - - [18/Dec/2020:09:00:30 +0000] “POST /OUR_ORG/OUR_PROJECT HTTP/1.1” 500 2926 “https://OUR_GITLAB/OUR_ORG/OUR_PROJECT/edit” “Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0” -

==> /var/log/gitlab/gitlab-workhorse/current <==
{“correlation_id”:“fK2Uvmt2r72”,“duration_ms”:1,“host”:“OUR_GITLAB”,“level”:“info”,“method”:“POST”,“msg”:“access”,“proto”:“HTTP/1.1”,“referrer”:"",“remote_addr”:“127.0.0.1:0”,“remote_ip”:“127.0.0.1”,“status”:204,“system”:“http”,“time”:“2020-12-18T09:00:30Z”,“uri”:"/api/v4/jobs/request",“user_agent”:“gitlab-runner 13.1.1 (13-1-stable; go1.13.8; linux/amd64)”,“written_bytes”:0}

You’re running into an older bug, fixed in 13.4.3 and higher: https://gitlab.com/gitlab-org/gitlab/-/issues/241619

On 13.4.1 you can try to enable wiki through the API as described in the workaround section of the same issue: https://gitlab.com/gitlab-org/gitlab/-/issues/241619#workaround