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

Masking classLoader doesn`t work on remote Slave

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      After upgrading the Apache httpClient to 4.4, I found that other plugins such as Git-Client/Maven-plugin that also uses httpClient with different versions collapses with ours. So After I added the Mask-Classes attribute the problem was gone, but it looks like this isolated environment dose not apply for Slaves.

      I found out that in the RemoteClassLoader while it tries to find a specific class URL, Which.classFileUrl(class) uses the getResource method. This method is not override by the hudson.util.MaskingClassLoader. So the class comes from the right source under the plugin itself, but the resource URL of the same class can came from other source such as other plugins that contain the same classes.

      Error example that I get:

      at hudson.model.Executor.run(Executor.java:240)
      Caused by: java.io.IOException: Remote call on local-windows failed
      at hudson.remoting.Channel.call(Channel.java:748)
      at hudson.FilePath.act(FilePath.java:907)
      ... 9 more
      Caused by: java.lang.NoSuchFieldError: INSTANCE
      at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:52)
      at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:56)
      at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<clinit>(DefaultHttpRequestWriterFactory.java:46)
      at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:72)
      at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:84)
      at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<clinit>(ManagedHttpClientConnectionFactory.java:59)
      at org.apache.http.impl.conn.PoolingHttpClientConnectionManager$InternalConnectionFactory.<init>(PoolingHttpClientConnectionManager.java:493)
      at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:149)
      at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:138)
      at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:114)
      at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:726)
      at org.jfrog.build.client.HttpClientConfigurator.getClient(HttpClientConfigurator.java:91)
      at org.jfrog.build.client.ArtifactoryHttpClient.getHttpClient(ArtifactoryHttpClient.java:140)
      at org.jfrog.build.client.ArtifactoryHttpClient.execute(ArtifactoryHttpClient.java:209)
      at org.jfrog.build.client.ArtifactoryHttpClient.upload(ArtifactoryHttpClient.java:205)
      at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:603)
      at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:315)
      at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.deploy(GenericArtifactsDeployer.java:179)
      at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:151)
      at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:119)
      at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2484)
      at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      at hudson.remoting.Request$2.run(Request.java:328)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at hudson.remoting.Engine$1$1.run(Engine.java:63)
      at java.lang.Thread.run(Thread.java:744)

        Attachments

          Activity

          liorha lior hasson created issue -
          liorha lior hasson made changes -
          Field Original Value New Value
          Description After upgrading the Apache httpClient to 4.4, I found that other plugins such as Git-Client/Maven-plugin that also uses httpClient with different versions collapses with ours. So After I added the Mask-Classes attribute the problem was gone, but it looks like this isolated environment dose not apply for Slaves.

          I found out the in the RemoteClassLoader while it tries to find a specific class URL, Which.classFileUrl(class) uses the getResource method. This method is not override by the hudson.util.MaskingClassLoader. So the class comes from the right source under the plugin itself, but the resource URL of the same class can came from other source such as other plugins that contain the same classes.

          Error example that I get:

          at hudson.model.Executor.run(Executor.java:240)
          Caused by: java.io.IOException: Remote call on local-windows failed
                  at hudson.remoting.Channel.call(Channel.java:748)
                  at hudson.FilePath.act(FilePath.java:907)
                  ... 9 more
          Caused by: java.lang.NoSuchFieldError: INSTANCE
                  at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:52)
                  at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:56)
                  at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<clinit>(DefaultHttpRequestWriterFactory.java:46)
                  at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:72)
                  at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:84)
                  at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<clinit>(ManagedHttpClientConnectionFactory.java:59)
                  at org.apache.http.impl.conn.PoolingHttpClientConnectionManager$InternalConnectionFactory.<init>(PoolingHttpClientConnectionManager.java:493)
                  at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:149)
                  at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:138)
                  at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:114)
                  at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:726)
                  at org.jfrog.build.client.HttpClientConfigurator.getClient(HttpClientConfigurator.java:91)
                  at org.jfrog.build.client.ArtifactoryHttpClient.getHttpClient(ArtifactoryHttpClient.java:140)
                  at org.jfrog.build.client.ArtifactoryHttpClient.execute(ArtifactoryHttpClient.java:209)
                  at org.jfrog.build.client.ArtifactoryHttpClient.upload(ArtifactoryHttpClient.java:205)
                  at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:603)
                  at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:315)
                  at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.deploy(GenericArtifactsDeployer.java:179)
                  at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:151)
                  at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:119)
                  at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2484)
                  at hudson.remoting.UserRequest.perform(UserRequest.java:118)
                  at hudson.remoting.UserRequest.perform(UserRequest.java:48)
                  at hudson.remoting.Request$2.run(Request.java:328)
                  at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
                  at java.util.concurrent.FutureTask.run(FutureTask.java:262)
                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
                  at hudson.remoting.Engine$1$1.run(Engine.java:63)
                  at java.lang.Thread.run(Thread.java:744)



          After upgrading the Apache httpClient to 4.4, I found that other plugins such as Git-Client/Maven-plugin that also uses httpClient with different versions collapses with ours. So After I added the Mask-Classes attribute the problem was gone, but it looks like this isolated environment dose not apply for Slaves.

          I found out the in the *RemoteClassLoader* while it tries to find a specific class URL, *Which.classFileUrl(class)* uses the getResource method. This method is not override by the *hudson.util.MaskingClassLoader*. So the class comes from the right source under the plugin itself, but the resource URL of the same class can came from +other+ source such as other plugins that contain the same classes.

          Error example that I get:

          at hudson.model.Executor.run(Executor.java:240)
          Caused by: java.io.IOException: Remote call on local-windows failed
                  at hudson.remoting.Channel.call(Channel.java:748)
                  at hudson.FilePath.act(FilePath.java:907)
                  ... 9 more
          Caused by: java.lang.NoSuchFieldError: INSTANCE
                  at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:52)
                  at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:56)
                  at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<clinit>(DefaultHttpRequestWriterFactory.java:46)
                  at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:72)
                  at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:84)
                  at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<clinit>(ManagedHttpClientConnectionFactory.java:59)
                  at org.apache.http.impl.conn.PoolingHttpClientConnectionManager$InternalConnectionFactory.<init>(PoolingHttpClientConnectionManager.java:493)
                  at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:149)
                  at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:138)
                  at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:114)
                  at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:726)
                  at org.jfrog.build.client.HttpClientConfigurator.getClient(HttpClientConfigurator.java:91)
                  at org.jfrog.build.client.ArtifactoryHttpClient.getHttpClient(ArtifactoryHttpClient.java:140)
                  at org.jfrog.build.client.ArtifactoryHttpClient.execute(ArtifactoryHttpClient.java:209)
                  at org.jfrog.build.client.ArtifactoryHttpClient.upload(ArtifactoryHttpClient.java:205)
                  at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:603)
                  at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:315)
                  at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.deploy(GenericArtifactsDeployer.java:179)
                  at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:151)
                  at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:119)
                  at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2484)
                  at hudson.remoting.UserRequest.perform(UserRequest.java:118)
                  at hudson.remoting.UserRequest.perform(UserRequest.java:48)
                  at hudson.remoting.Request$2.run(Request.java:328)
                  at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
                  at java.util.concurrent.FutureTask.run(FutureTask.java:262)
                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
                  at hudson.remoting.Engine$1$1.run(Engine.java:63)
                  at java.lang.Thread.run(Thread.java:744)



          liorha lior hasson made changes -
          Description After upgrading the Apache httpClient to 4.4, I found that other plugins such as Git-Client/Maven-plugin that also uses httpClient with different versions collapses with ours. So After I added the Mask-Classes attribute the problem was gone, but it looks like this isolated environment dose not apply for Slaves.

          I found out the in the *RemoteClassLoader* while it tries to find a specific class URL, *Which.classFileUrl(class)* uses the getResource method. This method is not override by the *hudson.util.MaskingClassLoader*. So the class comes from the right source under the plugin itself, but the resource URL of the same class can came from +other+ source such as other plugins that contain the same classes.

          Error example that I get:

          at hudson.model.Executor.run(Executor.java:240)
          Caused by: java.io.IOException: Remote call on local-windows failed
                  at hudson.remoting.Channel.call(Channel.java:748)
                  at hudson.FilePath.act(FilePath.java:907)
                  ... 9 more
          Caused by: java.lang.NoSuchFieldError: INSTANCE
                  at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:52)
                  at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:56)
                  at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<clinit>(DefaultHttpRequestWriterFactory.java:46)
                  at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:72)
                  at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:84)
                  at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<clinit>(ManagedHttpClientConnectionFactory.java:59)
                  at org.apache.http.impl.conn.PoolingHttpClientConnectionManager$InternalConnectionFactory.<init>(PoolingHttpClientConnectionManager.java:493)
                  at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:149)
                  at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:138)
                  at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:114)
                  at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:726)
                  at org.jfrog.build.client.HttpClientConfigurator.getClient(HttpClientConfigurator.java:91)
                  at org.jfrog.build.client.ArtifactoryHttpClient.getHttpClient(ArtifactoryHttpClient.java:140)
                  at org.jfrog.build.client.ArtifactoryHttpClient.execute(ArtifactoryHttpClient.java:209)
                  at org.jfrog.build.client.ArtifactoryHttpClient.upload(ArtifactoryHttpClient.java:205)
                  at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:603)
                  at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:315)
                  at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.deploy(GenericArtifactsDeployer.java:179)
                  at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:151)
                  at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:119)
                  at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2484)
                  at hudson.remoting.UserRequest.perform(UserRequest.java:118)
                  at hudson.remoting.UserRequest.perform(UserRequest.java:48)
                  at hudson.remoting.Request$2.run(Request.java:328)
                  at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
                  at java.util.concurrent.FutureTask.run(FutureTask.java:262)
                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
                  at hudson.remoting.Engine$1$1.run(Engine.java:63)
                  at java.lang.Thread.run(Thread.java:744)



          After upgrading the Apache httpClient to 4.4, I found that other plugins such as Git-Client/Maven-plugin that also uses httpClient with different versions collapses with ours. So After I added the Mask-Classes attribute the problem was gone, but it looks like this isolated environment dose not apply for Slaves.

          I found out that in the *RemoteClassLoader* while it tries to find a specific class URL, *Which.classFileUrl(class)* uses the getResource method. This method is not override by the *hudson.util.MaskingClassLoader*. So the class comes from the right source under the plugin itself, but the resource URL of the same class can came from +other+ source such as other plugins that contain the same classes.

          Error example that I get:

          at hudson.model.Executor.run(Executor.java:240)
          Caused by: java.io.IOException: Remote call on local-windows failed
                  at hudson.remoting.Channel.call(Channel.java:748)
                  at hudson.FilePath.act(FilePath.java:907)
                  ... 9 more
          Caused by: java.lang.NoSuchFieldError: INSTANCE
                  at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:52)
                  at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:56)
                  at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<clinit>(DefaultHttpRequestWriterFactory.java:46)
                  at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:72)
                  at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:84)
                  at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<clinit>(ManagedHttpClientConnectionFactory.java:59)
                  at org.apache.http.impl.conn.PoolingHttpClientConnectionManager$InternalConnectionFactory.<init>(PoolingHttpClientConnectionManager.java:493)
                  at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:149)
                  at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:138)
                  at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:114)
                  at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:726)
                  at org.jfrog.build.client.HttpClientConfigurator.getClient(HttpClientConfigurator.java:91)
                  at org.jfrog.build.client.ArtifactoryHttpClient.getHttpClient(ArtifactoryHttpClient.java:140)
                  at org.jfrog.build.client.ArtifactoryHttpClient.execute(ArtifactoryHttpClient.java:209)
                  at org.jfrog.build.client.ArtifactoryHttpClient.upload(ArtifactoryHttpClient.java:205)
                  at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:603)
                  at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:315)
                  at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.deploy(GenericArtifactsDeployer.java:179)
                  at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:151)
                  at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:119)
                  at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2484)
                  at hudson.remoting.UserRequest.perform(UserRequest.java:118)
                  at hudson.remoting.UserRequest.perform(UserRequest.java:48)
                  at hudson.remoting.Request$2.run(Request.java:328)
                  at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
                  at java.util.concurrent.FutureTask.run(FutureTask.java:262)
                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
                  at hudson.remoting.Engine$1$1.run(Engine.java:63)
                  at java.lang.Thread.run(Thread.java:744)



          danielbeck Daniel Beck made changes -
          Labels jenkins slave lts-candidate slave
          jglick Jesse Glick made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          jglick Jesse Glick made changes -
          Assignee lior hasson [ liorha ]
          jglick Jesse Glick made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Resolved [ 5 ]
          olivergondza Oliver Gondža made changes -
          Labels lts-candidate slave 1.609.2-rejected slave
          olivergondza Oliver Gondža made changes -
          Labels 1.609.2-rejected slave 1.609.2-rejected lts-candidate slave
          danielbeck Daniel Beck made changes -
          Labels 1.609.2-rejected lts-candidate slave 1.609.2-fixed lts-candidate slave
          olivergondza Oliver Gondža made changes -
          Labels 1.609.2-fixed lts-candidate slave 1.609.2-fixed slave
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 161494 ] JNJira + In-Review [ 196776 ]

            People

            Assignee:
            liorha lior hasson
            Reporter:
            liorha lior hasson
            Votes:
            4 Vote for this issue
            Watchers:
            9 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: