Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-26858

java.net.URISyntaxException when special chars are used in filename

    Details

    • Similar Issues:

      Description

      Special characters such as ":", "[", "]" and possible others causes following exception whenever Build#getArtifacts() is called (on a build its artefacts are compressed):

      javax.servlet.ServletException: org.apache.commons.jelly.JellyTagException: vfszip:/var/lib/jbossas/server/production/deploy/hudson.war/WEB-INF/lib/jenkins-core-1.532.3-4.7129fa4f.jar/hudson/model/Job/index.jelly:38:39: <st:include> java.net.URISyntaxException: Illegal character in scheme name at index 0: 2014-11-14_07:08:11/
        at org.kohsuke.stapler.jelly.JellyClassTearOff.serveIndexJelly(JellyClassTearOff.java:117)
        at org.kohsuke.stapler.jelly.JellyFacet.handleIndexRequest(JellyFacet.java:127)
        at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:717)
        at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
        at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:248)
        at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
        at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728)
        at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
        at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:248)
        at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
        at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728)
        at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
        at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:248)
        at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
        at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728)
        at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
        at org.kohsuke.stapler.Stapler.invoke(Stapler.java:631)
        at org.kohsuke.stapler.Stapler.service(Stapler.java:225)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96)
        at hudson.plugins.audit_trail.AuditTrailFilter.doFilter(AuditTrailFilter.java:66)
        at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:99)
        at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:88)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.jenkinsci.plugins.reverse_proxy_auth.ReverseProxySecurityRealm$1.doFilter(ReverseProxySecurityRealm.java:142)
        at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:46)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:442)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
        at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
        at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.internalProcess(ActiveRequestResponseCacheValve.java:74)
        at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:47)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
        at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
        at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:385)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)
        at java.lang.Thread.run(Thread.java:662)
      Caused by: org.apache.commons.jelly.JellyTagException: vfszip:/var/lib/jbossas/server/production/deploy/hudson.war/WEB-INF/lib/jenkins-core-1.532.3-4.7129fa4f.jar/hudson/model/Job/index.jelly:38:39: <st:include> java.net.URISyntaxException: Illegal character in scheme name at index 0: 2014-11-14_07:08:11/
        at org.apache.commons.jelly.impl.TagScript.handleException(TagScript.java:745)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:289)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:99)
        at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:98)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
        at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:120)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:99)
        at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
        at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
        at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:120)
        at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
        at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:81)
        at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:63)
        at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:53)
        at org.kohsuke.stapler.jelly.JellyClassTearOff.serveIndexJelly(JellyClassTearOff.java:112)
        ... 60 more
      Caused by: java.lang.AssertionError: java.net.URISyntaxException: Illegal character in scheme name at index 0: 2014-11-14_07:08:11/
        at org.jenkinsci.plugins.compress_artifacts.ZipStorage.toURI(ZipStorage.java:87)
        at jenkins.util.VirtualFile.hashCode(VirtualFile.java:176)
        at java.util.HashMap.put(HashMap.java:372)
        at java.util.HashSet.add(HashSet.java:200)
        at org.jenkinsci.plugins.compress_artifacts.ZipStorage.list(ZipStorage.java:160)
        at hudson.model.Run.addArtifacts(Run.java:1063)
        at hudson.model.Run.getArtifactsUpTo(Run.java:1044)
        at sun.reflect.GeneratedMethodAccessor1500.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.commons.jexl.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:258)
        at org.apache.commons.jexl.parser.ASTMethod.execute(ASTMethod.java:104)
        at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
        at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
        at org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:51)
        at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
        at hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:74)
        at org.apache.commons.jelly.tags.core.CoreTagLibrary$3.run(CoreTagLibrary.java:134)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:98)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
        at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:120)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
        at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:81)
        at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:147)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
        ... 90 more
      Caused by: java.net.URISyntaxException: Illegal character in scheme name at index 0: 2014-11-14_07:08:11/
        at java.net.URI$Parser.fail(URI.java:2810)
        at java.net.URI$Parser.checkChars(URI.java:2983)
        at java.net.URI$Parser.checkChar(URI.java:2993)
        at java.net.URI$Parser.parse(URI.java:3009)
        at java.net.URI.<init>(URI.java:806)
        at org.jenkinsci.plugins.compress_artifacts.ZipStorage.toURI(ZipStorage.java:85)
        ... 119 more
      

        Attachments

          Activity

          Show
          olivergondza Oliver Gondža added a comment - Fix proposed: https://github.com/jenkinsci/compress-artifacts-plugin/pull/2
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          src/test/java/org/jenkinsci/plugins/compress_artifacts/CompressArtifactsTest.java
          http://jenkins-ci.org/commit/compress-artifacts-plugin/592f79ce00bd0eb81ae3e5e6a84157be65a6f531
          Log:
          JENKINS-26858 Reproduce in unittest

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: src/test/java/org/jenkinsci/plugins/compress_artifacts/CompressArtifactsTest.java http://jenkins-ci.org/commit/compress-artifacts-plugin/592f79ce00bd0eb81ae3e5e6a84157be65a6f531 Log: JENKINS-26858 Reproduce in unittest
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          src/main/java/org/jenkinsci/plugins/compress_artifacts/ZipStorage.java
          src/test/java/org/jenkinsci/plugins/compress_artifacts/CompressArtifactsTest.java
          http://jenkins-ci.org/commit/compress-artifacts-plugin/dc517d1a20c64b3466b0791ee16684be268dcf17
          Log:
          [FIXED JENKINS-26858] Quote artifact path

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: src/main/java/org/jenkinsci/plugins/compress_artifacts/ZipStorage.java src/test/java/org/jenkinsci/plugins/compress_artifacts/CompressArtifactsTest.java http://jenkins-ci.org/commit/compress-artifacts-plugin/dc517d1a20c64b3466b0791ee16684be268dcf17 Log: [FIXED JENKINS-26858] Quote artifact path
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          src/main/java/org/jenkinsci/plugins/compress_artifacts/ZipStorage.java
          src/test/java/org/jenkinsci/plugins/compress_artifacts/CompressArtifactsTest.java
          http://jenkins-ci.org/commit/compress-artifacts-plugin/90f54cf8391d045113967847099b74aceeead350
          Log:
          Merge pull request #2 from olivergondza/JENKINS-26858

          JENKINS-26858 java.net.URISyntaxException when special chars are used in filename

          Compare: https://github.com/jenkinsci/compress-artifacts-plugin/compare/6d63c4572fce...90f54cf8391d

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: src/main/java/org/jenkinsci/plugins/compress_artifacts/ZipStorage.java src/test/java/org/jenkinsci/plugins/compress_artifacts/CompressArtifactsTest.java http://jenkins-ci.org/commit/compress-artifacts-plugin/90f54cf8391d045113967847099b74aceeead350 Log: Merge pull request #2 from olivergondza/ JENKINS-26858 JENKINS-26858 java.net.URISyntaxException when special chars are used in filename Compare: https://github.com/jenkinsci/compress-artifacts-plugin/compare/6d63c4572fce...90f54cf8391d
          Hide
          olivergondza Oliver Gondža added a comment -

          It turns out that the special char is actually the number. The thing is that URI is constructed without scheme part, which appears legal according to javadoc, but then beginning of the scheme-specific part needs to comply to scheme name constrains for reasons I do not really understand.

          Show
          olivergondza Oliver Gondža added a comment - It turns out that the special char is actually the number. The thing is that URI is constructed without scheme part, which appears legal according to javadoc, but then beginning of the scheme-specific part needs to comply to scheme name constrains for reasons I do not really understand.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          src/main/java/org/jenkinsci/plugins/compress_artifacts/ZipStorage.java
          src/test/java/org/jenkinsci/plugins/compress_artifacts/CompressArtifactsTest.java
          src/test/java/org/jenkinsci/plugins/compress_artifacts/ZipStorageTest.java
          http://jenkins-ci.org/commit/compress-artifacts-plugin/c0c641d037d4ec4b0a564f6beba2bb943df59b4a
          Log:
          [FIXED JENKINS-26858] Always use scheme when constructing URI for archived file

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: src/main/java/org/jenkinsci/plugins/compress_artifacts/ZipStorage.java src/test/java/org/jenkinsci/plugins/compress_artifacts/CompressArtifactsTest.java src/test/java/org/jenkinsci/plugins/compress_artifacts/ZipStorageTest.java http://jenkins-ci.org/commit/compress-artifacts-plugin/c0c641d037d4ec4b0a564f6beba2bb943df59b4a Log: [FIXED JENKINS-26858] Always use scheme when constructing URI for archived file
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          src/main/java/org/jenkinsci/plugins/compress_artifacts/ZipStorage.java
          src/test/java/org/jenkinsci/plugins/compress_artifacts/CompressArtifactsTest.java
          src/test/java/org/jenkinsci/plugins/compress_artifacts/ZipStorageTest.java
          http://jenkins-ci.org/commit/compress-artifacts-plugin/ef69f52cfec9edc69443ee11c1435c15febe0329
          Log:
          Merge pull request #6 from olivergondza/JENKINS-26858-take2

          [FIXED JENKINS-26858] Always use scheme when constructing URI for archived file

          Compare: https://github.com/jenkinsci/compress-artifacts-plugin/compare/49f4422a24c5...ef69f52cfec9

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: src/main/java/org/jenkinsci/plugins/compress_artifacts/ZipStorage.java src/test/java/org/jenkinsci/plugins/compress_artifacts/CompressArtifactsTest.java src/test/java/org/jenkinsci/plugins/compress_artifacts/ZipStorageTest.java http://jenkins-ci.org/commit/compress-artifacts-plugin/ef69f52cfec9edc69443ee11c1435c15febe0329 Log: Merge pull request #6 from olivergondza/ JENKINS-26858 -take2 [FIXED JENKINS-26858] Always use scheme when constructing URI for archived file Compare: https://github.com/jenkinsci/compress-artifacts-plugin/compare/49f4422a24c5...ef69f52cfec9

            People

            • Assignee:
              olivergondza Oliver Gondža
              Reporter:
              olivergondza Oliver Gondža
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: