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

Following symlinks causes an OutOfMemoryException

XMLWordPrintable

      A symlink inside a node_modules folder is causing infinite recursion.

      The particular setup is when a subfolder contains a test project referencing the root project.

       

      Would there be any issues of not following symlinks to retrieve the scan targets?

       

      Adding file exclusions with iqModuleExcludes doesn't work since the whole file tree is still walked.

      Possible modification

      See here for a first draft of a possible fix: https://github.com/jenkinsci/nexus-platform-plugin/compare/master...lrpg:master

      Workaround

      • Drop the symlinks before the scan and put them back after
      • or Change the project structure (which isn't an option in some cases)

      Stack traces

      Extra info:
      Here are some stack traces about the OOM:08:52:14  ERROR: WARNING: An error happened during the Sonatype Nexus iQ analysis
      08:52:14  java.lang.OutOfMemoryError: GC overhead limit exceeded
      08:52:14  	at java.lang.String.toCharArray(String.java:2899)
      08:52:14  	at org.codehaus.plexus.util.MatchPatterns.matches(SourceFile:41)
      08:52:14  	at org.codehaus.plexus.util.AbstractScanner.isExcluded(SourceFile:352)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:502)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  	at org.codehaus.plexus.util.DirectoryScanner.scandir(SourceFile:490)
      08:52:14  Caused: java.io.IOException: Remote call on i-0c6e393b629e5e54d failed
      08:52:14  	at hudson.remoting.Channel.call(Channel.java:1007)
      08:52:14  	at hudson.remoting.VirtualChannel$call$13.call(Unknown Source)
      08:52:14  	at org.sonatype.nexus.ci.iq.IqPolicyEvaluatorUtil.evaluatePolicy(IqPolicyEvaluatorUtil.groovy:73)
      08:52:14  	at org.sonatype.nexus.ci.iq.IqPolicyEvaluatorUtil$evaluatePolicy.call(Unknown Source)
      08:52:14  	at org.sonatype.nexus.ci.iq.PolicyEvaluatorExecution.run(PolicyEvaluatorExecution.groovy:50)
      08:52:14  	at org.sonatype.nexus.ci.iq.PolicyEvaluatorExecution.run(PolicyEvaluatorExecution.groovy)
      08:52:14  	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
      08:52:14  	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      08:52:14  	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      08:52:14  	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      08:52:14  	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      08:52:14  	at java.lang.Thread.run(Thread.java:748)11:04:24  ERROR: WARNING: An error happened during the Sonatype Nexus iQ analysis
      11:04:24  java.lang.OutOfMemoryError: GC overhead limit exceeded
      11:04:24  	at sun.reflect.GeneratedConstructorAccessor68.newInstance(Unknown Source)
      11:04:24  	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      11:04:24  	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      11:04:24  	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
      11:04:24  	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
      11:04:24  	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:255)
      11:04:24  	at org.sonatype.nexus.ci.iq.RemoteScanner$_getScanTargets_closure1.doCall(RemoteScanner.groovy:95)
      11:04:24  	at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
      11:04:24  	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      11:04:24  	at java.lang.reflect.Method.invoke(Method.java:498)
      11:04:24  	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
      11:04:24  	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      11:04:24  	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
      11:04:24  	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
      11:04:24  	at groovy.lang.Closure.call(Closure.java:414)
      11:04:24  	at groovy.lang.Closure.call(Closure.java:430)
      11:04:24  	at org.codehaus.groovy.runtime.DefaultGroovyMethods.collect(DefaultGroovyMethods.java:3156)
      11:04:24  	at org.codehaus.groovy.runtime.DefaultGroovyMethods.collect(DefaultGroovyMethods.java:3127)
      11:04:24  	at org.codehaus.groovy.runtime.dgm$66.invoke(Unknown Source)
      11:04:24  	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
      11:04:24  	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
      11:04:24  	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      11:04:24  	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
      11:04:24  	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
      11:04:24  	at org.sonatype.nexus.ci.iq.RemoteScanner.getScanTargets(RemoteScanner.groovy:94)
      11:04:24  	at org.sonatype.nexus.ci.iq.RemoteScanner$getScanTargets.callCurrent(Unknown Source)
      11:04:24  	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
      11:04:24  	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
      11:04:24  	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174)
      11:04:24  	at org.sonatype.nexus.ci.iq.RemoteScanner.call(RemoteScanner.groovy:80)
      11:04:24  	at org.sonatype.nexus.ci.iq.RemoteScanner.call(RemoteScanner.groovy)
      11:04:24  	at hudson.remoting.UserRequest.perform(UserRequest.java:211)
      11:04:24  Caused: java.io.IOException: Remote call on i-0896ae1be2c41e74e failed
      11:04:24  	at hudson.remoting.Channel.call(Channel.java:1007)
      11:04:24  	at hudson.remoting.VirtualChannel$call$11.call(Unknown Source)
      11:04:24  	at org.sonatype.nexus.ci.iq.IqPolicyEvaluatorUtil.evaluatePolicy(IqPolicyEvaluatorUtil.groovy:73)
      11:04:24  	at org.sonatype.nexus.ci.iq.IqPolicyEvaluatorUtil$evaluatePolicy.call(Unknown Source)
      11:04:24  	at org.sonatype.nexus.ci.iq.PolicyEvaluatorExecution.run(PolicyEvaluatorExecution.groovy:50)

            whyjustin Justin Young
            l_r Louis-Rémi Paquet
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: