JenkinsパッケージAndroidエラー問題

2771 ワード

最近プロジェクト用のjenkinsパッケージに問題が発生し、次のようにエラーが発生しました.
·····························
·····························
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/)
·····························
·····························
いろいろな を して、ずいぶん がかかりました.キーワードが っていないのか、 を した だ. がかりが つかりました:
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 denied
at 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 more

After some research, it turned out that

$ ls -ald /tmp
drwxr-xr-x 8 root root 1024 2011-11-27 16:34 /tmp

Hummmm.... 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

はい、テストしてみます. は です. が した.これからの が って、この を することができて、 に を して、 し を やさないことを んでいます.