"cb-never-called-1.0.1.tgz: Operation not permitted" 在 gradle/npm 构建节点模块时出现错误
"cb-never-called-1.0.1.tgz: Operation not permitted" error coming at the time of gradle/npm build node module
在 Linux 环境中突然从 gradle 构建 node_module 时出现以下异常。
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
在调查中发现这是因为 * McAfee 将此文件视为恶意软件(参考 this, this),因为它无法在构建期间读取此文件。
任何可能的解决方案?
我遇到了同样的问题。当我检查时,我发现服务器上安装了 McAfee 防病毒软件,并且为此进程 运行ning。
进一步调查表明,McAfee 将文件“cb-never-called-1.0.1.tgz”视为恶意软件并阻止对此文件进行任何操作.
尝试运行以下命令,它会解决问题(该命令会停止 centos 上的 McAfee 进程):
sudo /opt/isec/ens/threatprevention/bin/isectpdControl.sh 停止
在 Linux 环境中突然从 gradle 构建 node_module 时出现以下异常。
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
在调查中发现这是因为 * McAfee 将此文件视为恶意软件(参考 this, this),因为它无法在构建期间读取此文件。
任何可能的解决方案?
我遇到了同样的问题。当我检查时,我发现服务器上安装了 McAfee 防病毒软件,并且为此进程 运行ning。
进一步调查表明,McAfee 将文件“cb-never-called-1.0.1.tgz”视为恶意软件并阻止对此文件进行任何操作.
尝试运行以下命令,它会解决问题(该命令会停止 centos 上的 McAfee 进程):
sudo /opt/isec/ens/threatprevention/bin/isectpdControl.sh 停止