0

I’m getting CreateContainerErrors for cron jobs and I want to better understand why this would happen in the container runtime.

I know this is an issue in the container runtime (docker-engine v20.10.6) because it is the only possible common cause (see the common causes here). Specifically, subsequent containers are able to startup without issue.

The errors say something like:

Error from server (BadRequest): container "my-container" in pod "my-cron-27911235-69t4m" 
is waiting to start: CreateContainerError

kubectl describe doesn't provide much more insight

...
    State:          Waiting
      Reason:       CreateContainerError
    Ready:          False
    Restart Count:  0
...

I'm running v1.22.15-gke.2500 on GCP.

Any help would be appreciated. Thanks!

digitalnomd
  • 1,380
  • 12
  • 21
  • 1
    CreateContainerConfigError and CreateContainerError are two errors that occur when a Kubernetes tries to create a container in a pod, but fails before the container enters the Running state. Refer to this [Blog1](https://containersolutions.github.io/runbooks/posts/kubernetes/create-container-error/) and [Blog2](https://komodor.com/learn/how-to-fix-createcontainerconfigerror-and-createcontainer-errors/) which help you in addressing this issue and few work arounds are explained. – Hemanth Kumar Feb 07 '23 at 09:26
  • Apart from this, you may need to check the pod's container images to ensure that they are up to date. If you are still having difficulty, you can try restarting the pod or deleting and recreating the container if possible. – Hemanth Kumar Feb 07 '23 at 09:26
  • @HemanthKumar I'm pretty sure this is an error in the container runtime because subsequent containers are able to startup with the same configuration. I updated the description based on these findings and I'm not trying to understand why this would happen within the container runtime. – digitalnomd Feb 07 '23 at 17:48
  • could refer to this [doc1](https://cloud.google.com/kubernetes-engine/docs/troubleshooting/container-runtime) and [doc2](https://www.containiq.com/post/fixing-createcontainererror-and-createcontainerconfigerror) might get some insights on this issue. – Hemanth Kumar Feb 09 '23 at 09:11

0 Answers0