SSHKit :: Runner :: ExecuteError [英] SSHKit::Runner::ExecuteError

查看:178
本文介绍了SSHKit :: Runner :: ExecuteError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$ bundle exec cap production deploy

(回溯仅限于导入的任务)上限已终止!
SSHKit :: Runner :: ExecuteError:
as Psara @ sakura执行时发生异常:git退出状态:128 git stdout:未编写任何内容git stderr:权限被拒绝(公钥).
致命:远端意外挂起

(Backtrace restricted to imported tasks) cap aborted!
SSHKit::Runner::ExecuteError:
Exception while executing as Psara@sakura: git exit status: 128 git stdout: Nothing written git stderr: Permission denied (publickey).
fatal: The remote end hung up unexpectedly

SSHKit :: Command ::失败:
git退出状态:128
git stdout:什么都没写
git stderr:权限被拒绝(公钥).
致命:远端意外挂断

任务:TOP => git:check(通过使用--trace运行任务来查看完整跟踪) 部署失败并出现错误:
以Psara @ sakura执行时发生异常:
git退出状态:128 git stdout:没写什么
git stderr:权限被拒绝(公钥).

致命:远端意外挂起

SSHKit::Command::Failed:
git exit status: 128
git stdout:Nothing written
git stderr: Permission denied (publickey).
fatal: The remote end hung up unexpectedly

Tasks: TOP => git:check (See full trace by running task with --trace) The deploy has failed with an error:
Exception while executing as Psara@sakura:
git exit status: 128 git stdout: Nothing written
git stderr: Permission denied (publickey).

fatal: The remote end hung up unexpectedly

*

deploy.rb

set:application,'Psara'
设置:repo_url,'git@bitbucket.org:CBLaughter/psara.git'
设置:deploy_to,'/home/Psara/Psara'
设置:default_run_options,:pty => true

set :application, 'Psara'
set :repo_url, 'git@bitbucket.org:CBLaughter/psara.git'
set :deploy_to, '/home/Psara/Psara'
set :default_run_options, :pty => true

命名空间:deploy做

namespace :deploy do

在:restart,:clear_cache之后 在role(:web)上,在::groups,限制:3,等待:10做 #在这里我们可以做任何事情,例如: #在release_path中 #execute:rake,'cache:clear' # 结尾 结束

after :restart, :clear_cache do on roles(:web), in: :groups, limit: 3, wait: 10 do # Here we can do anything such as: # within release_path do # execute :rake, 'cache:clear' # end end end

结束

set:ssh_options,{forward_agent:true,偏执狂:true,键: 〜/.ssh/id_rsa"}

set :ssh_options, { forward_agent: true, paranoid: true, keys: "~/.ssh/id_rsa" }

*

production.rb

设置:stage,:staging
设置:rails_env,:production

set :stage, :staging
set :rails_env, :production

role:app,%w {sakura}
角色:网络,%w {sakura}
角色:db,%w {sakura}

role :app, %w{sakura}
role :web, %w{sakura}
role :db, %w{sakura}

服务器'sakura',用户:'Psara',角色:%w {web app},my_property:>:my_value

server 'sakura', user: 'Psara', roles: %w{web app}, my_property: >:my_value

set:ssh_options,{
键:%w(〜/.ssh/id_rsa),
forward_agent:否,}

set :ssh_options, {
keys: %w(~/.ssh/id_rsa),
forward_agent: false, }





如果您能教给我解决该问题的方法,我会很高兴.

我已经在该位存储桶上添加了公共密钥,但是它不起作用.

*

SSH代理转发报告



  1. [成功] repo_url设置正常

[成功] ssh私钥文件存在

[success] ssh private key file exists

[成功] ssh-agent进程似乎正在本地运行

[success] ssh-agent process seems to be running locally

[成功] ssh-agent进程被ssh-add命令识别

[success] ssh-agent process recognized by ssh-add command

[成功]将ssh私钥添加到ssh-agent

[success] ssh private keys added to ssh-agent

[成功]可从本地计算机访问的应用程序存储库

[success] application repository accessible from local machine

[成功]使用无密码登录的所有主机

[success] all hosts using passwordless login

[成功] forward_agent对于所有主机都可以

[success] forward_agent ok for all hosts

[成功] ssh代理成功转发到远程主机

[success] ssh agent successfully forwarded to remote hosts

[成功]可从远程主机访问的应用程序存储库

[success] application repository accessible from remote hosts


似乎SSH代理转发设置正确!你可以继续 部署过程.


It seems SSH agent forwarding is set up correctly! You can continue with the deployment process.

它在所有测试中均成功,但仍然会出现相同的错误.

推荐答案

请确保您的计算机上正在运行ssh-agent,因为您正在使用ssh转发,因此您的本地密钥应该能够访问并克隆您的存储库从bitbucket.您可以使用以下命令运行代理:

Make sure that you have ssh-agent running on your machine, because you're using ssh forwarding, your local keys should be able to access and clone your repo from bitbucket. You can run agent it with:

eval `ssh-agent`
ssh-add ~/.ssh/id_rsa

有关ssh转发的更多信息,您可以在此处查找.

More info about ssh-forwarding you can find here.

您还应该手动检查的另一件事是,您可以ssh到服务器(您的公钥应添加到服务器上的~/.ssh/authorized_keys),当然,您也可以在本地克隆存储库(可能您可以做).

Other thing you should check manually is that you can ssh to your server (your public key should be added to ~/.ssh/authorized_keys on server), and of course that you can clone your repo locally (that probably you're able to do).

更新:

现在,我意识到您已将转发用于生产,在这种情况下,您应该确保服务器上的密钥对(您必须拥有它,因为转发已关闭)可以从bitbucket复制回购,您也可以尝试在服务器上手动克隆.

Now i have realised that you turn forwarding for production, in that case you should make sure that key-pair that's on your server (you must have it, because forwarding is turned off), are able to clone repo from bitbucket, you can try cloning on server by hand too.

这篇关于SSHKit :: Runner :: ExecuteError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