Create project from custom template failed with "undefined method `start_with?' for nil:NilClass"

Summary

Create project from instance-level project template failed.

Steps to reproduce

We use Native Helm Chart that deployed on-premise. Chart version 1.9.3

Example Project

Not yet available.

What is the current bug behavior?

When creating projects using a custom template(which is a project in a specific group), the export step success but the import step failed.

What is the expected correct behavior?

Both export/import steps should succeed.

Relevant logs and/or screenshots

production.log

2019-06-20T07:21:34.990Z 9 TID-gpyjwnxd9 ProjectExportWorker JID-920f4d3a87e3654b518ec78a INFO: start                   
Saved project export /srv/gitlab/shared/tmp/project_exports/templates/code-project/2019-06-20_07-21-083_templates_code-project_export.tar.gz                                                                                                                                     
Import/Export - Project code-project with ID: 41 successfully exported                                                  
Import/Export - Project code-project with ID: 41 export error - Error importing repository  into [FILTERED] - undefined method `start_with?' for nil:NilClass                                                                                                                    
[ActiveJob] Enqueued ActionMailer::DeliveryJob (Job ID: 1b4674f6-634d-4799-92cb-3a4bc46b8cb8) to Sidekiq(mailers) with arguments: "Notify", "project_was_not_exported_email", "deliver_now", #<GlobalID:0x00007fb9baf7f960 @uri=#<URI::GID gid://gitlab/User/2>>, #<GlobalID:0x00
007fb9baf7ef88 @uri=#<URI::GID gid://gitlab/Project/41>>, ["Error importing repository  into [FILTERED] - undefined method `start_with?' for nil:NilClass"]                                                     

note: Error importing repository into here missing the source project name.

importer.log

