containerd / containerd/nerdctl
Unable to Restart the Container via the `nerdctl restart` comamnd
- Dominant language
- Go
- Stars
- 10.4k
- Forks
- 826
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 44
Description
### Description
As per the document, the `nerdctl restart` should let me restart one or more containers running on the system. However, when I try to do that with the `containerd` based infra, it runs into a fatal error.
```bash
root@tardis-169-254-6-46:/var/run/docker/containerd/daemon/io.containerd.runtime.v2.task/k8s.io# nerdctl ps | grep metrics-server
3eb77b051f92 myregistry.gallifrey.com/gallifrey-docker/pause:3.6 "/pause" 2 days ago Up k8s://kube-system/metrics-server-6c8bbfdb57-gz6sx
ff39a309f6d8 myregistry.gallifrey.com/gallifrey-docker/metrics-server:2.0.3 "/metrics-server --r…" 9 seconds ago Up k8s://kube-system/metrics-server-6c8bbfdb57-gz6sx/metrics-server
root@tardis-169-254-6-46:/var/run/docker/containerd/daemon/io.containerd.runtime.v2.task/k8s.io# nerdctl restart ff39a309f6d8
FATA[0010] failed to start shim: mkdir /var/run/docker/containerd/daemon/io.containerd.runtime.v2.task/k8s.io/ff39a309f6d85bf50e98ca59600739b6bfbac4452d8f7cbca57f92e56d26dff5: file exists: unknown
```
### Steps to reproduce the issue
1. Create Kubernetes cluster with Containerd based CRI
2. Use `nerdctl restart` to restart any non pause container of the pod in the node
Below is the config of the `containerd` Daemon
```toml
version=2
root = "/data/docker/containerd/daemon"
state = "/var/run/docker/containerd/daemon"
oom_score = -500
required_plugins = ["io.containerd.grpc.v1.cri"]
[grpc]
uid = 0
gid = 0
max_recv_message_size = 16777216
max_send_message_size = 16777216
[debug]
uid = 0
gid = 0
level = "info"
[metrics]
address = "localhost:1414"
grpc_histogram = true
[cgroup]
path = ""
[plugins]
[plugins."io.containerd.grpc.v1.cri"]
stream_server_address = "127.0.0.1"
max_container_log_line_size = 262144
sandbox_image = "myregistry.gallifrey.com/gallifrey-docker/pause:3.6"
[plugins."io.containerd.grpc.v1.cri".cni]
bin_dir = "/opt/cni/bin"
conf_dir = "/etc/cni/net.d"
conf_template = "/etc/cni/net.d/10-calico.conflist"
[plugins."io.containerd.grpc.v1.cri".containerd]
default_runtime_name = "runc"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
runtime_type = "io.containerd.runc.v2"
```
### Describe the results you received and expected
I want the container to be restart without a Fatal Error.
```bash
root@tardis-169-254-6-46:/var/run/docker/containerd/daemon/io.containerd.runtime.v2.task/k8s.io# nerdctl restart ff39a309f6d8
FATA[0010] failed to start shim: mkdir /var/run/docker/containerd/daemon/io.containerd.runtime.v2.task/k8s.io/ff39a309f6d85bf50e98ca59600739b6bfbac4452d8f7cbca57f92e56d26dff5: file exists: unknown
```
### What version of nerdctl are you using?
```bash
WARN[0000] unable to determine buildctl version: exec: "buildctl": executable file not found in $PATH
Client:
Version: v0.22.0
OS/Arch: linux/amd64
Git commit: 8e278e2aa61a89d4e50d1a534217f264bd1a5ddf
builctl:
Version:
Server:
containerd:
Version: 1.6.6
GitCommit: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
runc:
Version: 1.1.2
GitCommit: v1.1.2-0-ga916309
```
### Are you using a variant of nerdctl? (e.g., Rancher Desktop)
NO
### Host information
```bash
Client:
Namespace: k8s.io
Debug Mode: false
Server:
Server Version: 1.6.6
Storage Driver: overlayfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Log: fluentd journald json-file
Storage: aufs native overlayfs
Security Options:
seccomp
Profile: default
Kernel Version: 5.4.0-122-generic
Operating System: Ubuntu 18.04.6 LTS
OSType: linux
Architecture: x86_64
CPUs: 12
Total Memory: 19.55GiB
Name: tardis-169-254-6-46
ID: 99bbe607-8a58-4737-8f7f-86b82d853867
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.