0
votes

I wanna use Artifactory plugin for my Jenkins Scripted Pipeline for NPM Project. During the NPM Install I'm facing an issue:

SEVERE: process hasn't exited
java.lang.IllegalThreadStateException: process hasn't exited
    at java.lang.UNIXProcess.exitValue(UNIXProcess.java:423)
    at org.jfrog.build.extractor.executor.CommandExecutor.exeCommand(CommandExecutor.java:78)
    at org.jfrog.build.extractor.npm.NpmDriver.runCommand(NpmDriver.java:80)
    at org.jfrog.build.extractor.npm.NpmDriver.install(NpmDriver.java:42)
    at org.jfrog.build.extractor.npm.extractor.NpmBuildInfoExtractor.runInstall(NpmBuildInfoExtractor.java:153)
    at org.jfrog.build.extractor.npm.extractor.NpmBuildInfoExtractor.extract(NpmBuildInfoExtractor.java:61)
    at org.jfrog.build.extractor.npm.extractor.NpmInstall.execute(NpmInstall.java:50)
    at org.jfrog.hudson.npm.NpmInstallCallable.invoke(NpmInstallCallable.java:53)
    at org.jfrog.hudson.npm.NpmInstallCallable.invoke(NpmInstallCallable.java:20)
    at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3085)
    at hudson.remoting.UserRequest.perform(UserRequest.java:212)
    at hudson.remoting.UserRequest.perform(UserRequest.java:54)
    at hudson.remoting.Request$2.run(Request.java:369)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

I'm using Artifactory plugin for Jenkins (v. 3.2.2) in Scripted Pipeline in Jenkins. I'm following official Jfrog Documentation.

I'm already somehow in touch with JFrog support, I've already raised an issue in official Github and contributing in issue in JFrog support here.

I'm already using this plugin for scripted pipeline for maven Project and it works fine. I was trying to debug the issue a lot, sometimes it worked, when I removed some dependencies from package.json.

This is the configuration in my groovy script.

def server = Artifactory.server 'artifacts-prod-01'
server.credentialsId = 'artifactory-credentials-id'
def rtNpm = Artifactory.newNpmBuild()
rtNpm.resolver server: server, repo: 'npm-main-dev'
withEnv(["PATH+NODEJS=${tool 'NodeJS 10'}/bin"]) {
        def buildInfo = rtNpm.install path: '.'
}

I'm expecting to have installed all packages specified in package.json, but it seems that during npm install there is a timeout. I have just one interesting point. I tried to install their Snapshot version with fixed timeout here with following fix here and then I get this error:

[Bitbucket] Notifying commit build result
[Bitbucket] Build result notified
java.io.IOException: Unexpected EOF
    at hudson.remoting.ChunkedInputStream.readUntilBreak(ChunkedInputStream.java:99)
    at hudson.remoting.ChunkedCommandTransport.readBlock(ChunkedCommandTransport.java:39)
    at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:35)
    at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)
Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to stg-default-agent-eu
        at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
        at hudson.remoting.Request.call(Request.java:202)
        at hudson.remoting.Channel.call(Channel.java:954)
        at hudson.FilePath.act(FilePath.java:1071)
        at hudson.FilePath.act(FilePath.java:1060)
        at org.jfrog.hudson.pipeline.common.executors.NpmInstallExecutor.execute(NpmInstallExecutor.java:57)
        at org.jfrog.hudson.pipeline.scripted.steps.NpmInstallStep$Execution.run(NpmInstallStep.java:64)
        at org.jfrog.hudson.pipeline.scripted.steps.NpmInstallStep$Execution.run(NpmInstallStep.java:39)
        at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
        at hudson.security.ACL.impersonate(ACL.java:290)
        at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused: hudson.remoting.RequestAbortedException
    at hudson.remoting.Request.abort(Request.java:340)
    at hudson.remoting.Channel.terminate(Channel.java:1038)
    at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:96)
Finished: FAILURE

Is there anyone using Artifactory Jenkins plugin for building their NPM projects by scripted pipeline? If yes, can you share your configuration, please? Thanks a lot.

1
It would be worth to check the logs at artifactory when you get this failure. Please upload the logs here - error404

1 Answers

0
votes

This issue is resolved since Jenkins Artifactory plugin v3.2.3. Please upgrade to the latest version. For more information see HAP-1165 and this commit.