# Mercurial - push pretxnchangegroup.scm hook failed

**URL:** <https://community.cloudogu.com/t/mercurial-push-pretxnchangegroup-scm-hook-failed/1204>\
**Category:** SCM-Manager Bug Reports\
**Created:** [July 27, 2023, 4:38pm UTC](https://community.cloudogu.com/t/mercurial-push-pretxnchangegroup-scm-hook-failed/1204 "2023-07-27T16:38:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielnovo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.cloudogu.com/danielnovo/32/1756_2.png) [@danielnovo](https://community.cloudogu.com/u/danielnovo)\
**Post date:** [July 27, 2023, 4:38pm UTC](https://community.cloudogu.com/t/mercurial-push-pretxnchangegroup-scm-hook-failed/1204/1 "2023-07-27T16:38:11Z")

</div>

When i try to push a changeset to remote repository is failing with the following message: pretxnchangegroup.scm hook failed

2023-07-27 17:16:34.054 [HgHookWorker-1] [7ITlEB6O718] ERROR sonia.scm.repository.spi.HgHookChangesetProvider - could not retrieve changesets  
org.javahg.internals.RuntimeIOException: Input length = 1  
at org.javahg.internals.Utils.asRuntime(Utils.java:438)  
at org.javahg.internals.Utils.decodeBytes(Utils.java:244)  
at org.javahg.internals.Utils.decodeBytes(Utils.java:224)  
at org.javahg.internals.HgInputStream.textUpTo(HgInputStream.java:430)

Caused by: java.nio.charset.MalformedInputException: Input length = 1  
at java.base/java.nio.charset.CoderResult.throwException(CoderResult.java:274)  
at java.base/java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:813)  
at org.javahg.internals.Utils.decodeBytes(Utils.java:242)  
… 37 common frames omitted  
2023-07-27 17:16:34.079 [HgHookWorker-1] [7ITlEB6O718] WARN sonia.scm.repository.hooks.DefaultHookHandler - unknown error on hook occurred  
java.lang.NullPointerException: null  
at sonia.scm.repository.api.HgHookBranchProvider.changesets(HgHookBranchProvider.java:115)  
at sonia.scm.repository.api.HgHookBranchProvider.collect(HgHookBranchProvider.java:125)  
at sonia.scm.repository.api.HgHookBranchProvider.getDeletedOrClosed(HgHookBranchProvider.java:89)  
at sonia.scm.repository.DefaultBranchDeleteProtection.protectDefaultBranch(DefaultBranchDeleteProtection.java:57)

Found this errors on logs. Not sure the reason.

- SCM-Manager version and installed package: 2.45.2

Any tips on whats causing this issue?

Thanks

---

<div class="post-metadata">

**Author:** ![eheimbuch](https://dub1.discourse-cdn.com/flex013/user_avatar/community.cloudogu.com/eheimbuch/32/18_2.png) [@eheimbuch](https://community.cloudogu.com/u/eheimbuch)\
**Post date:** [July 28, 2023, 6:52am UTC](https://community.cloudogu.com/t/mercurial-push-pretxnchangegroup-scm-hook-failed/1204/2 "2023-07-28T06:52:28Z")

</div>

Does this only occur for one repository or each hg repo on your scm-server? Seems like your push doesn’t contain a branch? What exactly are you trying to push?

---

<div class="post-metadata">

**Author:** ![danielnovo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.cloudogu.com/danielnovo/32/1756_2.png) [@danielnovo](https://community.cloudogu.com/u/danielnovo)\
**Post date:** [July 28, 2023, 8:15am UTC](https://community.cloudogu.com/t/mercurial-push-pretxnchangegroup-scm-hook-failed/1204/3 "2023-07-28T08:15:09Z")

</div>

Hi Eduard,

I’m trying to push some files to my repo. This is only happening on one of my repos. I clone this repo and try to push only one file and it works. I suspect this is being caused by one of the files.

---

<div class="post-metadata">

**Author:** ![danielnovo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.cloudogu.com/danielnovo/32/1756_2.png) [@danielnovo](https://community.cloudogu.com/u/danielnovo)\
**Post date:** [July 28, 2023, 8:37am UTC](https://community.cloudogu.com/t/mercurial-push-pretxnchangegroup-scm-hook-failed/1204/4 "2023-07-28T08:37:11Z")

</div>

Hi Eduard,

After some tests i found the issue. I was trying to push a file with accent. Filename: “test cópia.xml”

SCM Manager doesn’t support filenames with accent’s?

---

<div class="post-metadata">

**Author:** ![eheimbuch](https://dub1.discourse-cdn.com/flex013/user_avatar/community.cloudogu.com/eheimbuch/32/18_2.png) [@eheimbuch](https://community.cloudogu.com/u/eheimbuch)\
**Post date:** [August 2, 2023, 11:01am UTC](https://community.cloudogu.com/t/mercurial-push-pretxnchangegroup-scm-hook-failed/1204/5 "2023-08-02T11:01:44Z")

</div>

Hey, sorry for the late response.

Yes, this seems to be the cause. We have an similar issue on GitHub but could not fix it yet.

> <https://github.com/scm-manager/scm-manager/issues/1964>
>
> \## Issue description
> While trying to migrate existing hg repo to scm, push fail…s on remote with "remote: pretxnchangegroup.scm hook failed".
> Some repos works, some are rejected due to this issue.
> I was able to push some failing hg repos using conversion to git and back to hg and then pushing to scm.
> SCM-manager version is latest, and installation is both on Windows and on Linux, both are failing.
> Mercurial from client side was 5.9.2 or 6.0.0. No SCM proxies are set.
> 
> Log:
> 2022-02-23 14:13:05.375 \[HgHookWorker-1\] \[6ASyGjI8F2w\] ERROR sonia.scm.repository.spi.HgHookChangesetProvider - could not retrieve changesets
> org.javahg.internals.RuntimeIOException: Input length = 1
> at org.javahg.internals.Utils.asRuntime(Utils.java:438)
> at org.javahg.internals.Utils.decodeBytes(Utils.java:244)
> at org.javahg.internals.Utils.decodeBytes(Utils.java:224)
> at org.javahg.internals.HgInputStream.textUpTo(HgInputStream.java:430)
> at sonia.scm.repository.spi.javahg.AbstractChangesetCommand.createFromInputStream(AbstractChangesetCommand.java:246)
> at sonia.scm.repository.spi.javahg.AbstractChangesetCommand.readListFromStream(AbstractChangesetCommand.java:164)
> at sonia.scm.repository.spi.javahg.HgLogChangesetCommand.execute(HgLogChangesetCommand.java:65)
> at sonia.scm.repository.spi.HgHookChangesetProvider.handleRequest(HgHookChangesetProvider.java:70)
> at sonia.scm.repository.api.HgHookBranchProvider.changesets(HgHookBranchProvider.java:115)
> at sonia.scm.repository.api.HgHookBranchProvider.collect(HgHookBranchProvider.java:125)
> at sonia.scm.repository.api.HgHookBranchProvider.getDeletedOrClosed(HgHookBranchProvider.java:89)
> at sonia.scm.repository.DefaultBranchDeleteProtection.protectDefaultBranch(DefaultBranchDeleteProtection.java:57)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at com.github.legman.InvocationContext.invoke(InvocationContext.java:108)
> at com.github.legman.InvocationContext.proceed(InvocationContext.java:101)
> at com.github.legman.micrometer.MicrometerInvocationInterceptor.invoke(MicrometerInvocationInterceptor.java:47)
> at com.github.legman.InvocationContext.proceed(InvocationContext.java:99)
> at com.github.legman.EventHandler.handleEvent(EventHandler.java:103)
> at com.github.legman.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:52)
> at com.github.legman.EventBus.dispatchSynchronous(EventBus.java:452)
> at com.github.legman.EventBus.dispatch(EventBus.java:446)
> at com.github.legman.EventBus.dispatchSynchronousQueuedEvents(EventBus.java:421)
> at com.github.legman.EventBus.post(EventBus.java:333)
> at sonia.scm.event.LegmanScmEventBus.post(LegmanScmEventBus.java:92)
> at sonia.scm.repository.AbstractRepositoryManager.fireHookEvent(AbstractRepositoryManager.java:57)
> at sonia.scm.repository.spi.HookEventFacade$HookEventHandler.fireHookEvent(HookEventFacade.java:137)
> at sonia.scm.repository.hooks.DefaultHookHandler.fireHook(DefaultHookHandler.java:119)
> at sonia.scm.repository.hooks.DefaultHookHandler.handleHookRequest(DefaultHookHandler.java:105)
> at sonia.scm.repository.hooks.DefaultHookHandler.handleHookRequest(DefaultHookHandler.java:90)
> at sonia.scm.repository.hooks.DefaultHookHandler.run(DefaultHookHandler.java:77)
> at sonia.scm.repository.hooks.HookServer.lambda$associateSecurityManager$1(HookServer.java:103)
> at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
> at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
> at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> at java.base/java.lang.Thread.run(Thread.java:829)
> Caused by: java.nio.charset.MalformedInputException: Input length = 1
> at java.base/java.nio.charset.CoderResult.throwException(CoderResult.java:274)
> at java.base/java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:813)
> at org.javahg.internals.Utils.decodeBytes(Utils.java:242)
> ... 37 common frames omitted
> 2022-02-23 14:13:05.403 \[HgHookWorker-1\] \[6ASyGjI8F2w\] WARN sonia.scm.repository.hooks.DefaultHookHandler - unknown error on hook occurred
> java.lang.NullPointerException: null
> at sonia.scm.repository.api.HgHookBranchProvider.changesets(HgHookBranchProvider.java:115)
> at sonia.scm.repository.api.HgHookBranchProvider.collect(HgHookBranchProvider.java:125)
> at sonia.scm.repository.api.HgHookBranchProvider.getDeletedOrClosed(HgHookBranchProvider.java:89)
> at sonia.scm.repository.DefaultBranchDeleteProtection.protectDefaultBranch(DefaultBranchDeleteProtection.java:57)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at com.github.legman.InvocationContext.invoke(InvocationContext.java:108)
> at com.github.legman.InvocationContext.proceed(InvocationContext.java:101)
> at com.github.legman.micrometer.MicrometerInvocationInterceptor.invoke(MicrometerInvocationInterceptor.java:47)
> at com.github.legman.InvocationContext.proceed(InvocationContext.java:99)
> at com.github.legman.EventHandler.handleEvent(EventHandler.java:103)
> at com.github.legman.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:52)
> at com.github.legman.EventBus.dispatchSynchronous(EventBus.java:452)
> at com.github.legman.EventBus.dispatch(EventBus.java:446)
> at com.github.legman.EventBus.dispatchSynchronousQueuedEvents(EventBus.java:421)
> at com.github.legman.EventBus.post(EventBus.java:333)
> at sonia.scm.event.LegmanScmEventBus.post(LegmanScmEventBus.java:92)
> at sonia.scm.repository.AbstractRepositoryManager.fireHookEvent(AbstractRepositoryManager.java:57)
> at sonia.scm.repository.spi.HookEventFacade$HookEventHandler.fireHookEvent(HookEventFacade.java:137)
> at sonia.scm.repository.hooks.DefaultHookHandler.fireHook(DefaultHookHandler.java:119)
> at sonia.scm.repository.hooks.DefaultHookHandler.handleHookRequest(DefaultHookHandler.java:105)
> at sonia.scm.repository.hooks.DefaultHookHandler.handleHookRequest(DefaultHookHandler.java:90)
> at sonia.scm.repository.hooks.DefaultHookHandler.run(DefaultHookHandler.java:77)
> at sonia.scm.repository.hooks.HookServer.lambda$associateSecurityManager$1(HookServer.java:103)
> at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
> at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
> at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> at java.base/java.lang.Thread.run(Thread.java:829)
> 
> Thanks for help. Petr

---

<div class="post-metadata">

**Author:** ![eheimbuch](https://dub1.discourse-cdn.com/flex013/user_avatar/community.cloudogu.com/eheimbuch/32/18_2.png) [@eheimbuch](https://community.cloudogu.com/u/eheimbuch)\
**Post date:** [August 2, 2023, 11:06am UTC](https://community.cloudogu.com/t/mercurial-push-pretxnchangegroup-scm-hook-failed/1204/6 "2023-08-02T11:06:17Z")

</div>

Here some further information regarding that topic: [EncodingStrategy - Mercurial](https://wiki.mercurial-scm.org/EncodingStrategy)
