Translate

Wednesday, November 29, 2023

gitlab hashed project failed after migration

 

1.     gitlab-rails console

2.     Find the project by name: p = Project.find_by_name("<project-name>")

3.     Confirm that the repository is in fact read-only: p.repository_read_only

4.     Unset the repository_read_only flag: p.update!(repository_read_only:nil)

5.     Retry the corresponding Sidekiq job in the Admin Area 

6.     Rinse and repeat from step 2

or you can doing this with a script:

create a file named fix.rb

add these to content in 

# Find all projects that GitLab thinks is in legacy storage

Project.without_storage_feature(:repository).find_each(batch_size: 50) do |p|

        # Clear read only

        p.update!(repository_read_only:nil)

end

Then run it:

gitlab-rails runner ./fix.rb

note: if you have more than 50 project has problem, you can rerun this script untill everything is finished.

No comments:

Post a Comment