-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jib Cache Selector - FileAlreadyExistsException #3572
Comments
That would be a good experiment, if your environment allows it. |
The above corruption is in a project that:
I'll try disabling parallel first. According to this link: #1956 (comment) it looks like we're using our local cache, since the cache directory above is stated to be in the build directory? It seems given this, that |
That's correct; @chanseokoh was just explaining to me why |
Tried used "--no-parallel", the build still failed. java.nio.file.FileAlreadyExistsException: /var/lib/jenkins/workspace/_api_feature_GUL-5452_gspsupport/server/build/jib-cache/selectors/2cadfb6605804ff1e49f11ea4b53bca7e7f40548af5a1c9c2c5f5cc744f29cde |
Tried adding the clean task to the Gradle command. Build still fails. I can see that the clean task does delete the build directory and that the jib-cache is exclusive for the submodule. |
@tlefevre Try also setting |
What we see from the log:
The line 473 where the exception is thrown is jib/jib-core/src/main/java/com/google/cloud/tools/jib/cache/CacheStorageWriter.java Lines 472 to 474 in ff75462
It's after Jib got AtomicMoveNotSupportedException , so it's almost certain that the directory /var/lib/jenkins/workspace/_api_feature_GUL-5452_gspsupport/server/build/jib-cache/selectors/2cadfb6605804ff1e49f11ea4b53bca7e7f40548af5a1c9c2c5f5cc744f29cde is on the filesystem that doesn't support atomic move (e.g., network filesystem).
|
I finally got a hold of someone that could explain a bit more how our Jenkins VMs are put together and there are no available physical discs on them. It's all network filesystems, we have no option of adding physical drives. Do you have any recommendations? I don't remember this always being an issue. It appears exclusively, we think, in building Grails applications. We also have a lot of Spring Boot applications that do not have the same error. The difference with Grails is that we have to depend on a few compile tasks, then add extra directories. This could potentially introduce more points into the build where we can get a failure. |
Jib is ultimately limited by what the filesystem can do as far as atomic operations. |
We found the issue. An extra directory was duplicated, which caused this issue. Took us a bit to find it. Thanks for all your help and sorry for the trouble :) |
That's excellent! How did you end up narrowing down the issue? |
We figured that every time a layer got added it'd introduce a risk, which would most likely be connected to the extraDirectories functionality so we figured we'd take a closer look at that. |
FTR, as a last resort, once can completely disable concurrency by setting the system/Maven property (e.g., |
@tlefevre Hi, we are having the same issue. |
I said so in the comment just before I closed the issue. Check your extra directories or see if Jib is trying to access the same file repeatedly. |
Environment:
Description of the issue:
Builds will randomly fail with a FileAlreadyExistsException. It's unclear what unsticks it, it's quite flaky.
Expected behavior:
The build to complete succesfully.
Steps to reproduce:
Log output:
Caused by: com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: /var/lib/jenkins/workspace/GUL_mock-dataservice_master/build/jib-cache/selectors/86a92a1db96dde1836553acbe913013699c4976077907f3f71d15bc5d034820f
at com.google.cloud.tools.jib.plugins.common.JibBuildRunner.runBuild(JibBuildRunner.java:285)
at com.google.cloud.tools.jib.gradle.BuildDockerTask.buildDocker(BuildDockerTask.java:125)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
... 114 more
Caused by: java.nio.file.FileAlreadyExistsException: /var/lib/jenkins/workspace/GUL_mock-dataservice_master/build/jib-cache/selectors/86a92a1db96dde1836553acbe913013699c4976077907f3f71d15bc5d034820f
at com.google.cloud.tools.jib.cache.CacheStorageWriter.writeSelector(CacheStorageWriter.java:473)
at com.google.cloud.tools.jib.cache.CacheStorageWriter.writeUncompressed(CacheStorageWriter.java:295)
at com.google.cloud.tools.jib.cache.Cache.writeUncompressedLayer(Cache.java:144)
The text was updated successfully, but these errors were encountered: