2014-09-09 3 views
5

삭제, 콘솔이 오류를보고 :java.nio.file.DirectoryNotEmptyException 젠킨스 작업을 실행할 때 lastStable/lastSuccessful 젠킨스

java.nio.file.DirectoryNotEmptyException: C:\jenkins\jobs\My Job\lastSuccessful 
    at sun.nio.fs.WindowsFileSystemProvider.implDelete(Unknown Source) 
    at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(Unknown Source) 
    at java.nio.file.Files.deleteIfExists(Unknown Source) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    at java.lang.reflect.Method.invoke(Unknown Source) 
    at hudson.Util.createSymlinkJava7(Util.java:1194) 
    at hudson.Util.createSymlink(Util.java:1112) 
    at hudson.model.Run.createSymlink(Run.java:1846) 
    at hudson.model.Run.updateSymlinks(Run.java:1827) 
    at hudson.model.Run.execute(Run.java:1738) 
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 
    at hudson.model.ResourceController.execute(ResourceController.java:89) 
    at hudson.model.Executor.run(Executor.java:240) 
ln builds\lastStableBuild C:\jenkins\jobs\My Job\lastStable failed 
java.nio.file.DirectoryNotEmptyException: C:\jenkins\jobs\My Job\lastStable 
    at sun.nio.fs.WindowsFileSystemProvider.implDelete(Unknown Source) 
    at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(Unknown Source) 
    at java.nio.file.Files.deleteIfExists(Unknown Source) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    at java.lang.reflect.Method.invoke(Unknown Source) 
    at hudson.Util.createSymlinkJava7(Util.java:1194) 
    at hudson.Util.createSymlink(Util.java:1112) 
    at hudson.model.Run.createSymlink(Run.java:1846) 
    at hudson.model.Run.updateSymlinks(Run.java:1828) 
    at hudson.model.Run.execute(Run.java:1738) 
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 
    at hudson.model.ResourceController.execute(ResourceController.java:89) 
    at hudson.model.Executor.run(Executor.java:240) 

이 버그 내가 해결해야 할 일입니까?

+0

는 그것뿐만 아니라 발생합니까? – Henry

답변

3

는 문제가 나타납니다. 홈 폴더를 복사 할 때이 문제가 나타납니다.

여기에서이 link은 이러한 잘못된 디렉토리를 수정하는 방법을 설명합니다.

# Logon on the master where you have the issue 
ssh jenkins-machine 
# Shutdown the jenkins master (take care that nothing is running) 
sudo service jenkins stop 
# Find all erroneous directories 
find /opt/jenkins/jobs -type d \(-name "last*Build" -o -name "lastStable" -o -name "lastSuccessful" \) 
# Review the list of erroneous directories 
# Rename them 
find /opt/jenkins/jobs -type d \(-name "last*Build" -o -name "lastStable" -o -name "lastSuccessful" \) -exec mv {} {}.err \; 
# Restart jenkins 
sudo service jenkins start 

그리고 그것은 작동하는 경우, 이동 된 디렉토리를 제거 : 나는 나중에 참조 할 수 있도록 여기에 단계를 복사

작업 이름은 공백을 포함하지 않는 경우
#In the future you can delete these directory if everything is fine with 
find /opt/jenkins/jobs -type d -name "*.err" -exec rm -rf {} \; 
+0

이 스크립트는 jenkins home이'/ opt/jenkins'에 있다고 가정합니다. '/ var/lib/jenkins' 또는 현재 젠킨스 경로로 변경하십시오. – JorgeHortelano