【发布时间】:2021-02-18 01:09:48
【问题描述】:
我不能在我家以正常方式git push 到 Heroku。我尝试在不同的应用程序上使用不同的 ssh 密钥使用两个不同的帐户(家庭和工作)。它不是损坏的存储库,因为它可以在我的工作计算机上运行。 (事实上,我通常通过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-- 命令成功,密钥被添加到我的帐户中(显示在 heroku.com 上,我收到了电子邮件),但没有任何变化。完全重新生成密钥。同上。
使用
git remote和heroku git:remote命令删除和重新添加 githeroku存储库。 (没有变化。)调试与
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) 路由器中内置的防火墙,它设置为 not阻止任何东西。我不在代理后面。我可以从这里很好地部署到 GitHub。无论出于何种原因,我什至无法连接到 Heroku。我知道我的公钥没有被拒绝,而且它根本就没有连接,因为日志没有显示任何内容,也没有任何活动:
$ heroku logs
2014-08-02T02:12:36.883623+00:00 heroku[api]: Enable Logplex by twobitalchemist@gmail.com
更新:我已经就这个问题打开了 Heroku 工单,正在等待他们的支持部门的回复。如果他们能够解决问题,我会在这里回答。
【问题讨论】:
-
一个疯狂的猜测——降低你的 MTU。
-
另外,当你运行
ssh -vvv git@heroku.com时 tcpdump 会显示什么? -
这里的MTU和办公室一样(1500字节); tcpdump 显示了我对
ssh -vvv git@heroku.com和git push heroku master的预期,因为发生了什么——即一些介绍性的数据包交换,然后是与命令挂起相对应的一段时间的“无线电静默”,然后是一些数据包交换和断开连接. -
服务器端是否有任何可能导致挂起的内容?一个带有一些回声或一些等待输入的操作的.bashrc?当 ssh shell 的 .bashrc 不干净时,我看到了该错误。例如,一个好的测试将是 (serverfault.com/a/201158/783):
ssh -t git@heroku.com /bin/sh(或者甚至替换远程 .bashrc: superuser.com/a/503785/141) -
@VonC 希望这不是我对 Heroku 部署的控制,但我觉得这将被排除在外,因为我可以立即转身并
git push下班(通过 ssh ) 没有问题。家庭和工作之间肯定存在一些我只是想念或认为不重要的区别(事实上它很重要)。