jenkins 打包Android 错误问题

  • 时间:2022-03-15 15:02 作者:小追兵 来源: 阅读:400
  • 扫一扫,手机访问
摘要:最近项目用的jenkins打包出现了问题,报错如下,·························································· pre class=”console output” style=”font style: normal; font varian

最近项目用的jenkins打包出现了问题,报错如下,

··························································<pre class="console-output" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none; box-sizing: border-box; white-space: pre-wrap; word-wrap: break-word; margin: 0px; caret-color: rgb(51, 51, 51); color: rgb(51, 51, 51); font-size: 13px;">Starting a Gradle Daemon (subsequent builds will be faster)Parallel execution with configuration on demand is an incubating feature.FAILURE: Build failed with an exception.* What went wrong:A problem occurred configuring root project 'Android_dev'.> Could not resolve all dependencies for configuration ':classpath'.   > java.io.IOException: Permission denied* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.* Get more help at [https://help.gradle.org](https://help.gradle.org/)</pre>··························································

在各种找问题,花费了不少时间。可能是关键词没有找对,在经历了九九八十一难之后。找到了线索:

I've just installed Jenkins onto Tomcat which already has other webapps running properly.When I try to build a Maven job, it gives me an exception as below (only the relevant part of it!):Caused by: java.io.IOException: Permission deniedat java.io.UnixFileSystem.createFileExclusively(Native Method)at java.io.File.checkAndCreate(File.java:1704)at java.io.File.createTempFile(File.java:1792)at java.io.File.createTempFile(File.java:1828)at hudson.remoting.RemoteClassLoader.createTempDir(RemoteClassLoader.java:281)at hudson.remoting.RemoteClassLoader.makeResource(RemoteClassLoader.java:262)at hudson.remoting.RemoteClassLoader.findResource(RemoteClassLoader.java:194)... 31 moreAfter some research, it turned out that$ ls -ald /tmpdrwxr-xr-x 8 root root 1024 2011-11-27 16:34 /tmpHummmm.... That's why a temporary file could not be created!After I changed permissions to 777, all jobs started to execute as expected.So, I have two suggestions... either one you find more convenient:1. Make sure that temporary files are created under JENKINS_HOME/tmp, not /tmp;2. Perform sanity checks just after installation and after a configuration screen which stresses all known configuration issues, etc... telling the user that something needs to be remediated.

问题是说,由于jenkins这个客户没有权限读取/tmp ,我之前看错误也知道是权限问题,可是不知道是哪个目录,哪个文件,什么地方的权限问题。这里说是/tmp目录眼前一亮。

我们看下原有的权限吧;

drwx------   3 root root  4096 Oct 12 21:17 tmp

很显著jenkins客户没有权限。我们改 /tmp 的权限吧。

chown  jenkins /tmp/

修改完的结果如下:

drwx------   5 jenkins root  4096 Oct 12 21:45 tmp

好了,我们测试下,结果有效。问题处理了。希望以后的同学遇到了,能搜索到这个文章,快速处理问题,少花费些时间。

  • 全部评论(0)
最新发布的资讯信息
【系统环境|】2025含金量排名前十计算机专业证书(2025-10-15 20:51)
【系统环境|】你有白帽众测 我有黑帽雇佣(2025-10-15 20:50)
【系统环境|】印度理工学院成功开发出针对5G网络攻击的最新软件解决方案(2025-10-15 20:49)
【系统环境|】道德黑客与黑客教程(2025-10-15 20:49)
【系统环境|】苹果翻车!macOS 15 竟藏“后门”,黑客能直接偷你所有密码(2025-10-15 20:47)
【系统环境|】解密“被墙”玄学:为什么我的网络方案能做到长期稳定?(2025-10-15 20:46)
【系统环境|】NAS软路由/防火墙/网络安全需要注意哪些?如何保护你的网络设备(2025-10-15 20:45)
【系统环境|】你真的理解防火墙吗?(2025-10-15 20:44)
【系统环境|】苹果手机一键换机教程详解(2025-10-15 20:44)
【系统环境|】二手iPhone到手后怎么快速验机?(2025-10-15 20:43)
手机二维码手机访问领取大礼包
返回顶部