gpt4 book ai didi

git - 不能 'git push' 到 Heroku

转载 作者:太空狗 更新时间:2023-10-29 13:11:03 27 4
gpt4 key购买 nike

我无法从家里以正常方式git push 到Heroku。我试过在不同的应用程序上使用不同的 ssh key 使用两个不同的帐户(家庭和工作)。它不是损坏的存储库,因为它可以在我的工作计算机上运行。 (事实上​​ ,我通常通过 ssh-ing 来工作并从那里进行部署来解决这个问题,但是那里断电了,所以这个周末我不能这样做!)

首先,这与许多其他类似的问题不同,主要是因为我没有得到没有错误

错误(非)消息

$ git push heroku master
Connection closed by 50.19.85.132
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

请注意,在连接关闭之前它挂起正好 60 秒并显示出来。

$ git push -v heroku master
Pushing to git@heroku.com:myherokuapp.git
Connection closed by 50.19.85.154
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我尝试过的

  • heroku keys:add -- 命令成功, key 被添加到我的帐户(显示在 heroku.com 上,我收到了电子邮件),但没有任何变化。

  • 完全重新生成 key 。同上。

  • 使用 git remoteheroku git:remote 命令删除并重新添加 git heroku 存储库。 (没有变化。)

  • 使用 ssh -vvv 调试连接。 (见下文。)

各种调试命令的输出

$ git remote -v
heroku git@heroku.com:myherokuapp.git (fetch)
heroku git@heroku.com:myherokuapp.git (push)

$ heroku apps:info
=== myherokuapp
Git URL: git@heroku.com:myherokuapp.git
Owner Email: twobitalchemist@gmail.com
Region: us
Stack: cedar
Web URL: http://myherokuapp.herokuapp.com/

$ ping -c4 50.19.85.132
PING 50.19.85.132 (50.19.85.132) 56(84) bytes of data.
64 bytes from 50.19.85.132: icmp_seq=1 ttl=37 time=48.9 ms
64 bytes from 50.19.85.132: icmp_seq=2 ttl=37 time=49.1 ms
64 bytes from 50.19.85.132: icmp_seq=3 ttl=37 time=47.9 ms
64 bytes from 50.19.85.132: icmp_seq=4 ttl=37 time=49.2 ms

--- 50.19.85.132 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 47.997/48.832/49.245/0.498 ms

$ ping -c4 50.19.85.154
PING 50.19.85.154 (50.19.85.154) 56(84) bytes of data.
64 bytes from 50.19.85.154: icmp_seq=1 ttl=41 time=47.8 ms
64 bytes from 50.19.85.154: icmp_seq=2 ttl=41 time=47.7 ms
64 bytes from 50.19.85.154: icmp_seq=3 ttl=41 time=49.7 ms
64 bytes from 50.19.85.154: icmp_seq=4 ttl=41 time=50.0 ms

--- 50.19.85.154 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 47.746/48.855/50.055/1.059 ms

$ ssh -vvv git@heroku.com
OpenSSH_6.6.1, OpenSSL 1.0.1h 5 Jun 2014
debug1: Reading configuration data /home/user/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to heroku.com [50.19.85.132] port 22.
debug1: Connection established.
[ several lines ommitted ]
debug1: Offering ECDSA public key: /home/user/.ssh/id_ecdsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
[ hangs here ]
Connection closed by 50.19.85.132

附加信息

我正在使用 Arch Linux,在我工作时使用的同一个 ISP 上(虽然在工作中我们有一个静态 IP),并且我没有防火墙,除了我家 (Netgear) 路由器中内置的任何东西,它没有设置阻止任何东西。我不在代理后面。我可以从这里很好地部署到 GitHub。无论出于何种原因,我什至无法连接到 Heroku。我知道我的公钥没有被拒绝,而且它一开始就没有连接,因为日志没有显示任何内容,也没有任何事件:

$ heroku logs
2014-08-02T02:12:36.883623+00:00 heroku[api]: Enable Logplex by twobitalchemist@gmail.com

更新:我已经就此问题开了一张 Heroku 工单,正在等待他们支持人员的回复。如果他们能够解决问题,我会在这里回答。

最佳答案

看起来这可能是您的安全证书的问题。 Heroku 不支持 ECDSA key ,per their documentation .我会创建一个新的 RSA SSH key ,您将它用于 heroku,并且只用于 heroku,将新的公钥发送给他们,然后设置一个 ssh 配置文件,以便在 SSH 访问 heroku.com 时提供该 key 。

这是我笔记本电脑上的 ~/.ssh/config 文件中的内容:

Host heroku.com
IdentityFile /Users/danielrice/.ssh/identity.heroku.danielricecodes
IdentitiesOnly yes

关于git - 不能 'git push' 到 Heroku,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25096956/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com