-
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
error building image: error building stage: lstat /tmp/apt-key-gpghome.VoPBz66R2g/gnupg_spawn_agent_sentinel.lock: no such file or directory #769
Comments
I'm seeing the same issue with the Running the following: for dir in $(ls -p contexts | grep -i '/')
do
tag=$(echo $dir | cut -d'/' -f1)
echo "building $tag..."
/kaniko/executor --context $CI_PROJECT_DIR/contexts/$tag/ \
--dockerfile $CI_PROJECT_DIR/contexts/$tag/Dockerfile \
--destination $repo/google-chrome:$tag \
--no-push
done Folder structure looks like the following:
|
Getting same kind of error here:
Any solution? |
Thanks @fabn, i will take a look at this. |
I have the same problem, also with the
I feel like the error is related to chrome installation inside image but not sure of that. |
@Neonox31 that was my first thought but same dockerfile builds in native docker with no issues |
@fabn Yes, but I think the conflict is between kaniko and chrome. |
I can confirm it's about the chrome install. When I just remove Chrome (google-chrome-unstable in my case) from the list of packages installed by apt-get, kaniko is able to build the image |
I'm experiencing a similar issue with a gradle container:
When I enabled debug logging the issue disappeared. I suspect it might be a race condition but I have no experience to further investigate. |
i will take a look at this tomorrow. |
Exactly the same thing while building huge (3gb) container with gradle&android sdk:
|
any progress on this one? |
Same error here, I'm trying to build a danlynn/ember-cli image on Gitlab CI… |
@jandillmann @fabn
So now my entire Dockerfile looks like this:
I'm not exactly sure why we need to clean out the lists directory beforehand, but the source of the solution comes from the owner of this issue: #793 |
Hey @olivierboudet, @jandillmann, @HerrmannHinz , @drshrey, @EppO, @Neonox31, @fabn , @nielsdenissen Thanks a again! |
@tejal29: I can test it on my side too if this helps, thanks! |
Thanks a lot @EppO. I pushed the following images with the fix
|
@olivierboudet i did verify your dockerfile at my end and its works. Do you want to give it a try with
|
Great! This fix will available in next release in about an hour! |
Sorry, i am going to push the release to monday since could not get done in the am. Thanks |
Hey folks, Release v0.17.0 is now up! Please use the latest image and let us know if you still see this issue! Thank you for your patience! |
I just hit this ...
I'm using GCB,
|
that may be the same as #830 |
@nielsvanvelzen did you ever manage to solve the kotlin daemon issue? A possible fix may be to disable Kotlin daemon with |
@elnygren As I needed the image to work fast I added a sleep command (for 10 seconds) and everything worked fine (hence my suspicion it was a race-condition). I haven't tried it yet with the fixed image. |
Today I got some strange errors. Any ideas?
|
Same problem here |
This is fixed in v0.17.0. |
Faced the similar issue with v0.24.0
|
I'm getting this as well with gradle and kotlin |
This workaround worked for kotlin + gradle: #769 (comment) |
Thanks @k for confirming the workaround. |
Getting this error on
Dockerfile to reproduce: FROM amazonlinux:latest
# Installing Python3
RUN yum install -y python3
# Clean yum cache
RUN yum clean all
# copy requirements.txt to tmp folder
ADD requirements.txt /tmp
# copy script to system
ADD script.py /usr/bin/
# install script's dependencies
RUN pip3 install -r /tmp/requirements.txt -q |
To fix both errors reported by @caseycs and @nielsvanvelzen
that are common for many java/kotlin projects, just add both following env variables to your ENV GRADLE_OPTS -Dkotlin.compiler.execution.strategy="in-process"
ENV JAVA_OPTS -XX:-UsePerfData |
Looks like the whole issue is just about kaniko design problems. Build tool that requires all the filesystem outside the build context to be consistent looks awful for me. Probably the better alternative is already existing, i hope you will find something for you https://blog.alexellis.io/building-containers-without-docker/ |
Also the |
Worked for me |
I'm experiencing this problem in Digital Ocean. Builds fail sporadically. Does it mean that Digital Ocean is using Kaniko to build my app from a Dockerfile? |
I unfortunately also got this error for a Kotlin Gradle build in GitLab CI.
FROM gradle:7.4-jdk17-alpine AS GRADLE_TOOL_CHAIN
WORKDIR /home/gradle/src
COPY --chown=gradle:gradle . /home/gradle/src
RUN gradle --no-daemon --refresh-dependencies clean build any updates on this? |
Still encountering this fairly often with Kotlin. If kaniko fails to snapshot a file because it doesn't exist, it should just ignore this, as the file no longer exists, so no longer needs snapshotting... That said, my intuition would be that the issue is caused by kaniko not waiting for all processes in the RUN to be fully stopped. It should probably ensure these are properly signalled to stop then waited upon. |
@HeneryHawk Are you fix you error? I have same error |
Issue closed, but the bug is still there.
It is very intermittent. Sometimes just one retry is enough, and the next execution is successful. Today I had a case where we retried multiple times, and several hours later it eventually started working again. The mitigation factors that we applied were removed, but it kept succeeding, which shows we did not fix it, it just fixed itself after some hours. |
Getting the same error with
Before this change we had |
I get this error with Kaniko a few times per week. Reporting my team's configuration here in case it helps folks draw connections;
|
Having the same issue as @nickv2002 |
Having same issue. Tried Gradle 8.5 and 8.7 but still failing. I cannot downgrade to Gradle 7 since our app is Java 21. |
In my case, it helped to add |
Actual behavior
I am trying to build a Dockerfile which is built correctly with docker daemon.
I have this error :
Expected behavior
As it works with docker daemon, I expect that the build is also OK with kaniko without changing the dockerfile.
To Reproduce
Use this Dockerfile in a builder-node directory
Run it :
Additional Information
make image
from commitd67a8225031f2809f0d6c8c4f1825f233d8574a1
:The text was updated successfully, but these errors were encountered: