Failing to import a project from gitlab.com to self hosted instance

Summary

I have exported my project from gitlab.com and can't seem to import it onto my self hosted instance. The archive is just over 200MB in size and the repo contains about 8000 commits and 1200 issues. Any help or suggestions would be appreciated as this is rather urgent.

Here's what I have tried so far:

  • Increase unicorn worker timeout to 600 seconds (reference)

  • Set sidekiq concurrency to 1 (reference)

  • Adjusted number of CPU cores to 12 and memory to 64GB

Steps to reproduce

Try importing a large-ish repo into a self hosted instance. All 1200 issue are imported (excluding attachments) and the import usually fails afterwards

What is the current bug behavior?

With sidekiq concurrency set to 1 the error is:


PG::ConnectionBad: PQsocket() can't get socket descriptor: BEGIN. Original error: Error importing repository  into TestNamespace/test-repo - PG::ConnectionBad: PQsocket() can't get socket descriptor: ROLLBACK

Without any modifications to gitlab.rb I get this:

Error setting import status to failed: PG::ConnectionBad: PQsocket() can't get socket descriptor: BEGIN. Original error: Error importing repository  into TestNamespace/test-repo - PG::ConnectionBad: PQsocket() can't get socket descriptor: ROLLBACK
writing value to /run/gitlab/sidekiq/gauge_all_process_id_30886-0.db failed with no implicit conversion to float from nil

What is the expected correct behavior?

Project to import successfully.

Results of GitLab environment info

Expand for output related to GitLab environment info

System information System: Ubuntu 18.04 Proxy: no Current User: git Using RVM: no Ruby Version: 2.4.4p296 Gem Version: 2.7.6 Bundler Version:1.16.2 Rake Version: 12.3.1 Redis Version: 3.2.11 Git Version: 2.17.1 Sidekiq Version:5.1.3 Go Version: unknown

GitLab information Version: 11.1.0-ee Revision: 9a9f41dcb1f Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql DB Version: 9.6.8 Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers: gitlab

GitLab Shell Version: 7.1.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

Checking GitLab Shell ...

GitLab Shell version >= 7.1.4 ? ... OK (7.1.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: ... 3/2 ... ok 3/12 ... ok 3/14 ... ok 3/18 ... ok 4/20 ... ok 3/22 ... ok Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK

Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Reply by email is disabled in config/gitlab.yml Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 3/2 ... yes 3/12 ... yes 3/14 ... yes 3/18 ... yes 4/20 ... yes 3/22 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.4.4) Git version >= 2.9.5 ? ... yes (2.17.1) Git user has default SSH configuration? ... yes Active users: ... 18 Elasticsearch version 5.1 - 5.5? ... skipped (elasticsearch is disabled)

Checking GitLab ... Finished