Drone

Problems with docker plugin

Hi,

when I try to publish an image with plugins/docker I get the following error:

Client:
 Version:           18.09.0
 API version:       1.39
 Go version:        go1.10.2
 Git commit:        4d60db4
 Built:             Wed Nov  7 00:49:20 2018
 OS/Arch:           linux/arm
 Experimental:      false
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

But drone itself has no probblem connecting to docker.sock.

But drone itself has no problem connecting to docker.sock.

Drone connects to the host machine docker socket. This plugin does not; it starts docker-in-docker.

Then what could be the reason for it not connecting?

Would you mind sharing the yaml where you define the step? I use the plugins/docker plugin frequently and can’t remember running into this error, maybe we’re using it differently.

This is my config (I push the images to my private registry):

kind: pipeline
name: default

platform:
  os: linux
  arch: arm

steps:
  - name: docker
    image: plugins/docker
    settings:
      repo: <registry>/<image>
      registry: <registry>
      tags: arm
      insecure: true

It worked well until I upgraded from 1.2.3 to 1.6.0.

This what I get when in turn on debug: true:

+ /usr/local/bin/dockerd --data-root /var/lib/docker --insecure-registry pi:5000 0s
2 time="2019-10-15T14:12:01.200811251Z" level=warning msg="could not change group /var/run/docker.sock to docker: group docker not found" 1s
3 time="2019-10-15T14:12:01.247619423Z" level=info msg="libcontainerd: started new containerd process" pid=38 1s
4 time="2019-10-15T14:12:01.247851246Z" level=info msg="parsed scheme: \"unix\"" module=grpc 1s
5 time="2019-10-15T14:12:01.247903694Z" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc 1s
6 time="2019-10-15T14:12:01.269964966Z" level=info msg="ccResolverWrapper: sending new addresses to cc: [{unix:///var/run/docker/containerd/containerd.sock 0 <nil>}]" module=grpc 1s
7 time="2019-10-15T14:12:01.270146060Z" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc 1s
8 time="2019-10-15T14:12:01.270479550Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0x14265d10, CONNECTING" module=grpc 1s
9 time="2019-10-15T14:12:01Z" level=info msg="starting containerd" revision=468a545b9edcd5932818eb9de8e72413e616e86e version=v1.1.2 1s
10 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.content.v1.content"..." type=io.containerd.content.v1 1s
11 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.snapshotter.v1.btrfs"..." type=io.containerd.snapshotter.v1 1s
12 time="2019-10-15T14:12:01Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.btrfs" error="path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.btrfs must be a btrfs filesystem to be used with the btrfs snapshotter" 1s
13 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.snapshotter.v1.aufs"..." type=io.containerd.snapshotter.v1 1s
14 time="2019-10-15T14:12:01Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.aufs" error="modprobe aufs failed: "ip: can't find device 'aufs'\nmodprobe: can't change directory to '/lib/modules': No such file or directory\n": exit status 1" 1s
15 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.snapshotter.v1.native"..." type=io.containerd.snapshotter.v1 1s
16 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.snapshotter.v1.overlayfs"..." type=io.containerd.snapshotter.v1 1s
17 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.snapshotter.v1.zfs"..." type=io.containerd.snapshotter.v1 1s
18 time="2019-10-15T14:12:01Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.zfs" error="path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.zfs must be a zfs filesystem to be used with the zfs snapshotter" 1s
19 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.metadata.v1.bolt"..." type=io.containerd.metadata.v1 1s
20 time="2019-10-15T14:12:01Z" level=warning msg="could not use snapshotter btrfs in metadata plugin" error="path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.btrfs must be a btrfs filesystem to be used with the btrfs snapshotter" 1s
21 time="2019-10-15T14:12:01Z" level=warning msg="could not use snapshotter aufs in metadata plugin" error="modprobe aufs failed: "ip: can't find device 'aufs'\nmodprobe: can't change directory to '/lib/modules': No such file or directory\n": exit status 1" 1s
22 time="2019-10-15T14:12:01Z" level=warning msg="could not use snapshotter zfs in metadata plugin" error="path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.zfs must be a zfs filesystem to be used with the zfs snapshotter" 1s
23 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.differ.v1.walking"..." type=io.containerd.differ.v1 1s
24 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.gc.v1.scheduler"..." type=io.containerd.gc.v1 1s
25 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.service.v1.containers-service"..." type=io.containerd.service.v1 1s
26 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.service.v1.content-service"..." type=io.containerd.service.v1 1s
27 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.service.v1.diff-service"..." type=io.containerd.service.v1 1s
28 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.service.v1.images-service"..." type=io.containerd.service.v1 1s
29 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.service.v1.leases-service"..." type=io.containerd.service.v1 1s
30 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.service.v1.namespaces-service"..." type=io.containerd.service.v1 1s
31 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.service.v1.snapshots-service"..." type=io.containerd.service.v1 1s
32 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.monitor.v1.cgroups"..." type=io.containerd.monitor.v1 1s
33 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.runtime.v1.linux"..." type=io.containerd.runtime.v1 1s
34 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.service.v1.tasks-service"..." type=io.containerd.service.v1 1s
35 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.grpc.v1.containers"..." type=io.containerd.grpc.v1 1s
36 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.grpc.v1.content"..." type=io.containerd.grpc.v1 1s
37 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.grpc.v1.diff"..." type=io.containerd.grpc.v1 1s
38 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.grpc.v1.events"..." type=io.containerd.grpc.v1 1s
39 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.grpc.v1.healthcheck"..." type=io.containerd.grpc.v1 1s
40 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.grpc.v1.images"..." type=io.containerd.grpc.v1 1s
41 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.grpc.v1.leases"..." type=io.containerd.grpc.v1 1s
42 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.grpc.v1.namespaces"..." type=io.containerd.grpc.v1 1s
43 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.grpc.v1.snapshots"..." type=io.containerd.grpc.v1 1s
44 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.grpc.v1.tasks"..." type=io.containerd.grpc.v1 1s
45 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.grpc.v1.version"..." type=io.containerd.grpc.v1 1s
46 time="2019-10-15T14:12:01Z" level=info msg="loading plugin "io.containerd.grpc.v1.introspection"..." type=io.containerd.grpc.v1 1s
47 time="2019-10-15T14:12:01Z" level=info msg=serving... address="/var/run/docker/containerd/containerd-debug.sock" 1s
48 time="2019-10-15T14:12:01Z" level=info msg=serving... address="/var/run/docker/containerd/containerd.sock" 1s
49 time="2019-10-15T14:12:01Z" level=info msg="containerd successfully booted in 0.097823s" 1s
50 time="2019-10-15T14:12:01.696222893Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0x14265d10, READY" module=grpc 1s
51 time="2019-10-15T14:12:01.736978715Z" level=info msg="parsed scheme: \"unix\"" module=grpc 1s
52 time="2019-10-15T14:12:01.737081997Z" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc 1s
53 time="2019-10-15T14:12:01.738802467Z" level=info msg="ccResolverWrapper: sending new addresses to cc: [{unix:///var/run/docker/containerd/containerd.sock 0 <nil>}]" module=grpc 1s
54 time="2019-10-15T14:12:01.739001426Z" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc 1s
55 time="2019-10-15T14:12:01.739195905Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0x140a6290, CONNECTING" module=grpc 1s
56 time="2019-10-15T14:12:01.738963092Z" level=info msg="parsed scheme: \"unix\"" module=grpc 1s
57 time="2019-10-15T14:12:01.740462886Z" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc 1s
58 time="2019-10-15T14:12:01.742305856Z" level=info msg="ccResolverWrapper: sending new addresses to cc: [{unix:///var/run/docker/containerd/containerd.sock 0 <nil>}]" module=grpc 1s
59 time="2019-10-15T14:12:01.743882264Z" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc 1s
60 time="2019-10-15T14:12:01.742552106Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0x140a6290, READY" module=grpc 1s
61 time="2019-10-15T14:12:01.745151692Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0x1418cf10, CONNECTING" module=grpc 1s
62 time="2019-10-15T14:12:01.747018569Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0x1418cf10, READY" module=grpc 1s
63 time="2019-10-15T14:12:01.827573910Z" level=info msg="Graph migration to content-addressability took 0.00 seconds" 1s
64 time="2019-10-15T14:12:01.828774641Z" level=warning msg="Your kernel does not support swap memory limit" 1s
65 time="2019-10-15T14:12:01.829954642Z" level=warning msg="Your kernel does not support cgroup cfs period" 1s
66 time="2019-10-15T14:12:01.830088132Z" level=warning msg="Your kernel does not support cgroup cfs quotas" 1s
67 time="2019-10-15T14:12:01.830151934Z" level=warning msg="Your kernel does not support cgroup rt period" 1s
68 time="2019-10-15T14:12:01.830216830Z" level=warning msg="Your kernel does not support cgroup rt runtime" 1s
69 time="2019-10-15T14:12:01.833012405Z" level=info msg="Loading containers: start." 1s
70 time="2019-10-15T14:12:01.886482563Z" level=warning msg="Running modprobe bridge br_netfilter failed with message: ip: can't find device 'bridge'\nbridge 135168 1 br_netfilter\nstp 16384 2 bridge,garp\nllc 16384 3 bridge,garp,stp\nipv6 450560 297 bridge,[permanent]\nip: can't find device 'br_netfilter'\nbr_netfilter 24576 0 \nbridge 135168 1 br_netfilter\nmodprobe: can't change directory to '/lib/modules': No such file or directory\n, error: exit status 1" 2s
71 time="2019-10-15T14:12:01.916985094Z" level=warning msg="Running modprobe nf_nat failed with message: `ip: can't find device 'nf_nat'\nnf_nat_ipv4 16384 2 ipt_MASQUERADE,nft_chain_nat_ipv4\nnf_nat 36864 2 xt_nat,nf_nat_ipv4\nnf_conntrack 135168 6 xt_nat,xt_conntrack,ipt_MASQUERADE,nf_conntrack_netlink,nf_nat_ipv4,nf_nat\nmodprobe: can't change directory to '/lib/modules': No such file or directory`, error: exit status 1" 2s
72 time="2019-10-15T14:12:01.947133041Z" level=warning msg="Running modprobe xt_conntrack failed with message: `ip: can't find device 'xt_conntrack'\nxt_conntrack 16384 5 \nnf_conntrack 135168 6 xt_nat,xt_conntrack,ipt_MASQUERADE,nf_conntrack_netlink,nf_nat_ipv4,nf_nat\nx_tables 32768 7 xt_nat,xt_tcpudp,xt_conntrack,ipt_MASQUERADE,xt_addrtype,nft_compat,ip_tables\nmodprobe: can't change directory to '/lib/modules': No such file or directory`, error: exit status 1" 2s
73 time="2019-10-15T14:12:02.412979237Z" level=info msg="stopping event stream following graceful shutdown" error="<nil>" module=libcontainerd namespace=moby 2s
74 time="2019-10-15T14:12:02.446624635Z" level=info msg="stopping healthcheck following graceful shutdown" module=libcontainerd 2s
75 time="2019-10-15T14:12:02.456498864Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0x1418cf10, TRANSIENT_FAILURE" module=grpc 2s
76 time="2019-10-15T14:12:02.458246730Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0x1418cf10, CONNECTING" module=grpc 2s
77 time="2019-10-15T14:12:02.447142344Z" level=info msg="stopping event stream following graceful shutdown" error="context canceled" module=libcontainerd namespace=plugins.moby 2s
78 Error starting daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables -t nat -N DOCKER: iptables v1.6.2: can't initialize iptables table `nat': Table does not exist (do you need to insmod?) 3s
79 Perhaps iptables or your kernel needs to be upgraded. 3s
80 (exit status 3) 3s
81 Registry credentials not provided. Guest mode enabled. 18s
82 + /usr/local/bin/docker version 18s
83 Client: 18s
84 Version: 18.09.0 18s
85 API version: 1.39 18s
86 Go version: go1.10.2 18s
87 Git commit: 4d60db4 18s
88 Built: Wed Nov 7 00:49:20 2018 18s
89 OS/Arch: linux/arm 18s
90 Experimental: false 18s
91 Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? 18s
92 time="2019-10-15T14:12:18Z" level=fatal msg="exit status 1"

On line 78 you can see that the docker deamon somehow cant didn’t start.

Apparently it was some problem with the kernel on raspberry pi and it works again.

Sorry for all the trouble!

I get that too occasionally on kubernetes eks installed via helm, mostly when multiple builds are running