{"severity":"ERROR","time":"2019-06-20T07:21:35.890Z","correlation_id":"R3DqNbKVK8a","importer":"Import/Export","import_jid":null,"project_id":41,"project_path":"templates/code-project","message":"Error importing repository  into mimos/wallet/code/service/api-gateway - undefined method `start_with?' for nil:NilClass","caller":"/srv/gitlab/lib/gitlab/import_export/after_export_strategies/base_after_export_strategy.rb:47:in `rescue in execute'"}
{"severity":"DEBUG","time":"2019-06-20T07:21:35.904Z","correlation_id":"R3DqNbKVK8a","importer":"Import/Export","import_jid":null,"project_id":41,"project_path":"templates/code-project","backtrace":"/srv/gitlab/app/workers/repository_import_worker.rb:26:in `perform'
/srv/gitlab/ee/app/workers/ee/repository_import_worker.rb:9:in `perform'
/srv/gitlab/ee/lib/ee/gitlab/import_export/after_export_strategies/custom_template_export_import_strategy.rb:30:in `strategy_execute'
/srv/gitlab/lib/gitlab/import_export/after_export_strategies/base_after_export_strategy.rb:43:in `execute'
/srv/gitlab/app/services/projects/import_export/export_service.rb:18:in `execute_after_export_action'
/srv/gitlab/app/services/projects/import_export/export_service.rb:10:in `execute'
/srv/gitlab/app/workers/project_export_worker.rb:14:in `perform'
/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:192:in `execute_job'
/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:165:in `block (2 levels) in process'
/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/middleware/chain.rb:128:in `block in invoke'
/srv/gitlab/lib/gitlab/metrics/sidekiq_middleware.rb:15:in `block in call'
/srv/gitlab/lib/gitlab/metrics/transaction.rb:57:in `run'
/srv/gitlab/lib/gitlab/metrics/sidekiq_middleware.rb:15:in `call'
/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
/srv/gitlab/lib/gitlab/sidekiq_status/server_middleware.rb:7:in `call'
/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
/srv/gitlab/lib/gitlab/sidekiq_middleware/correlation_logger.rb:10:in `block in call'
/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/gitlab-labkit-0.2.0/lib/labkit/correlation/correlation_id.rb:18:in `use_id'
/srv/gitlab/lib/gitlab/sidekiq_middleware/correlation_logger.rb:9:in `call'
/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
/srv/gitlab/lib/gitlab/sidekiq_middleware/batch_loader.rb:7:in `call'
/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
/srv/gitlab/lib/gitlab/sidekiq_middleware/request_store_middleware.rb:8:in `call'
/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
/srv/gitlab/lib/gitlab/sidekiq_middleware/memory_killer.rb:18:in `call'
/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sentry-raven-2.9.0/lib/raven/integrations/sidekiq.rb:9:in `call'
/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/middleware/chain.rb:133:in `invoke'
/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:164:in `block in process'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:137:in `block (6 levels) in dispatch'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/job_retry.rb:109:in `local'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:136:in `block (5 levels) in dispatch'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/rails.rb:43:in `block in call'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.7/lib/active_support/execution_wrapper.rb:85:in `wrap'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.7/lib/active_support/reloader.rb:68:in `block in wrap'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.7/lib/active_support/execution_wrapper.rb:85:in `wrap'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.7/lib/active_support/reloader.rb:67:in `wrap'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/rails.rb:42:in `call'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:132:in `block (4 levels) in dispatch'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:250:in `stats'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:127:in `block (3 levels) in dispatch'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/job_logger.rb:8:in `call'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:126:in `block (2 levels) in dispatch'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/job_retry.rb:74:in `global'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:125:in `block in dispatch'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/logging.rb:48:in `with_context'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/logging.rb:42:in `with_job_hash_context'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:124:in `dispatch'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:163:in `process'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:83:in `process_one'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/processor.rb:71:in `run'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/util.rb:16:in `watchdog'\n/srv/gitlab/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.7/lib/sidekiq/util.rb:25:in `block in safe_thread'"}

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

System information System: Proxy: no Current User: git Using RVM: no Ruby Version: 2.5.3p105 Gem Version: 2.7.6 Bundler Version:1.17.3 Rake Version: 12.3.2 Redis Version: unknown Git Version: unknown Sidekiq Version:5.2.7 Go Version: unknown

GitLab information Version: 11.11.3-ee Revision: 8c5c5069 Directory: /srv/gitlab DB Adapter: PostgreSQL DB Version: 9.6.8 URL: https://gitlab.infra.mimos.io HTTP Clone URL: https://gitlab.infra.mimos.io/some-group/some-project.git SSH Clone URL: git@gitlab.infra.mimos.io:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers: google_oauth2

GitLab Shell
Version: unknown
Repository storage paths:

  • default: /var/opt/gitlab/repo
    GitLab Shell path: /home/git/gitlab-shell
    Git: /usr/bin/git

Results of GitLab application Check

Expand for output related to GitLab application info

Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 9.1.0 ? ... FAIL. Please update gitlab-shell to 9.1.0 from Unknown
Running /home/git/gitlab-shell/bin/check gitlab-shell self-check failed
Try fixing it:
Make sure GitLab is running;
Check the gitlab-shell configuration file:
sudo -u git -H editor /home/git/gitlab-shell/config.yml Please fix the error above and rerun the checks.

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

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

Checking Sidekiq ... 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? ... no Trying to fix error automatically. ...Failed Try fixing it:
sudo -u git -H "/usr/bin/git" config --global core.autocrlf "input"
For more information see:
doc/install/installation.md in section "GitLab" 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? ... no Try fixing it:
sudo chown -R gitlab /srv/gitlab/tmp
sudo chmod -R u+rwX /srv/gitlab/tmp
For more information see: doc/install/installation.md in section "GitLab"
Please fix the error above and rerun the checks.
Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes
Uploads directory tmp has correct permissions? ... skipped (no tmp uploads folder yet) Init script exists? ... no
Try fixing it:
Install the init script For more information see:
doc/install/installation.md in section "Install Init Script"
Please fix the error above and rerun the checks.
Init script up-to-date? ... can't check because of previous errors Projects have namespace: ...
8/1 ... yes
7/2 ... yes
9/3 ... yes
9/4 ... yes
7/6 ... yes
10/8 ... yes
8/9 ... yes
15/11 ... yes
17/12 ... yes
13/13 ... yes
14/14 ... yes
15/15 ... yes
17/16 ... yes
13/17 ... yes
9/19 ... yes
18/22 ... yes
18/23 ... yes
18/24 ... yes
18/25 ... yes
23/27 ... yes
13/28 ... yes
25/29 ... yes
20/30 ... yes
18/32 ... yes
20/33 ... yes
10/34 ... yes
10/35 ... yes
34/38 ... yes
20/39 ... yes
4/40 ... yes
35/41 ... yes
9/43 ... yes
9/52 ... yes
9/54 ... yes
Redis version >= 2.8.0? ... no
Try fixing it:
Update your redis server to a version >= 2.8.0 For more information see:
gitlab-public-wiki/wiki/Trouble-Shooting-Guide in section sidekiq Please fix the error above and rerun the checks. Ruby version >= 2.5.3 ? ... yes (2.5.3) Git version >= 2.21.0 ? ... no
Your git bin path is "/usr/bin/git" Try fixing it:
Update your git to a version >= 2.21.0 from Unknown Please fix the error above and rerun the checks. Git user has default SSH configuration? ... yes
Active users: ... 9
Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

these logs were generated from gitlab-sidekiq-all-in-1 deployment, some components failed since they are not on the same pod.

Possible fixes

Nothing yet.

Edited Sep 02, 2020 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading