How I can delete broken GitLab repository, if standard way shows me Error 500?

Viewed 669

After an unsuccessful upgrade, some of the repositories broke, when trying to delete the repository as standard way, it shows Error 500 ("500 Whoops, something went wrong on our end. Try refreshing the page, or going back and attempting the action again. Please contact your GitLab administrator if this problem persists. Go back"). How I can delete the repository on the ubuntu server? In production.log I found such entries about my attempt to delete the repository:

Started DELETE "/student100675/anagrams" for 217.MY.IP.HERE at 2021-11-09 11:30:30 +0200 Processing by ProjectsController#destroy as HTML Parameters: {"authenticity_token"=>"[FILTERED]", "namespace_id"=>"student100675", "id"=>"anagrams"} Completed 500 Internal Server Error in 60ms (ActiveRecord: 3.5ms | Elasticsearch: 0.0ms | Allocations: 9529)

OpenSSL::Cipher::CipherError ():

lib/gitlab/crypto_helper.rb:28:in aes256_gcm_decrypt' app/models/concerns/token_authenticatable_strategies/encryption_helper.rb:18:in decrypt_token' app/models/concerns/token_authenticatable_strategies/encrypted.rb:45:in get_token' app/models/concerns/token_authenticatable_strategies/base.rb:32:in ensure_token' app/models/concerns/token_authenticatable_strategies/encrypted.rb:32:in ensure_token' app/models/concerns/token_authenticatable.rb:43:in block in add_authentication_token_field' app/services/projects/destroy_service.rb:10:in async_execute' app/controllers/projects_controller.rb:162:in destroy' app/controllers/application_controller.rb:485:in set_current_admin' lib/gitlab/session.rb:11:in with_session' app/controllers/application_controller.rb:476: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:470:in set_locale' app/controllers/application_controller.rb:464:in set_current_context' lib/gitlab/middleware/speedscope.rb:13:in call' 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:21:in call' lib/gitlab/middleware/multipart.rb:172: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:74:in call' lib/gitlab/middleware/release_env.rb:12:in `call'

3 Answers

It was the problem with hashed and legacy repositories, I solved it with this tip:

gitlab-rails console
projects = Project.where(repository_read_only: true)
projects.each do |p|
  p.update!(repository_read_only:nil)
end
gitlab-rake gitlab:storage:migrate_to_hashed
gitlab-ctl reconfigure

I tried all two versions of what’s written here and they didn’t help me

The only thing that helped me is a complete reinstallation of gitlab

before deleting everything I copied all the repositories to my local disk and all users

after installation created new repositories and push an existing Git repository

Related