Project Import failing on fresh multi-node environments with error missing method 'import_url'
Summary
Project Import is sometimes failing due to a missing method 'import_url'. This only appears to happen in certain circumstances - On fresh multi-node Reference Architecture environments greater than version 12.7.0
. It doesn't happen with an equivalent Docker image environment (tested both latest release and nightly) or on a Reference Architecture environment that has been upgraded from a previous version.
This was first noticed around a month ago and through trial and error it was found that weirdly import did work fine when running the environment on 12.7.0
but subsequent versions showed this error when the environment has been built fresh (upgrades from older versions don't seem to show it). The project being imported is an export of the gitlabhq
backup we make to GitHub, imported to a GitLab environment and then exported.
As mentioned it works fine on the latest docker image (both released and nightly) so the concern is there may be an issue due to the environment differences, possibly multi-node.
Steps to reproduce
Unfortunately you'll need a multi-node Reference Architecture setup to see this issue in effect. Quality though can provide access to one as required.
Issue occurs pretty much immediately as the import process is started. UI still shows the import progress screen but behind the scenes the job has already failed in Sidekiq.
Example Project
Specific project export can be downloaded here - https://gitlab.com/gitlab-org/quality/performance-data/-/blob/gy-ce-import/projects_export/gitlabhq_export.tar.gz
What is the current bug behavior?
Project import fails immediately with error no superclass method
import_url'` even though the version is supported and should work fine.
What is the expected correct behavior?
Project import works as expected.
Relevant logs and/or screenshots
{
"severity":"ERROR",
"time":"2020-04-06T10:09:45.600Z",
"correlation_id":"6KuUm47ksb1",
"extra.server":{
"os":{
"name":"Linux",
"version":"#34-Ubuntu SMP Tue Mar 3 04:36:26 UTC 2020",
"build":"5.0.0-1033-gcp",
"kernel_version":"Linux gitlab-qa-25k-sidekiq-3 5.0.0-1033-gcp #34-Ubuntu SMP Tue Mar 3 04:36:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux"
},
"runtime":{
"name":"ruby",
"version":"ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]"
}
},
"extra.sidekiq":{
"retry":false,
"args":[
1
],
"class":"RepositoryImportWorker",
"queue":"repository_import",
"backtrace":5,
"status_expiration":54000,
"memory_killer_memory_growth_kb":50,
"memory_killer_max_memory_growth_kb":300000,
"jid":"0353d495d5e78f614f517fd1",
"created_at":1586167785.4673321,
"meta.user":"root",
"meta.caller_id":"Import::GitlabProjectsController#create",
"correlation_id":"6KuUm47ksb1",
"enqueued_at":1586167785.4699113
},
"extra.project_path":"qa-perf-testing/gitlabhq",
"extra.importer":"gitlab_project",
"exception.class":"NoMethodError",
"exception.message":"super:
no superclass method `import_url'' for #\u003cProject id:1 qa-perf-testing/gitlabhq\u003e\u003e",
"exception.backtrace":[
"app/models/project.rb:940:in `rescue in import_url''",
"app/models/project.rb:932:in `import_url''",
"app/models/project.rb:963:in `external_import?''",
"app/services/projects/import_service.rb:40:in `add_repository_to_project''",
"app/services/projects/import_service.rb:18:in `execute''",
"app/workers/repository_import_worker.rb:24:in `perform''",
"ee/app/workers/ee/repository_import_worker.rb:9:in `perform''",
"lib/gitlab/with_request_store.rb:7:in `with_request_store''",
"lib/gitlab/sidekiq_daemon/monitor.rb:49:in `within_job''"
]
}
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.6.5p114 Gem Version: 2.7.10 Bundler Version:1.17.3 Rake Version: 12.3.3 Redis Version: 5.0.7 Git Version: 2.24.1 Sidekiq Version:5.2.7 Go Version: unknown GitLab information Version: 12.9.0-ee Revision: 073a4ba8016 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 10.12 URL: http://25k.testbed.gitlab.net HTTP Clone URL: http://25k.testbed.gitlab.net/some-group/some-project.git SSH Clone URL: git@25k.testbed.gitlab.net:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers: GitLab Shell Version: 12.0.0 Repository storage paths: - default: /var/opt/gitlab/git-data/repositories - storage1: /var/opt/gitlab/git-data/repositories - storage2: /var/opt/gitlab/git-data/repositories - storage3: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK storage1 ... OK storage2 ... OK storage3 ... OK
Checking Gitaly ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab App ...
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: ... 2/1 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.5) Git version >= 2.22.0 ? ... yes (2.24.1) Git user has default SSH configuration? ... yes Active users: ... 1 Is authorized keys file accessible? ... yes Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished