Fix 'fatal: the remote end hung up unexpectedly' error when pushing changes after Bitbucket Data Center upgrade

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Learn to resolve the error "fatal: the remote end hung up unexpectedly" that occurs in the terminal when users attempt to push to repositories after upgrading Bitbucket Data Center from version 7.21.X to 9.X.

Environment

Tested in Bitbucket Data Center 9.4.2

Diagnosis

When attempting to push to any repositories, it returns the error "fatal: the remote end hung up unexpectedly:"

git push Enumerating objects: 5, done. Counting objects: 100% (5/5), done. Delta compression using up to 12 threads Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 319 bytes | 319.00 KiB/s, done. Total 3 (delta 2), reused 0 (delta 0) fatal: the remote end hung up unexpectedly fatal: the remote end hung up unexpectedly

The atlassian-bitbucket.log will have the following error:

2025-02-12 12:43:29,054 DEBUG [ssh-scm-request-handler] user1 @WO0X3Rx1269x13622x0 12lnilk 10.255.XX.XX SSH - git-receive-pack '/pro1/repo5.git' c.a.s.i.user.DefaultUserServic e user1: User is active; updating cache 2025-02-12 12:43:29,106 DEBUG [sshd-DrainableSshServer[552d4547](port=7999)-nio2-thread-4] 12lnilk 10.255.XX.XX SSH - git-receive-pack '/pro1/repo5.git' c.a.s.i.s.g.p.ssh.SshStdinHandler EOF has been signaled, with no further stdin to read 2025-02-12 12:43:29,301 DEBUG [ssh-scm-request-handler] user1 @WO0X3Rx1269x13622x0 12lnilk 10.255.XX.XX SSH - git-receive-pack '/pro1/repo5.git' c.a.s.i.s.g.p.s.SshCommandExitHandler git receive-pack /var/atlassian/application-data/bitbucket/shared/data/repositories/345: (Exit code: -1001) 2025-02-12 12:43:29,304 DEBUG [ssh-scm-request-handler] user1 @WO0X3Rx1269x13622x0 12lnilk 10.255.XX.XX SSH - git-receive-pack '/pro1/repo5.git' c.a.s.i.s.g.p.s.SshCommandExit Handler git receive-pack /var/atlassian/application-data/bitbucket/shared/data/repositories/345: Threw the following exception: io.grpc.StatusRuntimeException: CANCELLED: Failed to read message. at io.grpc.Status.asRuntimeException(Status.java:533) at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:481) at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39) at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) at com.atlassian.stash.internal.scm.git.mesh.LastSeenClientInterceptor$LastSeenClientListener.onClose(LastSeenClientInterceptor.java:40) at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39) at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) at com.atlassian.stash.internal.scm.git.mesh.StatefulClientCallListener.onClose(StatefulClientCallListener.java:34) at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39) at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) at com.atlassian.stash.internal.scm.git.mesh.DeadlinePropagatingClientInterceptor$DeadlinePropagatingListener.onClose(DeadlinePropagatingClientInterceptor.java:156) at com.atlassian.stash.internal.scm.git.mesh.ErrorHandlingClientInterceptor$ErrorHandlingCall$1.onClose(ErrorHandlingClientInterceptor.java:149) at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:564) at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:72) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:729) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:710) at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.lang.Thread.run(Thread.java:840) ... 1 frame trimmed Caused by: java.lang.NoSuchMethodError: 'com.atlassian.bitbucket.scm.Command com.atlassian.bitbucket.scm.ScmCommandFactory.heads(com.atlassian.bitbucket.repository.RefCallback)' at org.christiangalsterer.stash.filehooks.plugin.hook.ChangesetServiceImpl.getExistingRefs(ChangesetServiceImpl.java:93) at org.christiangalsterer.stash.filehooks.plugin.hook.ChangesetServiceImpl.getCommitsBetween(ChangesetServiceImpl.java:78) at org.christiangalsterer.stash.filehooks.plugin.hook.FileSizeHook.preUpdate(FileSizeHook.java:109) at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService.preUpdate(DefaultRepositoryHookService.java:844) at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService.lambda$preUpdate$3(DefaultRepositoryHookService.java:392) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService.preUpdate(DefaultRepositoryHookService.java:371) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at jdk.internal.reflect.GeneratedMethodAccessor204.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at jdk.proxy3/jdk.proxy3.$Proxy356.preUpdate(Unknown Source) at com.atlassian.stash.internal.scm.git.mesh.BidirectionalHostingWriteFragmentResponseObserver.lambda$runPreReceiveHooks$2(BidirectionalHostingWriteFragmentResponseObserver.java:149) at com.atlassian.stash.internal.scm.git.mesh.DefaultGitRequestHelper.withQuarantine(DefaultGitRequestHelper.java:228) at com.atlassian.stash.internal.scm.git.mesh.BidirectionalHostingWriteFragmentResponseObserver.runPreReceiveHooks(BidirectionalHostingWriteFragmentResponseObserver.java:144) at com.atlassian.stash.internal.scm.git.mesh.BidirectionalHostingWriteFragmentResponseObserver.onNext(BidirectionalHostingWriteFragmentResponseObserver.java:84) at com.atlassian.stash.internal.scm.git.mesh.BidirectionalHostingWriteFragmentResponseObserver.onNext(BidirectionalHostingWriteFragmentResponseObserver.java:36) at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onMessage(ClientCalls.java:468) at io.grpc.ForwardingClientCallListener.onMessage(ForwardingClientCallListener.java:33) at io.grpc.ForwardingClientCallListener.onMessage(ForwardingClientCallListener.java:33) at com.atlassian.stash.internal.scm.git.mesh.StatefulClientCallListener.onMessage(StatefulClientCallListener.java:45) at io.grpc.ForwardingClientCallListener.onMessage(ForwardingClientCallListener.java:33) at com.atlassian.stash.internal.scm.git.mesh.DeadlinePropagatingClientInterceptor$DeadlinePropagatingListener.onMessage(DeadlinePropagatingClientInterceptor.java:169) at io.grpc.ForwardingClientCallListener.onMessage(ForwardingClientCallListener.java:33) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable.runInternal(ClientCallImpl.java:657) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable.runInContext(ClientCallImpl.java:644) ... 5 common frames omitted

Cause

An installed app is incompatible with the new Bitbucket version

The issue is caused by an unsupported third-party app, File Hooks Plugin. It’s possible that this app was working with Bitbucket version 7.21.7, but is no longer compatible with Bitbucket latest versions of Bitbucket, such as 9.4, and hence the problem started after the Bitbucket upgrade.

Solution

Disable the File Hooks Plugin via Settings > Manage Apps, and then attempt the push again.

Updated on June 17, 2025

Still need help?

The Atlassian Community is here for you.