我有两台服务器设置(据我所知)完全相同。在其中一个上,使用 git 提交一直没问题,但是在第二个上,我开始收到此错误:
fatal: The remote end hung up unexpectedly
error: error in sideband demultiplexer
两者之间的一切都是一样的,包括 .git/hooks/post-receive 文件的内容。
我是否在某处遗漏了配置步骤?我已经尝试重新初始化 repo 两次,但无济于事。
我的post-receive文件如下:
#!/bin/sh
cd ..
env -i git reset --hard
最佳答案
在此GitHub support thread , 这种错误似乎与 repository corruption 有关某种形式。
通过重置损坏的远程仓库的头部(使用 git remote set-head )解决了这个问题。
九年多后的 2020 年 11 月更新:
使用 Git 2.30(2021 年第一季度),边带状态报告可以与主负载多路复用同时发送,但接收端的多路分解器错误地将单个状态报告分成两部分,已得到纠正.
这有助于避免来自“远程端”的错误,如 OP 中所示。
参见 commit 712b037 (2020 年 10 月 27 日)Jeff King (peff) .
参见 commit 8e86cf6 , commit 17e7dbb (2020 年 10 月 19 日)Johannes Schindelin (dscho) .
(由 Junio C Hamano -- gitster -- merge 于 commit 6b9f509,2020 年 11 月 2 日)
sideband: avoid reporting incomplete sideband messagesSigned-off-by: Johannes Schindelin
In 2b695ecd74d (t5500: count objects through stderr, not trace, 2020-05-06) we tried to ensure that the "
Total 3" message could be grepped in Git's output, even if it sometimes got chopped up into multiple lines in the trace machinery.However, the first instance where this mattered now goes through the sideband machinery, where it is still possible for messages to get chopped up: it is possible for the standard error stream to be sent byte-for-byte and hence it can be easily interrupted.
Meaning: it is possible for the single line that we're looking for to be chopped up into multiple sideband packets, with a primary packet being delivered between them.This seems to happen occasionally in the
vs-testpart of our CI builds, i.e. with binaries built using Visual C, but not when building with GCC or clang; The symptom is thatt5500.43fails to find a line matchingremote: Total 3in thelogfile, which ends in something along these lines:remote: Tota remote: l 3 (delta 0), reused 0 (delta 0), pack-reused 0This should not happen, though: we have code in
demultiplex_sideband()specifically to stitch back together lines that were delivered in separate sideband packets.However, this stitching was broken in a subtle way in fbd76cd450 ("
sideband: reverse its dependency on pkt-line", 2019-01-16, Git v2.21.0-rc0 -- merge listed in batch #5): before that change, incomplete sideband lines would not be flushed upon receiving a primary packet, but after that patch, they would be.The subtleness of this bug comes from the fact that it is easy to get confused by the ambiguous meaning of the
breakkeyword: after writing the primary packet contents, thebreak;in the original version ofrecv_sideband()does not break out of thewhileloop, but instead only ends theswitchcase:while (!retval) { [...] switch (band) { [...] case 1: /* Write the contents of the primary packet */> write_or_die(out, buf + 1, len); /* Here, we do *not* break out of the loop, `retval` is unchanged */ break; ...] } if (outbuf.len) { /* Write any remaining sideband messages lacking a trailing LF */ strbuf_addch(&outbuf, '\n'); xwrite(2, outbuf.buf, outbuf.len); }In contrast, after fbd76cd450 ("
sideband: reverse its dependency on pkt-line", 2019-01-16, Git v2.21.0-rc0 -- merge listed in batch #5), the body of thewhileloop was extracted intodemultiplex_sideband(), crucially_including_ the logic to write incomplete sideband messages:switch (band) { [...] case 1: *sideband_type = SIDEBAND_PRIMARY;> /* This does not break out of the loop: the loop is in the caller */> break; ...] } cleanup: [...] /* This logic is now no longer `_outside`_ the loop but `_inside`_ */ if (scratch->len) { strbuf_addch(scratch, '\n'); xwrite(2, scratch->buf, scratch->len); }The correct way to fix this is to return from
demultiplex_sideband()early.
The caller will then write out the contents of the primary packet and continue looping.The
scratchbuffer for incomplete sideband messages is owned by that caller, and will continue to accumulate the remainder(s) of those messages.
The loop will only end oncedemultiplex_sideband()returned non-zero and did not indicate a primary packet, which is the case only when we hit thecleanup:path, in which we take care of flushing any unfinished sideband messages and release thescratchbuffer.To ensure that this does not get broken again, we introduce a pair of subcommands of the
pkt-linetest helper that specifically chop up the sideband message and squeeze a primary packet into the middle.Final note: The other test case touched by 2b695ecd74d (t5500: count objects through stderr, not trace, 2020-05-06, Git v2.27.0-rc0) is not affected by this issue because the sideband machinery is not involved there.
关于Git 响应 'error in sideband demultiplexer',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4582849/
我正在尝试测试是否存在表单。我是Rails新手。我的new.html.erb_spec.rb文件的内容是:require'spec_helper'describe"messages/new.html.erb"doit"shouldrendertheform"dorender'/messages/new.html.erb'reponse.shouldhave_form_putting_to(@message)with_submit_buttonendendView本身,new.html.erb,有代码:当我运行rspec时,它失败了:1)messages/new.html.erbshou
我在我的项目目录中完成了compasscreate.和compassinitrails。几个问题:我已将我的.sass文件放在public/stylesheets中。这是放置它们的正确位置吗?当我运行compasswatch时,它不会自动编译这些.sass文件。我必须手动指定文件:compasswatchpublic/stylesheets/myfile.sass等。如何让它自动运行?文件ie.css、print.css和screen.css已放在stylesheets/compiled。如何在编译后不让它们重新出现的情况下删除它们?我自己编译的.sass文件编译成compiled/t
我在我的项目中添加了一个系统来重置用户密码并通过电子邮件将密码发送给他,以防他忘记密码。昨天它运行良好(当我实现它时)。当我今天尝试启动服务器时,出现以下错误。=>BootingWEBrick=>Rails3.2.1applicationstartingindevelopmentonhttp://0.0.0.0:3000=>Callwith-dtodetach=>Ctrl-CtoshutdownserverExiting/Users/vinayshenoy/.rvm/gems/ruby-1.9.3-p0/gems/actionmailer-3.2.1/lib/action_mailer
在MRIRuby中我可以这样做:deftransferinternal_server=self.init_serverpid=forkdointernal_server.runend#Maketheserverprocessrunindependently.Process.detach(pid)internal_client=self.init_client#Dootherstuffwithconnectingtointernal_server...internal_client.post('somedata')ensure#KillserverProcess.kill('KILL',
我已经从我的命令行中获得了一切,所以我可以运行rubymyfile并且它可以正常工作。但是当我尝试从sublime中运行它时,我得到了undefinedmethod`require_relative'formain:Object有人知道我的sublime设置中缺少什么吗?我正在使用OSX并安装了rvm。 最佳答案 或者,您可以只使用“require”,它应该可以正常工作。我认为“require_relative”仅适用于ruby1.9+ 关于ruby-主要:Objectwhenrun
我花了三天的时间用头撞墙,试图弄清楚为什么简单的“rake”不能通过我的规范文件。如果您遇到这种情况:任何文件夹路径中都不要有空格!。严重地。事实上,从现在开始,您命名的任何内容都没有空格。这是我的控制台输出:(在/Users/*****/Desktop/LearningRuby/learn_ruby)$rake/Users/*******/Desktop/LearningRuby/learn_ruby/00_hello/hello_spec.rb:116:in`require':cannotloadsuchfile--hello(LoadError) 最佳
我已经像这样安装了一个新的Rails项目:$railsnewsite它执行并到达:bundleinstall但是当它似乎尝试安装依赖项时我得到了这个错误Gem::Ext::BuildError:ERROR:Failedtobuildgemnativeextension./System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/rubyextconf.rbcheckingforlibkern/OSAtomic.h...yescreatingMakefilemake"DESTDIR="cleanmake"DESTDIR="
关闭。这个问题需要detailsorclarity.它目前不接受答案。想改进这个问题吗?通过editingthispost添加细节并澄清问题.关闭8年前。Improvethisquestion在首页我有:汽车:VolvoSaabMercedesAudistatic_pages_spec.rb中的测试代码:it"shouldhavetherightselect"dovisithome_pathit{shouldhave_select('cars',:options=>['volvo','saab','mercedes','audi'])}end响应是rspec./spec/request
似乎无法为此找到有效的答案。我正在阅读Rails教程的第10章第10.1.2节,但似乎无法使邮件程序预览正常工作。我发现处理错误的所有答案都与教程的不同部分相关,我假设我犯的错误正盯着我的脸。我已经完成并将教程中的代码复制/粘贴到相关文件中,但到目前为止,我还看不出我输入的内容与教程中的内容有什么区别。到目前为止,建议是在函数定义中添加或删除参数user,但这并没有解决问题。触发错误的url是http://localhost:3000/rails/mailers/user_mailer/account_activation.http://localhost:3000/rails/mai
我是Google云的新手,我正在尝试对其进行首次部署。我的第一个部署是RubyonRails项目。我基本上是在关注thisguideinthegoogleclouddocumentation.唯一的区别是我使用的是我自己的项目,而不是他们提供的“helloworld”项目。这是我的app.yaml文件runtime:customvm:trueentrypoint:bundleexecrackup-p8080-Eproductionconfig.ruresources:cpu:0.5memory_gb:1.3disk_size_gb:10当我转到我的项目目录并运行gcloudprevie