It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Stash "The remote end hung up unexpectedly"

I'm recently not able to push into one remote stash repository.

I have 10 repositories on the server and all others are working fine.

I checked the repository with git fsck and it seems to be ok.

Using a windows server (2008r2) with latest stash and msysgit 1.9.2 on server and client side.
I also tried increasing the http.postBuffer to 512mb.

I get the following errors on client side:

git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags origin master:master
POST git-receive-pack (13411325 bytes)

fatal: The remote end hung up unexpectedly

fatal: The remote end hung up unexpectedly


error: RPC failed; result=56, HTTP code = 0

Pushing to https://xxxxxx@domain.de/stash/scm/p/dev.git

Everything up-to-date

And on the server side:

2014-04-27 12:49:05,120 DEBUG [http-bio-7990-exec-7] XXXX 766x1803x0 1y1ndk7 178.82.197.84:2349,[::1]:59732,0:0:0:0:0:0:0:1 "POST /scm/p/dev.git/git-receive-pack HTTP/1.1" com.atlassian.stash.scm.BaseCommand Executed C:\Program Files (x86)\Git\cmd\git.exe http-backend

2014-04-27 12:49:05,120 ERROR [http-bio-7990-exec-7] XXXX 766x1803x0 1y1ndk7 178.82.197.84:2349,[::1]:59732,0:0:0:0:0:0:0:1 "POST /scm/p/dev.git/git-receive-pack HTTP/1.1" c.a.s.i.s.g.p.h.GitSmartExitHandler Request for repo 'dev' of project 'p' from 'XXXXXXX' failed: write process 'C:\Program Files (x86)\Git\cmd\git.exe http-backend ' caused an exception

2014-04-27 12:49:05,128 DEBUG [http-bio-7990-exec-7] XXXX 766x1803x0 1y1ndk7 178.82.197.84:2349,[::1]:59732,0:0:0:0:0:0:0:1 "POST /scm/p/dev.git/git-receive-pack HTTP/1.1" c.a.s.i.s.g.p.h.GitSmartExitHandler process error:
com.atlassian.utils.process.ProcessException: java.lang.RuntimeException: Failed to copy request input stream to SCM hosting process input.
at com.atlassian.utils.process.ExternalProcessImpl.handleHandlerError(ExternalProcessImpl.java:476) ~[atlassian-processutils-1.6.0-m1.jar:na]
at com.atlassian.utils.process.ExternalProcessImpl.access$100(ExternalProcessImpl.java:18) ~[atlassian-processutils-1.6.0-m1.jar:na]
at com.atlassian.utils.process.ExternalProcessImpl$AbstractHandlerRunnable.onError(ExternalProcessImpl.java:684) ~[atlassian-processutils-1.6.0-m1.jar:na]
at com.atlassian.utils.process.ExternalProcessImpl$InputHandlerRunnable.onError(ExternalProcessImpl.java:743) ~[atlassian-processutils-1.6.0-m1.jar:na]
at com.atlassian.utils.process.ExternalProcessImpl$AbstractHandlerRunnable.doTask(ExternalProcessImpl.java:679) ~[atlassian-processutils-1.6.0-m1.jar:na]
at com.atlassian.utils.process.LatchedRunnable.run(LatchedRunnable.java:158) ~[atlassian-processutils-1.6.0-m1.jar:na]
at com.atlassian.stash.internal.concurrent.StateTransferringExecutor$StateTransferringRunnable.run(StateTransferringExecutor.java:69) ~[stash-platform-2.12.0.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) ~[na:1.7.0_51]
at java.lang.Thread.run(Thread.java:744) ~[na:1.7.0_51]
... 1 frame trimmed
Caused by: java.lang.RuntimeException: Failed to copy request input stream to SCM hosting process input.
at com.atlassian.stash.web.cgi.CgiInputHandler.process(CgiInputHandler.java:30) ~[stash-scm-common-2.12.0.jar:na]
at com.atlassian.stash.scm.SummarizingProcessHandler$DelegatingOutputStreamHandler.process(SummarizingProcessHandler.java:216) ~[stash-spi-2.12.0.jar:na]
at com.atlassian.stash.scm.SummarizingProcessHandler.provideInput(SummarizingProcessHandler.java:96) ~[stash-spi-2.12.0.jar:na]
at com.atlassian.utils.process.ExternalProcessImpl$InputHandlerRunnable.process(ExternalProcessImpl.java:749) ~[atlassian-processutils-1.6.0-m1.jar:na]
at com.atlassian.utils.process.ExternalProcessImpl$AbstractHandlerRunnable.doTask(ExternalProcessImpl.java:677) ~[atlassian-processutils-1.6.0-m1.jar:na]
... 5 common frames omitted
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:196) ~[na:1.7.0_51]
at java.net.SocketInputStream.read(SocketInputStream.java:122) ~[na:1.7.0_51]
at com.atlassian.stash.web.cgi.BaseCgiHandler.copyStream(BaseCgiHandler.java:35) ~[stash-scm-common-2.12.0.jar:na]
at com.atlassian.stash.web.cgi.CgiInputHandler.process(CgiInputHandler.java:28) ~[stash-scm-common-2.12.0.jar:na]
... 9 common frames omitted

Any ideas on this?

3 answers

It's kind of late, but for anyone else stumbling across this question, try entering this in your Git shell:

git config --global http.postBuffer 524288000

The reason this works is when remote requests exceed a certain size threshold, the Git client tries to use chunked-transfer encoding. Some web servers (IIS, NginX) aren't configured to allow that by default. The threshold is set quite small by default; this sets the threshold to a huge value so it should never become an issue.

Thanks a million, @Tim Long, it solved it for me.

Hi there,

Do you have any proxy between Stash and the client? (like apache)

If yes, are you able to try bypassing the proxy using ip:port?

Also, could you please do a test pushing content using ssh+git and let me know how these tests go?

Regards,

Celso Yoshioka

Hi!
I have the same problem. Connects directly host:port of Stash.
When I connect to git+ssh everything worked perfectly.
Please help.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Agile

Webinar: Dean Leffingwell and Steve Elliot present on SAFe 5.0, come ask Dean and Steve questions!

...steemed Steve Elliot (head of product for Jira Align). Agenda: What’s new or changed in SAFe 5.0: Introduction of OKRs Essential SAFe How to achieve true business a...

130 views 0 1
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you