Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Stash "The remote end hung up unexpectedly"

caronma April 26, 2014

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

2 votes
Tim Long January 5, 2015

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.

Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 13, 2018

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

0 votes
Konstantin Udodenko October 15, 2014

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

0 votes
CelsoA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 27, 2014

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events