jenkins有些操作被禁止,报“Operation not permitted“错误

一、问题描述:

我的jenkins在文档归档时,提示我某些步骤禁止操作("Operation not permitted"),具体报错如下:

[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at PROJECT level /var/lib/jenkins/workspace/算法精度测试 to /var/lib/jenkins/jobs/算法精度测试/htmlreports/HTML_20Report
FATAL: HTML Publisher failure
jenkins.util.io.CompositeIOException: Unable to delete '/var/lib/jenkins/jobs/算法精度测试/htmlreports/HTML_20Report'. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts.
	at jenkins.util.io.PathRemover.forceRemoveRecursive(PathRemover.java:99)
	at hudson.Util.deleteRecursive(Util.java:321)
	at hudson.FilePath$DeleteRecursive.invoke(FilePath.java:1408)
	at hudson.FilePath$DeleteRecursive.invoke(FilePath.java:1404)
	at hudson.FilePath.act(FilePath.java:1173)
	at hudson.FilePath.act(FilePath.java:1156)
	at hudson.FilePath.deleteRecursive(FilePath.java:1402)
	at htmlpublisher.HtmlPublisher.publishReports(HtmlPublisher.java:239)
	at htmlpublisher.workflow.PublishHTMLStepExecution.run(PublishHTMLStepExecution.java:70)
	at htmlpublisher.workflow.PublishHTMLStepExecution.run(PublishHTMLStepExecution.java:45)
	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
	at hudson.security.ACL.impersonate2(ACL.java:449)
	at hudson.security.ACL.impersonate(ACL.java:461)
	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
	Suppressed: java.nio.file.FileSystemException: /var/lib/jenkins/jobs/算法精度测试/htmlreports/HTML_20Report: Operation not permitted
		at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
		at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setMode(UnixFileAttributeViews.java:254)
		at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setPermissions(UnixFileAttributeViews.java:276)
		at java.base/java.nio.file.Files.setPosixFilePermissions(Files.java:2080)
		at jenkins.util.io.PathRemover.makeWritable(PathRemover.java:286)
		at jenkins.util.io.PathRemover.makeRemovable(PathRemover.java:259)
		at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:239)
		at jenkins.util.io.PathRemover.tryRemoveFile(PathRemover.java:205)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:216)
		at jenkins.util.io.PathRemover.forceRemoveRecursive(PathRemover.java:96)
		... 18 more
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: FAILURE

二、问题解决:

1、jenkins用户加入到root组

gpasswd -a root jenkins


2、编辑文件/etc/sysconfig/jenkins

(1)Ubuntu下操作

vim /etc/default/jenkins

JENKINS_USER="root"
JENKINS_GROUP="root"

(2)centos下操作

vim /etc/sysconfig/jenkins

3、重启jenkins

systemctl restart jenkins

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Lion King

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值