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

zip file cannot download if branch name include '/' charactor #2442

Open
DrgonPine opened this issue Apr 16, 2020 · 1 comment · May be fixed by #2509
Open

zip file cannot download if branch name include '/' charactor #2442

DrgonPine opened this issue Apr 16, 2020 · 1 comment · May be fixed by #2509
Labels

Comments

@DrgonPine
Copy link

Issue

zip file cannot download if branch name include '/' charactor
Impacted version: 4.33.0

Deployment mode:
GitBucket : standalone app with an http frontend (tomcat8)

Problem description:

  • be as explicit has you can
  • describe the problem and its symptoms
  • explain how to reproduce
  1. create branch that branch name include '/' charactor
  2. try to download from created branch
  3. URL error display
    branch name '/' charactor is replaced "%2" on page URL
    I guess that is root cause.
@DerTomm
Copy link

DerTomm commented Aug 12, 2020

We see the same problem with current release 4.34.0. Maybe I can contribute some additional information:

As DrgonPine we try to download a ZIP archive of a branch containing slashes (e.g. feature/fancy_new_feature). The file can be downloaded but the archive does not have any content.
In the server the following errors/exceptions are logged:

09:17:42.273 [qtp610998173-1666] ERROR g.c.c.RepositoryViewerController - Catch unhandled error in request: Request(GET //<removed hostname+repo>/archive/feature/foo/bar.zip)@388ec434
java.lang.NullPointerException: null
java.lang.IllegalStateException: STREAM
        at org.eclipse.jetty.server.Response.getWriter(Response.java:763)
        at org.scalatra.servlet.RichResponse.writer(RichResponse.scala:61)
        at org.scalatra.ScalatraBase$$anonfun$renderPipeline$1.applyOrElse(ScalatraBase.scala:467)
        at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:242)
        at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:242)
        at scala.PartialFunction$Lifted.apply(PartialFunction.scala:310)
        at scala.PartialFunction$Lifted.apply(PartialFunction.scala:306)
        at org.scalatra.ScalatraBase.loop$1(ScalatraBase.scala:412)
        at org.scalatra.ScalatraBase.renderResponseBody(ScalatraBase.scala:416)
        at org.scalatra.ScalatraBase.renderResponseBody$(ScalatraBase.scala:409)
        at gitbucket.core.controller.ControllerBase.renderResponseBody(ControllerBase.scala:35)
        at org.scalatra.ScalatraBase.renderResponse(ScalatraBase.scala:380)
        at org.scalatra.ScalatraBase.renderResponse$(ScalatraBase.scala:374)
        at gitbucket.core.controller.ControllerBase.renderResponse(ControllerBase.scala:35)
        at org.scalatra.ScalatraBase.executeRoutes(ScalatraBase.scala:196)
        at org.scalatra.ScalatraBase.executeRoutes$(ScalatraBase.scala:150)
        at gitbucket.core.controller.ControllerBase.executeRoutes(ControllerBase.scala:35)
        at org.scalatra.ScalatraBase.$anonfun$handle$1(ScalatraBase.scala:123)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.DynamicScope.withResponse(DynamicScope.scala:75)
        at org.scalatra.DynamicScope.withResponse$(DynamicScope.scala:73)
        at gitbucket.core.controller.ControllerBase.withResponse(ControllerBase.scala:35)
        at org.scalatra.DynamicScope.$anonfun$withRequestResponse$1(DynamicScope.scala:55)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.DynamicScope.withRequest(DynamicScope.scala:66)
        at org.scalatra.DynamicScope.withRequest$(DynamicScope.scala:64)
        at gitbucket.core.controller.ControllerBase.withRequest(ControllerBase.scala:35)
        at org.scalatra.DynamicScope.withRequestResponse(DynamicScope.scala:54)
        at org.scalatra.DynamicScope.withRequestResponse$(DynamicScope.scala:52)
        at gitbucket.core.controller.ControllerBase.withRequestResponse(ControllerBase.scala:35)
        at org.scalatra.ScalatraBase.handle(ScalatraBase.scala:123)
        at org.scalatra.ScalatraBase.handle$(ScalatraBase.scala:119)
        at gitbucket.core.controller.ControllerBase.org$scalatra$servlet$ServletBase$$super$handle(ControllerBase.scala:35)
        at org.scalatra.servlet.ServletBase.handle(ServletBase.scala:42)
        at org.scalatra.servlet.ServletBase.handle$(ServletBase.scala:35)
        at gitbucket.core.controller.ControllerBase.org$scalatra$FlashMapSupport$$super$handle(ControllerBase.scala:35)
        at org.scalatra.FlashMapSupport.$anonfun$handle$1(FlashMap.scala:197)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.DynamicScope.withRequest(DynamicScope.scala:66)
        at org.scalatra.DynamicScope.withRequest$(DynamicScope.scala:64)
        at gitbucket.core.controller.ControllerBase.withRequest(ControllerBase.scala:35)
        at org.scalatra.FlashMapSupport.handle(FlashMap.scala:172)
        at org.scalatra.FlashMapSupport.handle$(FlashMap.scala:171)
        at gitbucket.core.controller.ControllerBase.handle(ControllerBase.scala:35)
        at org.scalatra.ScalatraFilter.$anonfun$doFilter$1(ScalatraFilter.scala:41)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.ScalatraFilter.doFilter(ScalatraFilter.scala:41)
        at org.scalatra.ScalatraFilter.doFilter$(ScalatraFilter.scala:36)
        at gitbucket.core.controller.ControllerBase.doFilter(ControllerBase.scala:73)
        at gitbucket.core.servlet.CompositeScalatraFilter.$anonfun$process$2(CompositeScalatraFilter.scala:67)
        at gitbucket.core.servlet.CompositeScalatraFilter.$anonfun$process$2$adapted(CompositeScalatraFilter.scala:64)
        at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:553)
        at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:551)
        at scala.collection.AbstractIterable.foreach(Iterable.scala:921)
        at gitbucket.core.servlet.CompositeScalatraFilter.process(CompositeScalatraFilter.scala:64)
        at gitbucket.core.servlet.ControllerFilter.doFilter(CompositeScalatraFilter.scala:25)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1618)
        at gitbucket.core.servlet.ControllerFilter.doFilter(CompositeScalatraFilter.scala:31)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1618)
        at org.scalatra.ScalatraFilter.$anonfun$doNotFound$1(ScalatraFilter.scala:79)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at org.scalatra.ScalatraBase.$anonfun$executeRoutes$5(ScalatraBase.scala:172)
        at scala.Option.getOrElse(Option.scala:201)
        at org.scalatra.ScalatraBase.$anonfun$executeRoutes$3(ScalatraBase.scala:172)
        at scala.Option.getOrElse(Option.scala:201)
        at org.scalatra.ScalatraBase.runActions$1(ScalatraBase.scala:172)
        at org.scalatra.ScalatraBase.$anonfun$executeRoutes$6(ScalatraBase.scala:181)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at org.scalatra.ScalatraBase.cradleHalt(ScalatraBase.scala:201)
        at org.scalatra.ScalatraBase.executeRoutes(ScalatraBase.scala:181)
        at org.scalatra.ScalatraBase.executeRoutes$(ScalatraBase.scala:150)
        at gitbucket.core.controller.ControllerBase.executeRoutes(ControllerBase.scala:35)
        at org.scalatra.ScalatraBase.$anonfun$handle$1(ScalatraBase.scala:123)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.DynamicScope.withResponse(DynamicScope.scala:75)
        at org.scalatra.DynamicScope.withResponse$(DynamicScope.scala:73)
        at gitbucket.core.controller.ControllerBase.withResponse(ControllerBase.scala:35)
        at org.scalatra.DynamicScope.$anonfun$withRequestResponse$1(DynamicScope.scala:55)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.DynamicScope.withRequest(DynamicScope.scala:66)
        at org.scalatra.DynamicScope.withRequest$(DynamicScope.scala:64)
        at gitbucket.core.controller.ControllerBase.withRequest(ControllerBase.scala:35)
        at org.scalatra.DynamicScope.withRequestResponse(DynamicScope.scala:54)
        at org.scalatra.DynamicScope.withRequestResponse$(DynamicScope.scala:52)
        at gitbucket.core.controller.ControllerBase.withRequestResponse(ControllerBase.scala:35)
        at org.scalatra.ScalatraBase.handle(ScalatraBase.scala:123)
        at org.scalatra.ScalatraBase.handle$(ScalatraBase.scala:119)
        at gitbucket.core.controller.ControllerBase.org$scalatra$servlet$ServletBase$$super$handle(ControllerBase.scala:35)
        at org.scalatra.servlet.ServletBase.handle(ServletBase.scala:42)
        at org.scalatra.servlet.ServletBase.handle$(ServletBase.scala:35)
        at gitbucket.core.controller.ControllerBase.org$scalatra$FlashMapSupport$$super$handle(ControllerBase.scala:35)
        at org.scalatra.FlashMapSupport.$anonfun$handle$1(FlashMap.scala:197)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.DynamicScope.withRequest(DynamicScope.scala:66)
        at org.scalatra.DynamicScope.withRequest$(DynamicScope.scala:64)
        at gitbucket.core.controller.ControllerBase.withRequest(ControllerBase.scala:35)
        at org.scalatra.FlashMapSupport.handle(FlashMap.scala:172)
        at org.scalatra.FlashMapSupport.handle$(FlashMap.scala:171)
        at gitbucket.core.controller.ControllerBase.handle(ControllerBase.scala:35)
        at org.scalatra.ScalatraFilter.$anonfun$doFilter$1(ScalatraFilter.scala:41)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.ScalatraFilter.doFilter(ScalatraFilter.scala:41)
        at org.scalatra.ScalatraFilter.doFilter$(ScalatraFilter.scala:36)
        at gitbucket.core.controller.ControllerBase.doFilter(ControllerBase.scala:73)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1618)
        at gitbucket.core.servlet.TransactionFilter.$anonfun$doFilter$1(TransactionFilter.scala:39)
        at gitbucket.core.servlet.TransactionFilter.$anonfun$doFilter$1$adapted(TransactionFilter.scala:30)
        at com.github.takezoe.slick.blocking.BlockingJdbcProfile$BlockingAPI$BlockingDatabase.$anonfun$withTransaction$2(BlockingProfile.scala:207)
        at slick.JdbcProfileBlockingSession$BlockingSession.withTransaction(TransactionalJdbcBackend.scala:26)
        at com.github.takezoe.slick.blocking.BlockingJdbcProfile$BlockingAPI$BlockingDatabase.$anonfun$withTransaction$1(BlockingProfile.scala:207)
        at com.github.takezoe.slick.blocking.BlockingJdbcProfile$BlockingAPI$BlockingDatabase.withSession(BlockingProfile.scala:200)
        at com.github.takezoe.slick.blocking.BlockingJdbcProfile$BlockingAPI$BlockingDatabase.withTransaction(BlockingProfile.scala:207)
        at gitbucket.core.servlet.TransactionFilter.doFilter(TransactionFilter.scala:30)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:549)
        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:1610)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1369)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:489)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1580)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1284)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:173)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
        at org.eclipse.jetty.server.Server.handle(Server.java:501)
        at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
        at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:556)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:272)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
        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:806)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
        at java.lang.Thread.run(Thread.java:748)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

3 participants