Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal server error on accessing Commits page of a Mercurial repository #1577

Closed
alexmgerasimov opened this issue Mar 9, 2021 · 5 comments · Fixed by #1583
Closed

Internal server error on accessing Commits page of a Mercurial repository #1577

alexmgerasimov opened this issue Mar 9, 2021 · 5 comments · Fixed by #1583
Assignees
Labels
enhancement New feature or request

Comments

@alexmgerasimov
Copy link

alexmgerasimov commented Mar 9, 2021

Issue description

Internal server error on accessing Commits page of a Mercurial repository on the URL:
/scm/repo/namespace/repository/code/branch/default/changesets/

This happens only with one of several Mercurial repositories. Probably something wrong with this repository, but I can't figure out what it is. All repositories are configured in similar ways.

Bug Report

Describe how to reproduce the bug

Click on the repository, than on Code, than on Commits.

Describe your SCM-Manager setup

SCM-Manager 2.14.1

Which operating system, browser and versions do you use?

Windows Server 2016

Log of the bug

[qtp1857815974-14] [7VSRACDzRd] WARN  sonia.scm.api.FallbackExceptionMapper - mapping unexpected com.aragost.javahg.internals.RuntimeIOException to status code 500
com.aragost.javahg.internals.RuntimeIOException: Input length = 1
	at com.aragost.javahg.internals.Utils.asRuntime(Utils.java:437)
	at com.aragost.javahg.internals.Utils.decodeBytes(Utils.java:243)
	at com.aragost.javahg.internals.Utils.decodeBytes(Utils.java:223)
	at com.aragost.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.HgLogCommand.collectSafely(HgLogCommand.java:228)
	at sonia.scm.repository.spi.HgLogCommand.getChangesets(HgLogCommand.java:76)
	at sonia.scm.repository.api.LogCommandBuilder.getChangesets(LogCommandBuilder.java:246)
	at sonia.scm.api.v2.resources.BranchRootResource.history(BranchRootResource.java:193)
	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 org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:170)
	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:130)
	at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:643)
	at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:507)
	at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$2(ResourceMethodInvoker.java:457)
	at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
	at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:459)
	at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:419)
	at org.jboss.resteasy.core.ResourceLocatorInvoker.invokeOnTargetObject(ResourceLocatorInvoker.java:192)
	at org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:152)
	at org.jboss.resteasy.core.ResourceLocatorInvoker.invokeOnTargetObject(ResourceLocatorInvoker.java:183)
	at org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:141)
	at org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:32)
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:492)
	at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:261)
	at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:161)
	at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
	at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:164)
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:247)
	at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:249)
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:60)
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:290)
	at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:280)
	at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:184)
	at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:89)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85)
	at sonia.scm.legacy.RepositoryLegacyProtocolRedirectFilter$Worker.noRedirect(RepositoryLegacyProtocolRedirectFilter.java:127)
	at sonia.scm.legacy.RepositoryLegacyProtocolRedirectFilter$Worker.checkPathElements(RepositoryLegacyProtocolRedirectFilter.java:100)
	at sonia.scm.legacy.RepositoryLegacyProtocolRedirectFilter$Worker.doFilter(RepositoryLegacyProtocolRedirectFilter.java:89)
	at sonia.scm.legacy.RepositoryLegacyProtocolRedirectFilter.doFilter(RepositoryLegacyProtocolRedirectFilter.java:71)
	at sonia.scm.web.filter.HttpFilter.doFilter(HttpFilter.java:93)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at sonia.scm.filter.MDCFilter.doFilter(MDCFilter.java:103)
	at sonia.scm.web.filter.HttpFilter.doFilter(HttpFilter.java:93)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at sonia.scm.web.security.TokenRefreshFilter.doFilter(TokenRefreshFilter.java:78)
	at sonia.scm.web.filter.HttpFilter.doFilter(HttpFilter.java:93)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at sonia.scm.web.filter.AuthenticationFilter.processChain(AuthenticationFilter.java:266)
	at sonia.scm.web.filter.AuthenticationFilter.handleAuthentication(AuthenticationFilter.java:225)
	at sonia.scm.web.filter.AuthenticationFilter.doFilter(AuthenticationFilter.java:109)
	at sonia.scm.web.security.ApiAuthenticationFilter.doFilter(ApiAuthenticationFilter.java:99)
	at sonia.scm.web.filter.HttpFilter.doFilter(HttpFilter.java:93)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at sonia.scm.security.TokenExpiredFilter.doFilter(TokenExpiredFilter.java:66)
	at sonia.scm.web.filter.HttpFilter.doFilter(HttpFilter.java:93)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at sonia.scm.filter.BaseUrlFilter.doFilter(BaseUrlFilter.java:109)
	at sonia.scm.web.filter.HttpFilter.doFilter(HttpFilter.java:93)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at org.apache.shiro.guice.web.SimpleFilterChain.doFilter(SimpleFilterChain.java:44)
	at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
	at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.shiro.guice.web.SimpleFilterChain.doFilter(SimpleFilterChain.java:41)
	at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
	at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.shiro.guice.web.SimpleFilterChain.doFilter(SimpleFilterChain.java:41)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:450)
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:387)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
	at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:121)
	at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:133)
	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:201)
	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:602)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1435)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1350)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.Server.handle(Server.java:516)
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:388)
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:633)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:380)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
	at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:540)
	at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:395)
	at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:161)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:773)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:905)
	at java.base/java.lang.Thread.run(Thread.java:834)
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 com.aragost.javahg.internals.Utils.decodeBytes(Utils.java:241)
	... 122 common frames omitted
@alexmgerasimov alexmgerasimov changed the title Internal server error on accessing Commits page of the Mercurial repository Internal server error on accessing Commits page of a Mercurial repository Mar 9, 2021
@sdorra sdorra self-assigned this Mar 9, 2021
@sdorra sdorra added the bug Something isn't working label Mar 9, 2021
@sdorra
Copy link
Member

sdorra commented Mar 9, 2021

It looks like a problem with encoding. Which encoding do you use on your client and on your server?

@alexmgerasimov
Copy link
Author

alexmgerasimov commented Mar 9, 2021

It's hard to say because I've just migrated the repository from other place. And this repository is quite old. It could be a mix of Windows-1251 and ASCII, but I'm not sure. Is there anything I can check specifically for you?

@sdorra
Copy link
Member

sdorra commented Mar 10, 2021

You could try to change the mercurial encoding of scm-manager to Windows-1251 at (Administration->Settings->Mercurial). This will change the encoding of all mercurial repositories.

@alexmgerasimov
Copy link
Author

alexmgerasimov commented Mar 10, 2021

I've checked your suggestion. If I specify Windows-1251 there, this page works without server error. But I feel this may impact other repositories because of the global nature of the setting. What would you suggest? How this setting is used and what kind of impact it might be?

@sdorra
Copy link
Member

sdorra commented Mar 12, 2021

You a right this settings affects all mercurial operations on all repositories. I will see if we can have a setting per repository.

@sdorra sdorra added enhancement New feature or request and removed bug Something isn't working labels Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants