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

Publish over CIFS fails with Out of memory error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
    • Similar Issues:

      Description

      When attempting to deploy to a windows share, I consistently get the following exception:

      CIFS: Connecting from host [xxxxxxxx]
      CIFS: Connecting with configuration [GiveupDevShare] ...
      CIFS: Disconnecting configuration [GiveupDevShare] ...
      FATAL: unable to create new native thread
      java.lang.OutOfMemoryError: unable to create new native thread
      at java.lang.Thread.start0(Native Method)
      at java.lang.Thread.start(Thread.java:640)
      at jcifs.UniAddress.lookupServerOrWorkgroup(UniAddress.java:173)
      at jcifs.UniAddress.getAllByName(UniAddress.java:290)
      at jcifs.UniAddress.getByName(UniAddress.java:245)
      at jcifs.smb.Dfs.getTrustedDomains(Dfs.java:62)
      at jcifs.smb.Dfs.resolve(Dfs.java:167)
      at jcifs.smb.SmbFile.resolveDfs(SmbFile.java:666)
      at jcifs.smb.SmbFile.send(SmbFile.java:768)
      at jcifs.smb.SmbFile.close(SmbFile.java:1016)
      at jcifs.smb.SmbFile.close(SmbFile.java:1022)
      at jcifs.smb.SmbFile.close(SmbFile.java:1026)
      at jcifs.smb.SmbFileOutputStream.close(SmbFileOutputStream.java:164)
      at jenkins.plugins.publish_over_cifs.CifsClient.transferFile(CifsClient.java:107)
      at jenkins.plugins.publish_over_cifs.CifsClient.transferFile(CifsClient.java:39)
      at jenkins.plugins.publish_over.BPTransfer.transferFile(BPTransfer.java:172)
      at jenkins.plugins.publish_over.BPTransfer.transfer(BPTransfer.java:162)
      at jenkins.plugins.publish_over.BapPublisher.perform(BapPublisher.java:146)
      at jenkins.plugins.publish_over_cifs.CifsPublisher.perform(CifsPublisher.java:60)
      at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:64)
      at jenkins.plugins.publish_over.BPCallablePublisher.invoke(BPCallablePublisher.java:37)
      at hudson.FilePath.act(FilePath.java:905)
      at hudson.FilePath.act(FilePath.java:878)
      at jenkins.plugins.publish_over.BPInstanceConfig.perform(BPInstanceConfig.java:124)
      at jenkins.plugins.publish_over.BPPlugin.perform(BPPlugin.java:109)
      at jenkins.plugins.publish_over_cifs.CifsBuilderPlugin.perform(CifsBuilderPlugin.java:60)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
      at hudson.model.Build$BuildExecution.build(Build.java:199)
      at hudson.model.Build$BuildExecution.doRun(Build.java:160)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586)
      at hudson.model.Run.execute(Run.java:1593)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:247)

        Attachments

          Activity

          imavroukakis Ioannis Mavroukakis created issue -
          Hide
          jazzyjayx Jay Spang added a comment -

          I'm seeing this same error publishing to a windows share from an OSX slave. Is there a known workaround?

          Jenkins Master: Win2k12
          Jenkins Slave: OSX Mountain Lion

          Show
          jazzyjayx Jay Spang added a comment - I'm seeing this same error publishing to a windows share from an OSX slave. Is there a known workaround? Jenkins Master: Win2k12 Jenkins Slave: OSX Mountain Lion
          Hide
          imavroukakis Ioannis Mavroukakis added a comment -

          Yes , I found that if you start Jenkins with the following JCIFS env vars it behaves

          -Djcifs.resolveOrder=DNS
          -Djcifs.smb.client.dfs.disabled=true

          Show
          imavroukakis Ioannis Mavroukakis added a comment - Yes , I found that if you start Jenkins with the following JCIFS env vars it behaves -Djcifs.resolveOrder=DNS -Djcifs.smb.client.dfs.disabled=true
          Hide
          imavroukakis Ioannis Mavroukakis added a comment -

          Using -Djcifs.resolveOrder=DNS -Djcifs.smb.client.dfs.disabled=true resolves this

          Show
          imavroukakis Ioannis Mavroukakis added a comment - Using -Djcifs.resolveOrder=DNS -Djcifs.smb.client.dfs.disabled=true resolves this
          imavroukakis Ioannis Mavroukakis made changes -
          Field Original Value New Value
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          Hide
          pek99 Peter Krahulik added a comment -

          Hi, the workaround did not work for me
          However, the fix appears to have been done in the JCIFS itself on Oct 18, 2011.

          (line from call stack: at jcifs.smb.SmbFile.resolveDfs(SmbFile.java:666))

          void resolveDfs(ServerMessageBlock request) throws SmbException {
          
                  if (request instanceof SmbComClose)
                      return;
          ...
          }
          
          Show
          pek99 Peter Krahulik added a comment - Hi, the workaround did not work for me However, the fix appears to have been done in the JCIFS itself on Oct 18, 2011. (line from call stack: at jcifs.smb.SmbFile.resolveDfs(SmbFile.java:666) ) http://jcifs.samba.org/src/src/jcifs/smb/SmbFile.java void resolveDfs(ServerMessageBlock request) throws SmbException { if (request instanceof SmbComClose) return ; ... }
          Hide
          smr88 Steve Robbins added a comment -

          This issue bit me this week (Jenkins 1.596.3) and it took a bit of struggle to solve it because I was missing two pieces of information.

          1. Even though the failing build was on a slave, the java settings changes (adding -Djcifs...) must be done on the master node.

          2. When running as a windows service, the java command line arguments are contained within file jenkins.xml. This is the file to modify.

          Show
          smr88 Steve Robbins added a comment - This issue bit me this week (Jenkins 1.596.3) and it took a bit of struggle to solve it because I was missing two pieces of information. 1. Even though the failing build was on a slave, the java settings changes (adding -Djcifs...) must be done on the master node. 2. When running as a windows service, the java command line arguments are contained within file jenkins.xml. This is the file to modify.
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 150522 ] JNJira + In-Review [ 193562 ]
          Hide
          mviargues Maxime Viargues added a comment -

          We've just been getting this error since we upgraded Jenkins to the latest version 2.107.2 and updated the CIFS plugin to 0.9. I have tried adding those arguments but it didn't make any difference, and we can't downgrade to 0.3 as the job configurations have been updated so are no longer compatible.

          This is a major issue and hasn't been resolved. Can we re-open it?

          Show
          mviargues Maxime Viargues added a comment - We've just been getting this error since we upgraded Jenkins to the latest version 2.107.2 and updated the CIFS plugin to 0.9. I have tried adding those arguments but it didn't make any difference, and we can't downgrade to 0.3 as the job configurations have been updated so are no longer compatible. This is a major issue and hasn't been resolved. Can we re-open it?
          Hide
          mviargues Maxime Viargues added a comment - - edited

          More info: I was running a "top" command on the slave which was building and saw a spike of more than 2500 threads being running during the CIFS copy (from 800 originally).

          Also this issue only happens on MacOS machines, ElCapitan or Sierra.

          Show
          mviargues Maxime Viargues added a comment - - edited More info: I was running a "top" command on the slave which was building and saw a spike of more than 2500 threads being running during the CIFS copy (from 800 originally). Also this issue only happens on MacOS machines, ElCapitan or Sierra.
          Hide
          mviargues Maxime Viargues added a comment -

          Well upgrading to the latest "Publish Over CIFS" plug-in v0.10 fixed the issue. They have changed the underlying library to use a new jcfis library which is a lot different and removed/changed the failing code.

          They've just release v0.10 like 3 days after our upgrade... Bad luck on the timing.

          Show
          mviargues Maxime Viargues added a comment - Well upgrading to the latest "Publish Over CIFS" plug-in v0.10 fixed the issue. They have changed the underlying library to use a new jcfis library which is a lot different and removed/changed the failing code. They've just release v0.10 like 3 days after our upgrade... Bad luck on the timing.

            People

            Assignee:
            bap bap
            Reporter:
            imavroukakis Ioannis Mavroukakis
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: