Details
-
Bug
-
Resolution: Fixed
-
High
-
7.5.0
-
2
-
Severity 2 - Major
-
43
-
Description
Issue Summary
Pushing large files through http(s) results in remote hang up unexpectedly. A reverse proxy is present with correct limits such as "client_max_body_size" = 1024m
Steps to Reproduce
- Using reverse proxy (nginx) - set client_body_max_size 1024M
- Push a file larger than 2MB to Bitbucket Server
Expected Results
Push succeeds
Actual Results
Push fails with client side exception:
POST git-receive-pack (2535946 bytes) fatal: the remote end hung up unexpectedly fatal: the remote end hung up unexpectedly
The below exception is thrown in the xxxxxxx.log file:
2020-08-18 12:44:33,735 DEBUG [http-scmrequest-handler:thread-8] *user* *sessionID* "POST /scm/project/repo.git/git-receive-pack HTTP/1.0" c.a.b.i.p.nu.NioNuProcessHandler [/usr/bin/git -c core.hooksPath=hooks http-backend]: Dropping callback invocation (Canceled: false; Timed out: false) java.io.UncheckedIOException: java.net.SocketTimeoutException at com.atlassian.stash.internal.scm.git.protocol.http.CgiStdinHandler.onStdinReady(CgiStdinHandler.java:111) at com.atlassian.bitbucket.internal.process.CompositeNioStdioHandler.onStdinReady(CompositeNioStdioHandler.java:156) at com.atlassian.bitbucket.internal.process.nu.NioNuProcessHandler.lambda$onStdinReady$1(NioNuProcessHandler.java:170) at com.atlassian.bitbucket.internal.process.nu.NioNuProcessHandler.invokeCallback(NioNuProcessHandler.java:379) at com.atlassian.bitbucket.internal.process.nu.NioNuProcessHandler.onStdinReady(NioNuProcessHandler.java:165) at com.zaxxer.nuprocess.internal.BasePosixProcess.writeStdin(BasePosixProcess.java:490) at com.zaxxer.nuprocess.linux.ProcessEpoll.process(ProcessEpoll.java:251) at com.zaxxer.nuprocess.internal.BaseEventProcessor.run(BaseEventProcessor.java:81) at com.zaxxer.nuprocess.linux.ProcessEpoll.run(ProcessEpoll.java:188) at com.zaxxer.nuprocess.linux.LinuxProcess.run(LinuxProcess.java:114) at com.zaxxer.nuprocess.linux.LinProcessFactory.runProcess(LinProcessFactory.java:50) at com.zaxxer.nuprocess.NuProcessBuilder.run(NuProcessBuilder.java:273) at com.atlassian.bitbucket.internal.process.nu.NuNioProcessHelper.run(NuNioProcessHelper.java:75) at com.atlassian.bitbucket.internal.process.NioCommand.call(NioCommand.java:52) at com.atlassian.stash.internal.scm.git.protocol.http.GitSmartRequest.handleRequest(GitSmartRequest.java:81) at com.atlassian.stash.internal.scm.git.protocol.http.GitSmartWriteRequest.handleRequest(GitSmartWriteRequest.java:36) at com.atlassian.stash.internal.scm.git.protocol.http.HttpReceivePack.handleRequest(HttpReceivePack.java:57) at com.atlassian.stash.internal.scm.ThrottledScmRequestFactory$AbstractThrottledScmRequest.handleRequest(ThrottledScmRequestFactory.java:62) at com.atlassian.stash.internal.scm.DefaultHttpScmRequestExecutor.runSync(DefaultHttpScmRequestExecutor.java:172) at com.atlassian.stash.internal.scm.DefaultHttpScmRequestExecutor.access$200(DefaultHttpScmRequestExecutor.java:47) at com.atlassian.stash.internal.scm.DefaultHttpScmRequestExecutor$ScmAsyncRequest.run(DefaultHttpScmRequestExecutor.java:356) at com.atlassian.stash.internal.request.DefaultRequestManager.lambda$wrapForAsync$0(DefaultRequestManager.java:157) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.lang.Thread.run(Thread.java:748) ... 1 frame trimmed Caused by: java.net.SocketTimeoutException: null at org.apache.tomcat.util.net.NioEndpoint$Poller.timeout(NioEndpoint.java:974) ... 2 common frames omitted
Workaround
- Use ssh or,
- Setting either:
plugin.bitbucket-git.hosting.nio.http=false
or
http.scmrequest.async.enabled=false
in bitbucket.properties allows the push to complete.