Overview
When updating CircleCI Server from version 4.8.6, you might encounter a CrashLoopBackOff error with the oidc-service pod. This issue arises due to a change in the execution command for the oidc-service container, which results in the container failing to start because it cannot find /bin/sh.
kubelet Error: failed to create containerd task: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: exec: "/bin/sh": stat /bin/sh: no such file or directory: unknown
Prerequisites
Access to your Kubernetes cluster where CircleCI Server is deployed.
Basic knowledge of using
kubectlto manage Kubernetes resources.
Solution
To resolve the CrashLoopBackOff error, you need to modify the deployment configuration for the oidc-service pod. Follow these steps:
Edit the Deployment: Use the following command to edit the
oidc-servicedeployment:kubectl edit deploy oidc-service -n circleci-serverModify the Command and Args: In the deployment configuration, locate the
commandandargsfields. Deleteargsand change the command to/app
Change them as follows:Before:
command: ['/bin/sh'] args: ['-c', './server']
After:
command: ['/app']
Save and Exit: After making the changes, save the file and exit the editor. This will trigger a rolling update of the deployment.
Verify the Update: Check the status of the pods to ensure the new pod is running successfully:
kubectl get pods -n circleci-server