如何修复“数据包写入等待:Git中出现“连接到...管道断开”错误

2w3kk1z5  于 2022-11-27  发布在  Git
关注(0)|答案(4)|浏览(204)

当我将文件git push到我的远程存储库时,它抛出错误“packet_write_wait:连接到13.250.177.223端口22:管道中断'?在git push之前,我已经成功地从远程和git addgit commit克隆了项目。
我试过git pullgit config http.postBuffer 52428800,但是不起作用。

HP@EverChan MINGW32 /d/ChromeDownload/jiaoben5049/meetingDemo (master)
$ git pull
packet_write_wait: Connection to 52.74.223.119 port 22: Broken pipe
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
HP@EverChan MINGW32 /d/ChromeDownload/jiaoben5049/meetingDemo (master)
$ git config http.postBuffer 52428800
HP@EverChan MINGW32 /d/ChromeDownload/jiaoben5049/meetingDemo (master)
$ git push -u origin master
Counting objects: 46, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (46/46), done.
packet_write_wait: Connection to 13.250.177.223 port 22: Broken pipe
Writing foabjecttals:   8:% The  (4/4remote end hung up u6nex)pectedly
fatal: sha1 file '<stdout>' write error: Broken pipe
fatal: The remote end hung up unexpectedly
HP@EverChan MINGW32 /d/ChromeDownload/jiaoben5049/meetingDemo (master)
$ git push -u origin master
packet_write_wait: Connection to 13.250.177.223 port 22: Broken pipe
fatal: Could not read from remote repository.

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

sauutmhj1#

在将我的repo推送到github的上下文中,对我起作用的是将 IPQoS=throughput 添加到我的配置文件~/.ssh/config中。

13z8s7eq

13z8s7eq2#

确保远程源的SSH URL正常工作:

ssh -T yourServer

其IP地址不应更改。
查看latest Git for WindowsPortableGit-2.20.1-64-bit.7z.exe)是否仍存在此问题,在C:\Git中解压缩,并在CMD会话中设置simplified PATH.

set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%PATH%

注意:您可以看到packet_write()失败的错误消息。
之前,我们给出了一个不必要的额外错误信息,该错误信息已在Git 2.32(Q2 2021)中得到纠正。
2021年4月15日,Matheus Tavares ( matheustavares )发布了commit 332ec96
(2021年4月30日,由Junio C Hamano -- gitster --合并至commit 279a2e6
我的天啊!不报告两次数据包写入错误
签署人:马休斯·塔瓦雷斯
发生write()错误时,packet_write()会终止,并显示其被调用方packet_write_gently()已经打印的相同错误消息。
这会产生不必要的冗长和重复输出:

error: packet write failed 
fatal: packet write failed: <strerror() message>

除此之外,packet_write_gently()并不总是满足其调用者的期望,即在非零返回之前正确地设置errno。
特别是“数据超过最大数据包大小”错误就不是这种情况。
因此,在这种情况下,packet_write()将调用die_errno()并打印一条可能与实际错误完全无关的strerror(errno)消息。
通过将packet_write()packet_write_gently()转换为一个通用的较低级别函数的 Package 器来解决这两个问题,该函数不打印错误消息,而是将其返回到die()error()的调用者的缓冲区中。

dwbf0jvd

dwbf0jvd3#

这对我帮助很大,试试这个:

git config --global --add safe.directory /var/www/html/Your_Project_Folder
qacovj5a

qacovj5a4#

对于gitlab/github,添加到客户端ssh_config:

Host *
IPQoS throughput                                                                                                                            
TCPKeepAlive yes

请参阅此处:https://gitlab.com/gitlab-com/gl-infra/reliability/-/issues/4849

相关问题