异常:使用 gitlab rake 导出时,nil:NilClass 的未定义方法“projects”

问题描述 投票:0回答:1

我已经尝试调试这半天了,但没有取得任何进展。我正在尝试使用 GitLab Rake 导出项目并获得以下输出: 输入:

EXPORT_DEBUG=true gitlab-rake gitlab:import_export:export ['root', 'group-path', 'project-path', 'project_exports/20240628_group_project.tar.gz']

回应:

/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35: warning: ⛔️ WARNING: Sidekiq testing API enabled, but this is not the test environment. Your jobs will not go to Redis.
D, [2024-06-28T15:15:34.335955 #629] DEBUG -- : User Load (2.2ms) /*application:web,db_config_name:main*/ SELECT "users".* FROM "users" WHERE (1=0) LIMIT 1
**E, [2024-06-28T15:15:34.337484 #629] ERROR -- : Exception: undefined method `projects' for nil:NilClass**
D, [2024-06-28T15:15:34.337563 #629] DEBUG -- : ["/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/import_export/project/export_task.rb:10:in \initialize'",
"/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/import_export/export.rake:28:in `new'", "/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/import_export/export.rake:28:in `block (3 levels) in <top
(required)>'", "/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'", "/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'",
"/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'", "/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'",
"/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'", "/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'",
"/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'", "/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'",
"/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'", "/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'",
"/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'", "/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'",
"/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'", "/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:83:in `block in run'",
"/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'", "/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'",
"/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'", "/opt/gitlab/embedded/bin/rake:23:in `load'", "/opt/gitlab/embedded/bin/rake:23:in `<top (required)>'",
"/opt/gitlab/embedded/lib/ruby/site_ruby/2.7.0/bundler/cli/exec.rb:63:in `load'", "/opt/gitlab/embedded/lib/ruby/site_ruby/2.7.0/bundler/cli/exec.rb:63:in `kernel_load'",
"/opt/gitlab/embedded/lib/ruby/site_ruby/2.7.0/bundler/cli/exec.rb:28:in `run'", "/opt/gitlab/embedded/lib/ruby/site_ruby/2.7.0/bundler/cli.rb:476:in `exec'",
"/opt/gitlab/embedded/lib/ruby/site_ruby/2.7.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'", "/opt/gitlab/embedded/lib/ruby/site_ruby/2.7.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'",
"/opt/gitlab/embedded/lib/ruby/site_ruby/2.7.0/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'", "/opt/gitlab/embedded/lib/ruby/site_ruby/2.7.0/bundler/cli.rb:30:in `dispatch'",
"/opt/gitlab/embedded/lib/ruby/site_ruby/2.7.0/bundler/vendor/thor/lib/thor/base.rb:476:in `start'", "/opt/gitlab/embedded/lib/ruby/site_ruby/2.7.0/bundler/cli.rb:24:in `start'",
"/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/exe/bundle:46:in `block in <top (required)>'", "/opt/gitlab/embedded/lib/ruby/site_ruby/2.7.0/bundler/friendly_errors.rb:123:in `with_friendly_errors'",
"/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/exe/bundle:34:in `<top (required)>'", "/opt/gitlab/embedded/bin/bundle:23:in `load'", "/opt/gitlab/embedded/bin/bundle:23:in `<main>'"]`

我已经查看了[文档](https://docs.gitlab.com/ee/administration/raketasks/project_import_export.html#::text=gitlab-rake%20%22gitlab:import_export,using%20the%20same %20Rake%20task :) 并搜索了问题跟踪器、Reddit 和 Google-fu。但我还没有取得任何进展。

gitlab gitlab-ce gitlab-omnibus
1个回答
0
投票

显然,我在参数周围的“”处遇到了解析错误。

© www.soinside.com 2019 - 2024. All rights reserved.