Skip to content
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

Updated unit file depends on containerd w/o installing it first #1088

Closed
ghost opened this issue Dec 24, 2019 · 3 comments
Closed

Updated unit file depends on containerd w/o installing it first #1088

ghost opened this issue Dec 24, 2019 · 3 comments
Assignees

Comments

@ghost
Copy link

ghost commented Dec 24, 2019

Cookbook version

docker@4.11.0

Chef-client version

Chef 12.18.31

Platform Details

x86_64-linux, Ubuntu 16.04 / xenial

Scenario:

The docker service will no longer start. It returns the errors:

Failed to start docker.service: Unit containerd.service not found.```

```journalctl -u docker
-- Logs begin at Mon 2019-12-23 19:33:56 UTC, end at Tue 2019-12-24 00:44:19 UTC. --
systemd[1]: Starting Docker Application Container Engine...
sysctl[1143]: net.ipv4.ip_forward = 1
sysctl[1174]: net.ipv6.conf.all.forwarding = 1
dockerd[1183]: time="2019-12-23T19:33:59.636335349Z" level=info msg="parsed scheme: \"unix\"" module=grpc
dockerd[1183]: time="2019-12-23T19:33:59.636382928Z" level=info msg="scheme \"unix\" not registered, fallback to default schem
dockerd[1183]: time="2019-12-23T19:33:59.636538034Z" level=info msg="ccResolverWrapper: sending new addresses to cc: [{unix://
dockerd[1183]: time="2019-12-23T19:33:59.636556612Z" level=info msg="ClientConn switching balancer to \"pick_first\"" module=g
dockerd[1183]: time="2019-12-23T19:33:59.636590979Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc4201f2790
dockerd[1183]: time="2019-12-23T19:34:20.087425946Z" level=warning msg="grpc: addrConn.createTransport failed to connect to {u
dockerd[1183]: time="2019-12-23T19:34:20.087567189Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc4201f2790
dockerd[1183]: time="2019-12-23T19:34:20.088252926Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc4201f2790
dockerd[1183]: time="2019-12-23T19:34:40.088511385Z" level=warning msg="grpc: addrConn.createTransport failed to connect to {u
dockerd[1183]: time="2019-12-23T19:34:40.089207558Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc4201f2790
dockerd[1183]: time="2019-12-23T19:34:40.089592965Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc4201f2790
dockerd[1183]: Failed to connect to containerd: failed to dial "/run/containerd/containerd.sock": context deadline exceeded
systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: Failed to start Docker Application Container Engine.
systemd[1]: docker.service: Unit entered failed state.
systemd[1]: docker.service: Failed with result 'exit-code'.
systemd[1]: docker.service: Service hold-off time over, scheduling restart.
systemd[1]: docker.service: Failed to schedule restart job: Unit containerd.service not found.
systemd[1]: docker.service: Unit entered failed state.
systemd[1]: docker.service: Failed with result 'resources'.```

The cookbook's installed package `docker-ce` doesn't automatically install `containerd` but now the cookbook writes a systemd service which expects it. Here's the installed package's spec which doesn't include `containerd`:

```dpkg-query -s docker-ce
Package: docker-ce
Status: install ok installed
Priority: optional
Section: admin
Installed-Size: 193092
Maintainer: Docker <support@docker.com>
Architecture: amd64
Version: 18.06.1~ce~3-0~ubuntu
Replaces: docker-engine
Depends: iptables, init-system-helpers (>= 1.18~), lsb-base (>= 4.1+Debian11ubuntu7), libc6 (>= 2.17), libdevmapper1.02.1 (>= 2:1.02.97), libltdl7 (>= 2.4.6), libseccomp2 (>= 2.3.0), libsystemd0
Recommends: aufs-tools, ca-certificates, cgroupfs-mount | cgroup-lite, git, pigz, xz-utils, apparmor
Conflicts: docker (<< 1.5~), docker-ee, docker-engine, docker-engine-cs, docker.io, lxc-docker, lxc-docker-virtual-package
Conffiles:
 /etc/default/docker 82d6a44e99db1a3b74f7835e4f5e1b01
 /etc/init.d/docker e593c2ca26facbf89018d4c708738c97
 /etc/init/docker.conf 123f7e2b4078fa11b4eecc4c4f9bdc25
Description: Docker: the open-source application container engine
 Docker is an open source project to build, ship and run any application as a
 lightweight container
 .
 Docker containers are both hardware-agnostic and platform-agnostic. This means
 they can run anywhere, from your laptop to the largest cloud compute instance and
 everything in between - and they don't require you to use a particular
 language, framework or packaging system. That makes them great building blocks
 for deploying and scaling web apps, databases, and backend services without
 depending on a particular stack or provider.
Homepage: https://www.docker.com```

### Steps to Reproduce:
1. run recipe[docker::default]
2. `systemctl start docker`

### Expected Result:
I expect docker to be running.

### Actual Result:
Docker is not running. It can be fixed by manually installing `containerd` and restarting.

```sudo apt install containerd
sudo systemctl start docker # works now```

This cookbook shouldn't depend on containerd or should provide it.
@welcomebot
Copy link

Hey There
It looks like this is the first issue you've filed against the chef-cookbooks project. I'm here to offer you a bit of extra help to make sure we can quickly get back to you.
Make sure you've filled out all the fields in our issue template. Make sure you've provided us with the version of chef-client you're running, your operating system and the version of the cookbook. If you're not using the most up to date version of the cookbook then please make sure to update first. Lots of things change between versions even if you're issue isn't listed in the changelog. Finally please give us a detailed description of the issue you're having. The more we know about what you're trying to do, what actually happens, and how you can reproduce the problem, the better.

If you're looking for more immediate troubleshooting help make sure to check out #general on the Chef Community Slack. There's plenty of folks there willing to lend a helping hand. Thanks for the first issue. We hope we can get back to you soon with a solution.

@kapilchouhan99 kapilchouhan99 self-assigned this May 27, 2020
@kapilchouhan99 kapilchouhan99 pinned this issue May 27, 2020
@kapilchouhan99
Copy link

kapilchouhan99 commented May 27, 2020

@mgruberman Could you please check it on the latest version?
because it fixed on the latest version.

@kapilchouhan99
Copy link

It's working on the latest version of the Docker cookbook, So closing this issue.

If you are still facing this issue, you can reopen it.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants