[英]SSHKit::Runner::ExecuteError on ruby 3.1.2
Hi你好
rails 7.0.3导轨 7.0.3
ruby 3.1.2红宝石 3.1.2
both servers (production / staging) and the repository are on my own linux.两个服务器(生产/登台)和存储库都在我自己的 linux 上。
manually, i can ssh into production server and ssh from there to the repository server.手动,我可以 ssh 进入生产服务器并从那里 ssh 到存储库服务器。
git clone
from the production machine also does his work (manually, for testing).生产机器上的
git clone
也完成了他的工作(手动,用于测试)。
i've done a eval "${ssh-agent}"
and ssh-add ~/.ssh/id_rsa
on the production machine which runs fine but changes nothing我在生产机器上完成了
eval "${ssh-agent}"
和ssh-add ~/.ssh/id_rsa
运行正常但没有任何改变
The Problem问题
cap staging deploy --trace
results in结果是
[...]
00:01 git:update
01 git remote set-url origin repo-get@my-server.ch:/repos/pro-cnc/cncoffice.git
✔ 01 cncoffice@my-customer.com 0.098s
02 git remote update --prune
02 Fetching origin
✔ 02 cncoffice@my-customer.com 0.268s
** Execute git:create_release
00:01 git:create_release
01 mkdir -p /srv/office/releases/20220701115330
✔ 01 cncoffice@my-customer.com 0.100s
02 git archive master | /usr/bin/env tar -x -f - -C /srv/office/releases/20220701115330
02 fatal: Not a valid object name
02 tar: This does not look like a tar archive
02 tar: Exiting with failure status due to previous errors
#<Thread:0x000000011398dc08 /Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
/Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as cncoffice@my-customer.com: git exit status: 2 (SSHKit::Runner::ExecuteError)
git stdout: Nothing written
git stderr: fatal: Not a valid object name
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
from /Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
/Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/command.rb:97:in `exit_status=': git exit status: 2 (SSHKit::Command::Failed)
git stdout: Nothing written
git stderr: fatal: Not a valid object name
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
from /Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/backends/netssh.rb:170:in `execute_command'
from /Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:148:in `block in create_command_and_execute'
from <internal:kernel>:90:in `tap'
from /Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:148:in `create_command_and_execute'
from /Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:80:in `execute'
from /Users/dev/.rvm/gems/ruby-3.1.2/gems/capistrano-3.17.0/lib/capistrano/scm/git.rb:83:in `git'
from /Users/dev/.rvm/gems/ruby-3.1.2/gems/capistrano-3.17.0/lib/capistrano/scm/git.rb:73:in `archive_to_release_path'
from /Users/dev/.rvm/gems/ruby-3.1.2/gems/capistrano-3.17.0/lib/capistrano/scm/tasks/git.rake:57:in `block (5 levels) in eval_rakefile'
from /Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:92:in `within'
from /Users/dev/.rvm/gems/ruby-3.1.2/gems/capistrano-3.17.0/lib/capistrano/scm/tasks/git.rake:55:in `block (4 levels) in eval_rakefile'
from /Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:100:in `with'
from /Users/dev/.rvm/gems/ruby-3.1.2/gems/capistrano-3.17.0/lib/capistrano/scm/tasks/git.rake:54:in `block (3 levels) in eval_rakefile'
from /Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:31:in `instance_exec'
from /Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:31:in `run'
from /Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as cncoffice@my-customer.com: git exit status: 2
git stdout: Nothing written
git stderr: fatal: Not a valid object name
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
/Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute'
/Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
Caused by:
SSHKit::Command::Failed: git exit status: 2
git stdout: Nothing written
git stderr: fatal: Not a valid object name
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
/Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/command.rb:97:in `exit_status='
/Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/backends/netssh.rb:170:in `execute_command'
/Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:148:in `block in create_command_and_execute'
<internal:kernel>:90:in `tap'
/Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:148:in `create_command_and_execute'
/Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:80:in `execute'
/Users/dev/.rvm/gems/ruby-3.1.2/gems/capistrano-3.17.0/lib/capistrano/scm/git.rb:83:in `git'
/Users/dev/.rvm/gems/ruby-3.1.2/gems/capistrano-3.17.0/lib/capistrano/scm/git.rb:73:in `archive_to_release_path'
/Users/dev/.rvm/gems/ruby-3.1.2/gems/capistrano-3.17.0/lib/capistrano/scm/tasks/git.rake:57:in `block (5 levels) in eval_rakefile'
/Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:92:in `within'
/Users/dev/.rvm/gems/ruby-3.1.2/gems/capistrano-3.17.0/lib/capistrano/scm/tasks/git.rake:55:in `block (4 levels) in eval_rakefile'
/Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:100:in `with'
/Users/dev/.rvm/gems/ruby-3.1.2/gems/capistrano-3.17.0/lib/capistrano/scm/tasks/git.rake:54:in `block (3 levels) in eval_rakefile'
/Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:31:in `instance_exec'
/Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:31:in `run'
/Users/dev/.rvm/gems/ruby-3.1.2/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => git:create_release
The deploy has failed with an error: Exception while executing as cncoffice@my-customer.com: git exit status: 2
git stdout: Nothing written
git stderr: fatal: Not a valid object name
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
** Invoke deploy:failed (first_time)
** Execute deploy:failed
** DEPLOY FAILED
** Refer to log/capistrano.log for details. Here are the last 20 lines:
DEBUG [ba3e6dbe] Command: if test ! -d /srv/office-staging/repo; then echo "Directory does not exist '/srv/office-staging/repo'" 1>&2; false; fi
DEBUG [ba3e6dbe] Finished in 0.095 seconds with exit status 0 (successful).
INFO [3174d347] Running /usr/bin/env git remote set-url origin repo-get@sedlmair.ch:/repos/pro-cnc/cncoffice.git as cncoffice@office.procnc.ch
DEBUG [3174d347] Command: cd /srv/office-staging/repo && ( export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-7f405f262ce173c371af.sh" ; /usr/bin/env git remote set-url origin repo-get@sedlmair.ch:/repos/pro-cnc/cncoffice.git )
INFO [3174d347] Finished in 0.099 seconds with exit status 0 (successful).
INFO [f60a0654] Running /usr/bin/env git remote update --prune as cncoffice@office.procnc.ch
DEBUG [f60a0654] Command: cd /srv/office-staging/repo && ( export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-7f405f262ce173c371af.sh" ; /usr/bin/env git remote update --prune )
DEBUG [f60a0654] Fetching origin
INFO [f60a0654] Finished in 0.267 seconds with exit status 0 (successful).
DEBUG [95047571] Running if test ! -d /srv/office-staging/repo; then echo "Directory does not exist '/srv/office-staging/repo'" 1>&2; false; fi as cncoffice@office.procnc.ch
DEBUG [95047571] Command: if test ! -d /srv/office-staging/repo; then echo "Directory does not exist '/srv/office-staging/repo'" 1>&2; false; fi
DEBUG [95047571] Finished in 0.099 seconds with exit status 0 (successful).
INFO [bd721b6b] Running /usr/bin/env mkdir -p /srv/office-staging/releases/20220701123555 as cncoffice@office.procnc.ch
DEBUG [bd721b6b] Command: cd /srv/office-staging/repo && ( export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-7f405f262ce173c371af.sh" ; /usr/bin/env mkdir -p /srv/office-staging/releases/20220701123555 )
INFO [bd721b6b] Finished in 0.106 seconds with exit status 0 (successful).
INFO [31b8821b] Running /usr/bin/env git archive master | /usr/bin/env tar -x -f - -C /srv/office-staging/releases/20220701123555 as cncoffice@office.procnc.ch
DEBUG [31b8821b] Command: cd /srv/office-staging/repo && ( export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-7f405f262ce173c371af.sh" ; /usr/bin/env git archive master | /usr/bin/env tar -x -f - -C /srv/office-staging/releases/20220701123555 )
DEBUG [31b8821b] fatal: Not a valid object name
DEBUG [31b8821b] tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
Thanks, Chris谢谢,克里斯
Your:您的:
git archive master
command is producing:命令正在产生:
fatal: Not a valid object name
This indicates that there's no branch named master
.这表明没有名为
master
的分支。 That's likely because either:这可能是因为:
main
, as most people do now instead of using master
.main
,就像大多数人现在所做的那样,而不是使用master
。 Check your Git repository to see whether you have any branch names at all (you don't have to have branch names, but practically nobody goes without them except in empty repositories) and if so, what they are.检查您的 Git 存储库以查看您是否有任何分支名称(您不必有分支名称,但实际上除了在空存储库中之外没有人会没有它们),如果有,它们是什么。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.