"Rugged::OdbError (Object not found - no match for id" after import with --depth=1
Summary
Some parts of the project section get issues after importing (via gitlab-rake gitlab:import:repos) a new (bare) repository cloned from an other with --depth=1.
- The project is imported without error with gitlab-rake gitlab:import:repos.
- I Can select the project in GitLab.
- I can access to "file" section => OK
- I can't access to "commit" section => error 500
- I can't access to "branch" section => error 500
- I can access to "contributors" But I see the message "Something went wrong on our end." => ?
- I can access to "graph" But the graph stay blank." => ?
Steps to reproduce
- Clone a project with command:
git clone --bare --depth=30 --branch master --single-branch file:///var/opt/gitlab/git-data/repositories/myuser/myproject.git /var/opt/gitlab/git-data/repositories/myuser/my_new_project.git
- Import it in GitLab
chown git:git /var/opt/gitlab/git-data/repositories/myuser/my_new_project.git -R
gitlab-rake gitlab:import:repos (note that everything is green at this point)
- Access to this new project in GitLab and try to access to the "commit" section.
What is the current bug behavior?
I get this issue only if y use the --depth option with the clone command. I have tried with deferents values (--depth=1, --depth=10, --depth=100) but I still get the same issue. But everything work fine if I don't use the --depth option.
What is the expected correct behavior?
I want to make a shell script what create new project in GitLab cloned from another without branches (excepted master) and history. So I can't use the "fork" option.
Relevant logs and/or screenshots
I get this message form /var/log/gitlab/gitlab-rails/production.log:
Processing by Projects::CommitsController#show as HTML Parameters: {"namespace_id"=>"myuser", "project_id"=>"my_new_project", "id"=>"master"}
Completed 500 Internal Server Error in 40ms (ActiveRecord: 4.2ms)
Rugged::OdbError (Object not found - no match for id (accecd81ff487eef0577196451a4fce6e2be7b99)):
lib/gitlab/git/repository.rb:372:in walk' lib/gitlab/git/repository.rb:372:in
each'
lib/gitlab/git/repository.rb:372:in to_a' lib/gitlab/git/repository.rb:372:in
log_by_walk'
lib/gitlab/git/repository.rb:353:in log' lib/gitlab/git/commit.rb:47:in
where'
app/models/repository.rb:115:in commits' app/controllers/projects/commits_controller.rb:18:in
show'
app/controllers/application_controller.rb:281:in set_locale' lib/gitlab/middleware/multipart.rb:93:in
call'
lib/gitlab/request_profiler/middleware.rb:14:in call' lib/gitlab/middleware/go.rb:16:in
call'
lib/gitlab/etag_caching/middleware.rb:10:in call' lib/gitlab/request_context.rb:18:in
call'
Output of checks
I use a GitLab Community Edition 9.2.5 gitlab-foss@6f2e590e
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Ubuntu 16.04 Current User: git Using RVM: no Ruby Version: 2.3.3p222 Gem Version: 2.6.6 Bundler Version:1.13.7 Rake Version: 10.5.0 Redis Version: 3.2.5 Git Version: 2.11.1 Sidekiq Version:5.0.0
GitLab information Version: 9.2.5 Revision: 6f2e590 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: http://*** HTTP Clone URL: http:///some-group/some-project.git SSH Clone URL: git@:some-group/some-project.git Using LDAP: no Using Omniauth: no
GitLab Shell Version: 5.0.4 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
GitLab Shell version >= 5.0.4 ? ... OK (5.0.4) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 5/17 ... ok 2/23 ... ok 10/28 ... ok Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Access to /var/opt/gitlab/.ssh/authorized_keys: OK Send ping to redis server: OK gitlab-shell self-check successfulChecking GitLab Shell ... Finished
Checking Sidekiq ...