Mercurial HG Cannot access non-ANSI files from web interface.

Issue #921 new
Zipher
created an issue

Hello,

When I want to access non-ANSI filename in Mercurial web page -> browse, the filename will be encoded in the URL but there will be a HTTP 404 error reported by Jetty.

The attachment is a repo which contains a Chinese filename. The repo encoding and Config -> Repository Types -> Mercurial Settings -> Encoding is set to big5. And the Chinese filename should be displayed as "新文字文件.txt".

I also try to host the repo by hg serve from the python version of hg. And the file can be opened.

My guess is there maybe something wrong in the jetty for non-ANSI URL. Any help will be appreciated.

Comments (12)

  1. Ángel L. García

    Hi Zipher.

    I've tested your repository and I've got the same error. I've tried Web application archive in Tomcat 8.5.20 and standalone application. The error trace in standalone application is:

    2017-08-10 20:02:50.369 [qtp991505714-29] ERROR sonia.scm.web.HgCGIExceptionHandler - not able to handle mercurial request
    java.io.IOException: Closed
            at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:140)
            at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:107)
            at com.google.common.io.ByteStreams.copy(ByteStreams.java:173)
            at sonia.scm.web.cgi.DefaultCGIExecutor.execute(DefaultCGIExecutor.java:407)
            at sonia.scm.web.cgi.DefaultCGIExecutor.execute(DefaultCGIExecutor.java:194)
            at sonia.scm.web.HgCGIServlet.process(HgCGIServlet.java:294)
            at sonia.scm.web.HgCGIServlet.handleRequest(HgCGIServlet.java:210)
            at sonia.scm.web.HgCGIServlet.service(HgCGIServlet.java:179)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
            at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)
            at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)
            at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at sonia.scm.web.filter.PermissionFilter.doFilter(PermissionFilter.java:168)
            at sonia.scm.web.filter.HttpFilter.doFilter(HttpFilter.java:102)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at sonia.scm.web.filter.BasicAuthenticationFilter.processRequest(BasicAuthenticationFilter.java:423)
            at sonia.scm.web.filter.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:214)
            at sonia.scm.web.filter.HttpFilter.doFilter(HttpFilter.java:102)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at sonia.scm.filter.MDCFilter.doFilter(MDCFilter.java:110)
            at sonia.scm.web.filter.HttpFilter.doFilter(HttpFilter.java:102)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at sonia.scm.web.filter.AutoLoginFilter.doFilter(AutoLoginFilter.java:87)
            at sonia.scm.web.filter.HttpFilter.doFilter(HttpFilter.java:102)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at sonia.scm.filter.BaseUrlFilter.doFilter(BaseUrlFilter.java:117)
            at sonia.scm.web.filter.HttpFilter.doFilter(HttpFilter.java:102)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
            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:383)
            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.FilterDefinition.doFilter(FilterDefinition.java:163)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
            at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
            at sonia.scm.boot.BootstrapFilter.doFilter(BootstrapFilter.java:119)
            at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1288)
            at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:443)
            at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
            at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:556)
            at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
            at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1044)
            at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:372)
            at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
            at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:978)
            at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
            at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
            at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
            at org.eclipse.jetty.server.Server.handle(Server.java:369)
            at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:464)
            at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:913)
            at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:975)
            at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:641)
            at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:231)
            at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
            at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
            at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
            at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
            at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
            at java.lang.Thread.run(Thread.java:748)
    2017-08-10 20:02:50.371:WARN:oejs.ServletHandler:
    javax.servlet.ServletException: Filtered request failed.
            at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:384)
            at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
            at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
            at sonia.scm.boot.BootstrapFilter.doFilter(BootstrapFilter.java:119)
            at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1288)
            at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:443)
            at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
            at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:556)
            at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
            at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1044)
            at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:372)
            at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
            at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:978)
            at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
            at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
            at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
            at org.eclipse.jetty.server.Server.handle(Server.java:369)
            at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:464)
            at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:913)
            at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:975)
            at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:641)
            at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:231)
            at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
            at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
            at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
            at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
            at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
            at java.lang.Thread.run(Thread.java:748)
    Caused by: 
    java.lang.IllegalStateException: STREAM
            at org.eclipse.jetty.server.Response.getWriter(Response.java:704)
            at sonia.scm.web.HgCGIExceptionHandler.sendError(HgCGIExceptionHandler.java:210)
            at sonia.scm.web.HgCGIExceptionHandler.handleException(HgCGIExceptionHandler.java:125)
            at sonia.scm.web.cgi.DefaultCGIExecutor.execute(DefaultCGIExecutor.java:198)
            at sonia.scm.web.HgCGIServlet.process(HgCGIServlet.java:294)
            at sonia.scm.web.HgCGIServlet.handleRequest(HgCGIServlet.java:210)
            at sonia.scm.web.HgCGIServlet.service(HgCGIServlet.java:179)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
            at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)
            at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)
            at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at sonia.scm.web.filter.PermissionFilter.doFilter(PermissionFilter.java:168)
            at sonia.scm.web.filter.HttpFilter.doFilter(HttpFilter.java:102)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at sonia.scm.web.filter.BasicAuthenticationFilter.processRequest(BasicAuthenticationFilter.java:423)
            at sonia.scm.web.filter.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:214)
            at sonia.scm.web.filter.HttpFilter.doFilter(HttpFilter.java:102)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at sonia.scm.filter.MDCFilter.doFilter(MDCFilter.java:110)
            at sonia.scm.web.filter.HttpFilter.doFilter(HttpFilter.java:102)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at sonia.scm.web.filter.AutoLoginFilter.doFilter(AutoLoginFilter.java:87)
            at sonia.scm.web.filter.HttpFilter.doFilter(HttpFilter.java:102)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at sonia.scm.filter.BaseUrlFilter.doFilter(BaseUrlFilter.java:117)
            at sonia.scm.web.filter.HttpFilter.doFilter(HttpFilter.java:102)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
            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:383)
            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.FilterDefinition.doFilter(FilterDefinition.java:163)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
            at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
            at sonia.scm.boot.BootstrapFilter.doFilter(BootstrapFilter.java:119)
            at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1288)
            at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:443)
            at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
            at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:556)
            at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
            at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1044)
            at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:372)
            at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
            at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:978)
            at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
            at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
            at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
            at org.eclipse.jetty.server.Server.handle(Server.java:369)
            at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:464)
            at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:913)
            at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:975)
            at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:641)
            at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:231)
            at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
            at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
            at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
            at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
            at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
            at java.lang.Thread.run(Thread.java:748)
    2017-08-10 20:02:50.377:WARN:oejs.ServletHandler:/scm/hg/NonANSI/file/tip/%B7s%A4%E5%A6r%A4%E5%A5%F3.txt
    java.lang.IllegalStateException: STREAM
            at org.eclipse.jetty.server.Response.getWriter(Response.java:704)
            at sonia.scm.web.HgCGIExceptionHandler.sendError(HgCGIExceptionHandler.java:210)
            at sonia.scm.web.HgCGIExceptionHandler.handleException(HgCGIExceptionHandler.java:125)
            at sonia.scm.web.cgi.DefaultCGIExecutor.execute(DefaultCGIExecutor.java:198)
            at sonia.scm.web.HgCGIServlet.process(HgCGIServlet.java:294)
            at sonia.scm.web.HgCGIServlet.handleRequest(HgCGIServlet.java:210)
            at sonia.scm.web.HgCGIServlet.service(HgCGIServlet.java:179)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
            at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)
            at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)
            at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at sonia.scm.web.filter.PermissionFilter.doFilter(PermissionFilter.java:168)
            at sonia.scm.web.filter.HttpFilter.doFilter(HttpFilter.java:102)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at sonia.scm.web.filter.BasicAuthenticationFilter.processRequest(BasicAuthenticationFilter.java:423)
            at sonia.scm.web.filter.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:214)
            at sonia.scm.web.filter.HttpFilter.doFilter(HttpFilter.java:102)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at sonia.scm.filter.MDCFilter.doFilter(MDCFilter.java:110)
            at sonia.scm.web.filter.HttpFilter.doFilter(HttpFilter.java:102)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at sonia.scm.web.filter.AutoLoginFilter.doFilter(AutoLoginFilter.java:87)
            at sonia.scm.web.filter.HttpFilter.doFilter(HttpFilter.java:102)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at sonia.scm.filter.BaseUrlFilter.doFilter(BaseUrlFilter.java:117)
            at sonia.scm.web.filter.HttpFilter.doFilter(HttpFilter.java:102)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
            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:383)
            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.FilterDefinition.doFilter(FilterDefinition.java:163)
            at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
            at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
            at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
            at sonia.scm.boot.BootstrapFilter.doFilter(BootstrapFilter.java:119)
            at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1288)
            at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:443)
            at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
            at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:556)
            at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
            at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1044)
            at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:372)
            at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
            at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:978)
            at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
            at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
            at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
            at org.eclipse.jetty.server.Server.handle(Server.java:369)
            at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:464)
            at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:913)
            at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:975)
            at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:641)
            at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:231)
            at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
            at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
            at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
            at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
            at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
            at java.lang.Thread.run(Thread.java:748)
    

    And the error trace in Tomcat is:

    127.0.0.1 - - [10/Aug/2017:21:10:39 +0200] "GET /scm/hg/NonANSI/file/tip/%B7s%A4%E5%A6r%A4%E5%A5%F3.txt HTTP/1.1" 404 967

    You can access to non-ANSI filename by clicking in Source link:

    scm1.png

    Then click in file name:

    scm2.png

    And you'll get the file content:

    scm3.png

    Best regards.

  2. Ángel L. García

    Hi Zipher.

    I've created a new repository from scratch instead of use your 7z file and I can access non-ANSI files from web interface. Maybe you have a problem in your repository.

    1.png

    2.png

    3.png

    Steps:

    1. Create a new repository, Don't change encoding.
    2. Clone the repository in local folder.
    3. Add 新文字文件.txt file to local repository, commit the change and push to remote repository.
    4. Browse the remote repository. You'll can access it from web interface.

    Cheers.

  3. Zipher reporter

    Hello Ángel,

    Thank you for looking into this issue. I tried the method you provided, leaving the encoding in hg repo to be "<unspecified>" in tortoiseHg. But the "新文字文件.txt" is still encoded as the wrong %B7s%A4%E5%A6r%A4%E5%A5%F3.txt.

    Encoding: unspecified screenshot-unspecified.png

    Encoding: big5 screenshot-big5.png

    Encoding: utf-8 screenshot-utf8.png

    • The summary is the encoding effects only the display in HTML, but did not change the encoding for URL.
    • Also, I adjusted the the "Repository Types -> Mercurial Settings -> Encoding" to "utf-8" and "big5". But it made no difference to the test result.
    • I have read the encoding in Hg is OS-specific somewhere. My OS is Windows 7 Traditional Chinese. Maybe it is why my repo has a different encoding result.
  4. Log in to comment