-
-
Notifications
You must be signed in to change notification settings - Fork 384
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
Cannot run pipeline on Kubernetes: CreateContainerError #2510
Comments
Is there
Can you create some folder under Test pipeline below, please:
Does it work?
What if disable AppArmor? |
Thanks for looking into this! Ok, I tried using the given test pipeline, and I get the same error. My Pod events look like this (note that I had to switch to the AWS registry as I got rate limited by docker hub):
Since the container is failing at such an early stage (the container never gets created), it's really difficult for me to get a shell to check what the file system looks like. The approach I wound up taking was this:
I wanted to show the process to see if you think this is a valid approach to debugging and also as a reference for me since it took me a while to figure it out. :) Now that I have a shell on the debug pod I can answer a couple of your questions:
By the way, if I look at the logs from the completed container it does appear to have run successfully:
Let me know if there's any other debugging I can do on my end. As far as I can tell the working dir needs to exist before the container is started and on my system it doesn't. I'm not sure what's responsible for creating it, but maybe an |
Nice debug approach, thanks for sharing 👍
Although I don't think now that AppArmor is the cause of an error, but I meant completely disabling it temporarily. Because when you use local path provisioner with SELinux, there should be some policies and K3S had issues with that. Besides, I've found similar issue in Podman. Taking into account this bug test, please, pipeline overriding workspace:
It should generate pod like:
As I understand correctly, it depends on container runtime. I guess, CRI-O (like Podman) just throws error, but Containerd creates subfolder. BTW,
Good idea! Try this one also. |
Yahtzee! the I'm not sure if this should be considered a documentation issue (e.g. CRI-O users need to configure the workspace manually). Or, if some change can/should be made to the kubernetes backend. It seems like out-of-the-box CRI-O support would be nice, but, unfortunately, I'm not a go programmer, so I wouldn't be able to help much with a PR. Secondary question: Now that I'm unstuck, I'm running into a new error trying to get my buildah container to run. I think it might be due to the
Is it not possible to set the security context via the pipeline config? Or, am I just doing it wrong? I can also open a separate issue about this if that would be preferrable. |
Run InitContainer with
If you write installation manual, then link in the Posts & tutorials would be right place, I think. Anyway, this issue looks like documentation by itself. Should be asked in Discussions or Matrix/Discord ;)
🤣 You're not the first and not the last, I believe. As always, I push people to use kaniko 😄
No (almost), only Resources, serviceAccountName, nodeSelector, tolerations and Volumes by now. But you can run in Privileged mode. |
Ok, I experimented a bit more buildah and I have a working test implementation running on my cluster. I would just need a couple of additional configuration options to make it work with Woodpecker. I opened #2545 to discuss that. I have looked at kaniko a few times, but I really like that buildah lets me use a regular shell script to build my container images. I don't want to learn/workaround all of the gotchas that come with the Dockerfile format. I'll leave this open for the time being in case you do want to implement an initContainer on the clone step. It seems like a good idea to me as it can't really hurt the current user base, and it would make CRI-O work out of the box. But, as you say, this isn't really a huge userbase right now. For the time being I opened a PR to add a bit of documentation about this to the main docs website. |
CRI-O currently requires some additional config for pipelines to run. See woodpecker-ci#2510
The problem is the clone step doesn't always exist. If run init container only for clone step and set Or should we consider InitContainer approach
Clone plugin approach
Then
What if I have custom workspace?
Why does my container run in Another concern is the issue with not creation of working dir is not unique for Kubernetes, but also exists in Podman at least. And if we implement Podman backend (PR or FR exists here), should we duplicate that tricky logic? The best solution would be some option on |
CRI-O currently requires some additional config for pipelines to run. This adds some basic documentation to the kubernetes section explaining the issue. See #2510
That does get a bit more complicated than I originally thought. That said, at the end of the day the problem is that we need to make sure the I think the problem with implementing a fix at the |
As I understand, problem is What runtime do you use? I use
Yep, portion that is broken. Another part (
Nothing (almost) is impossible. Let's hear from other developers. |
Good point. I am using It would be a pretty big project for me to configure a cluster to run CRI-O with |
Interesting update from the CRI-O devs here. It appears that this behavior is not by design and they would be open to a PR to fix it. Again, go isn't my thing, so this might be out of reach for me. But, at the very least we know a fix would be welcome. |
Component
agent
Describe the bug
I'm trying to get started with the Kubernetes backend (installed via the official helm chart). When I try to run a pipeline, the container gets stuck with CreateContainerError.
After some debugging, it seems like the issue is related to the
spec.workingDir
being set to a directory that doesn't exist at the time that the container is starting. I'm not exactly an expert here, but maybe we could leave the working dir unset and then change directories after the repo is cloned?I can provide more debugging information, if that would be help.
System Info
This is a vanilla Kubernetes 1.28.2 cluster installed via kubeadm. The nodes are Debian 12. The container runtime is CRI-O which was installed following the install guide here.
Additional context
I'm running CRI-O (I'm not sure if that's relevant), and I discussed this issue a bit on the CRI-O repo here.
I'm using Forgejo as my forge. If I comment out the
spec.workingDir
in the Pod yaml and attempt to run the Pod manually I get an error like:I'm not sure if that's another issue or somehow related, but I thought it was worth mentioning.
Validations
next
version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]The text was updated successfully, but these errors were encountered: