Search code examples
jenkinsnode-modulesmcafee

"cb-never-called-1.0.1.tgz: Operation not permitted" error coming at the time of gradle/npm build node module


This below exception came at the time of building node_module from gradle suddenly on Linux environment.

java.nio.file.FileSystemException: /var/lib/jenkins/workspace/<project>/node_modules/tar/test/cb-never-called-1.0.1.tgz: Operation not permitted

08:20:02 Caused by: org.gradle.api.UncheckedIOException: Failed to create MD5 hash for file '/var/lib/jenkins/workspace/<project>/node_modules/tar/test/cb-never-called-1.0.1.tgz'.
08:20:02    at org.gradle.api.internal.hash.DefaultFileHasher.hash(DefaultFileHasher.java:48)
08:20:02    at org.gradle.api.internal.changedetection.state.CachingFileHasher.snapshot(CachingFileHasher.java:79)
08:20:02    at org.gradle.api.internal.changedetection.state.CachingFileHasher.snapshot(CachingFileHasher.java:68)
08:20:02    at org.gradle.api.internal.changedetection.state.CachingFileHasher.hash(CachingFileHasher.java:60)
08:20:02    at org.gradle.api.internal.changedetection.state.AbstractFileCollectionSnapshotter.snapshot(AbstractFileCollectionSnapshotter.java:97)
08:20:02    at org.gradle.api.internal.changedetection.rules.AbstractNamedFileSnapshotTaskStateChanges.buildSnapshots(AbstractNamedFileSnapshotTaskStateChanges.java:87)
08:20:02    ... 75 more
08:20:02 Caused by: java.io.FileNotFoundException: /var/lib/jenkins/workspace/<project>/node_modules/tar/test/cb-never-called-1.0.1.tgz (Operation not permitted)
08:20:02    at com.google.common.io.Files$FileByteSource.openStream(Files.java:126)
08:20:02    at com.google.common.io.Files$FileByteSource.openStream(Files.java:116)
08:20:02    at com.google.common.io.ByteSource.copyTo(ByteSource.java:234)
08:20:02    at com.google.common.io.Files.copy(Files.java:423)
0*8:20:02   at org.gradle.api.internal.hash.DefaultFileHasher.hash(DefaultFileHasher.java:45)
08:20:02    ... 80 more

While investigating find out that is happening because of* McAfee consider this file as a maleware (refer this, this), because of that its not able to read this file during building.

Any possible solution?


Solution

  • I was facing the same issue. When i checked, I observed that on the server McAfee antivirus is installed and processes are running for this.

    Further investigation gave me that, McAfee is treating the file "cb-never-called-1.0.1.tgz" as malware and preventing any operation on this file.

    Try to run the following command and it will solve the issue (the command will stop the McAfee process on centos):

    sudo /opt/isec/ens/threatprevention/bin/isectpdControl.sh stop