Error Authenticating, Plugins/Docker

Hey, I get this error Error authenticating: exit status 1 running on my Kubernetes Architecture (with the drone helm chart) on the latest build: drone/drone-runner-kube:latest. I’m pulling and pushing to a private registry. I am able to pull from it.

Build Config:

kind: pipeline
type: kubernetes
name: default

platform:
  os: linux
  arch: arm

steps:
  - name: test-pull
    image: redacted/lighttpd:latest
    commands:
      - echo "Pull Ok"

  - name: docker
    image: plugins/docker
    settings:
      repo: redacted/lighthttpd
      dockerfile: Dockerfile
      tag: ["latest", "v1.${DRONE_BUILD_NUMBER}"]
      username:
        from_secret: docker_username
      password:
        from_secret: docker_password
      debug: true

This is the log of the Docker Stage:

+ /usr/local/bin/dockerd --data-root /var/lib/docker
time="2020-03-31T07:03:02.977148781Z" level=warning msg="could not change group /var/run/docker.sock to docker: group docker not found"
time="2020-03-31T07:03:02.980394009Z" level=info msg="libcontainerd: started new containerd process" pid=45
time="2020-03-31T07:03:02.980452831Z" level=info msg="parsed scheme: \"unix\"" module=grpc
time="2020-03-31T07:03:02.980475599Z" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
time="2020-03-31T07:03:02.980567282Z" level=info msg="ccResolverWrapper: sending new addresses to cc: [{unix:///var/run/docker/containerd/containerd.sock 0  <nil>}]" module=grpc
time="2020-03-31T07:03:02.980599214Z" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
time="2020-03-31T07:03:02.980690273Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc42094f5a0, CONNECTING" module=grpc
time="2020-03-31T07:03:02Z" level=info msg="starting containerd" revision=468a545b9edcd5932818eb9de8e72413e616e86e version=v1.1.2 
time="2020-03-31T07:03:02Z" level=info msg="loading plugin "io.containerd.content.v1.content"..." type=io.containerd.content.v1 
time="2020-03-31T07:03:02Z" level=info msg="loading plugin "io.containerd.snapshotter.v1.btrfs"..." type=io.containerd.snapshotter.v1 
time="2020-03-31T07:03:03Z" 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" 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.snapshotter.v1.aufs"..." type=io.containerd.snapshotter.v1 
time="2020-03-31T07:03:03Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.aufs" error="modprobe aufs failed: "ip: can't find device 'aufs'\naufs                  241664  0 \nmodprobe: can't change directory to '/lib/modules': No such file or directory\n": exit status 1" 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.snapshotter.v1.native"..." type=io.containerd.snapshotter.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.snapshotter.v1.overlayfs"..." type=io.containerd.snapshotter.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.snapshotter.v1.zfs"..." type=io.containerd.snapshotter.v1 
time="2020-03-31T07:03:03Z" 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" 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.metadata.v1.bolt"..." type=io.containerd.metadata.v1 
time="2020-03-31T07:03:03Z" level=warning msg="could not use snapshotter aufs in metadata plugin" error="modprobe aufs failed: "ip: can't find device 'aufs'\naufs                  241664  0 \nmodprobe: can't change directory to '/lib/modules': No such file or directory\n": exit status 1" 
time="2020-03-31T07:03:03Z" 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" 
time="2020-03-31T07:03:03Z" 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" 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.differ.v1.walking"..." type=io.containerd.differ.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.gc.v1.scheduler"..." type=io.containerd.gc.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.service.v1.containers-service"..." type=io.containerd.service.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.service.v1.content-service"..." type=io.containerd.service.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.service.v1.diff-service"..." type=io.containerd.service.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.service.v1.images-service"..." type=io.containerd.service.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.service.v1.leases-service"..." type=io.containerd.service.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.service.v1.namespaces-service"..." type=io.containerd.service.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.service.v1.snapshots-service"..." type=io.containerd.service.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.monitor.v1.cgroups"..." type=io.containerd.monitor.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.runtime.v1.linux"..." type=io.containerd.runtime.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.service.v1.tasks-service"..." type=io.containerd.service.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.grpc.v1.containers"..." type=io.containerd.grpc.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.grpc.v1.content"..." type=io.containerd.grpc.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.grpc.v1.diff"..." type=io.containerd.grpc.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.grpc.v1.events"..." type=io.containerd.grpc.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.grpc.v1.healthcheck"..." type=io.containerd.grpc.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.grpc.v1.images"..." type=io.containerd.grpc.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.grpc.v1.leases"..." type=io.containerd.grpc.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.grpc.v1.namespaces"..." type=io.containerd.grpc.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.grpc.v1.snapshots"..." type=io.containerd.grpc.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.grpc.v1.tasks"..." type=io.containerd.grpc.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.grpc.v1.version"..." type=io.containerd.grpc.v1 
time="2020-03-31T07:03:03Z" level=info msg="loading plugin "io.containerd.grpc.v1.introspection"..." type=io.containerd.grpc.v1 
time="2020-03-31T07:03:03Z" level=info msg=serving... address="/var/run/docker/containerd/containerd-debug.sock" 
time="2020-03-31T07:03:03Z" level=info msg=serving... address="/var/run/docker/containerd/containerd.sock" 
time="2020-03-31T07:03:03Z" level=info msg="containerd successfully booted in 0.069448s" 
time="2020-03-31T07:03:03.072226831Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc42094f5a0, READY" module=grpc
time="2020-03-31T07:03:03.075252842Z" level=info msg="parsed scheme: \"unix\"" module=grpc
time="2020-03-31T07:03:03.075292408Z" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
time="2020-03-31T07:03:03.075390578Z" level=info msg="ccResolverWrapper: sending new addresses to cc: [{unix:///var/run/docker/containerd/containerd.sock 0  <nil>}]" module=grpc
time="2020-03-31T07:03:03.075438455Z" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
time="2020-03-31T07:03:03.075495619Z" level=info msg="parsed scheme: \"unix\"" module=grpc
time="2020-03-31T07:03:03.075514596Z" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
time="2020-03-31T07:03:03.075513889Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc420785d20, CONNECTING" module=grpc
time="2020-03-31T07:03:03.075614332Z" level=info msg="ccResolverWrapper: sending new addresses to cc: [{unix:///var/run/docker/containerd/containerd.sock 0  <nil>}]" module=grpc
time="2020-03-31T07:03:03.075638420Z" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
time="2020-03-31T07:03:03.075685969Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc4200c3d40, CONNECTING" module=grpc
time="2020-03-31T07:03:03.079862920Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc420785d20, READY" module=grpc
time="2020-03-31T07:03:03.079859934Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc4200c3d40, READY" module=grpc
time="2020-03-31T07:03:03.199814686Z" level=info msg="Graph migration to content-addressability took 0.00 seconds"
time="2020-03-31T07:03:03.200742149Z" level=warning msg="Your kernel does not support swap memory limit"
time="2020-03-31T07:03:03.200803381Z" level=warning msg="Your kernel does not support cgroup rt period"
time="2020-03-31T07:03:03.200819115Z" level=warning msg="Your kernel does not support cgroup rt runtime"
time="2020-03-31T07:03:03.201367581Z" level=info msg="Loading containers: start."
time="2020-03-31T07:03:03.209064234Z" level=warning msg="Running modprobe nf_nat failed with message: `ip: can't find device 'nf_nat'\nnf_nat_masquerade_ipv4    16384  1 ipt_MASQUERADE\nnf_nat_ipv4            16384  1 iptable_nat\nnf_nat                 32768  3 xt_nat,nf_nat_masquerade_ipv4,nf_nat_ipv4\nnf_conntrack          131072  9 ip_vs,xt_nat,ipt_MASQUERADE,nf_nat_masquerade_ipv4,nf_conntrack_netlink,nf_conntrack_ipv4,nf_nat_ipv4,xt_conntrack,nf_nat\nlibcrc32c              16384  6 sctp,xfs,ip_vs,nf_nat,nf_conntrack,raid456\nmodprobe: can't change directory to '/lib/modules': No such file or directory`, error: exit status 1"
time="2020-03-31T07:03:03.215068507Z" level=warning msg="Running modprobe xt_conntrack failed with message: `ip: can't find device 'xt_conntrack'\nxt_conntrack           16384 137 \nnf_conntrack          131072  9 ip_vs,xt_nat,ipt_MASQUERADE,nf_nat_masquerade_ipv4,nf_conntrack_netlink,nf_conntrack_ipv4,nf_nat_ipv4,xt_conntrack,nf_nat\nx_tables               40960 16 xt_recent,ipt_REJECT,xt_multiport,xt_set,iptable_raw,xt_statistic,iptable_mangle,xt_comment,xt_mark,xt_nat,xt_tcpudp,ipt_MASQUERADE,xt_addrtype,iptable_filter,xt_conntrack,ip_tables\nmodprobe: can't change directory to '/lib/modules': No such file or directory`, error: exit status 1"
time="2020-03-31T07:03:04.187940001Z" level=info msg="Default bridge (docker0) is assigned with an IP address 172.18.0.0/16. Daemon option --bip can be used to set a preferred IP address"
time="2020-03-31T07:03:05.249235253Z" level=info msg="Loading containers: done."
time="2020-03-31T07:03:05.745349814Z" level=info msg="Docker daemon" commit=4d60db4 graphdriver(s)=overlay2 version=18.09.0
time="2020-03-31T07:03:05.745660401Z" level=info msg="Daemon has completed initialization"
time="2020-03-31T07:03:05.795784131Z" level=warning msg="Could not register builder git source: failed to find git binary: exec: \"git\": executable file not found in $PATH"
time="2020-03-31T07:03:05.805668518Z" level=info msg="API listen on /var/run/docker.sock"
time="2020-03-31T07:03:06Z" level=fatal msg="Error authenticating: exit status 1"

One common problem we see is when a custom registry is used, but the registry parameter is not properly configured in the settings secret (see custom registry in the plugin docs). I cannot tell if you are using a custom registry due to the yaml being partially redacted.

A second common issue we see is when the registry is not publicly accessible and is on a private or local network (including localhost or a private docker network) which cannot be accessed from within the Docker-in-Docker container. Example in this thread.

A third common root cause is an incorrect username or password. It is not uncommon for people to make mistakes when adding secret (accidentally copy paste the password with a space or newline included).

Lastly I recommend searching this forum for to see how others have solved this issue. https://discourse.drone.io/search?q=Error%20authenticating%3A%20exit%20status%201

1 Like

I referenced the Registry directly in my repo. This was my Issue.

However now I’m running into a more obscure behaviour. So I’m building into a private repo xyz.com but as soon the Dockerfile was built it trys to push the image to docker.io and fails. :thinking:

If it tries to push to docker.io it means you did not configure the registry parameter in your plugin settings section, or the repo parameter is not the fully qualified image name. Here is an example from the plugin docs:

steps:
  - name: docker  
    image: plugins/docker
    settings:
      username: kevinbacon
      password: pa55word
+     repo: index.company.com/foo/bar
+     registry: index.company.com
1 Like

Hey thank you for the detailed explanation. At the end I removed the registry tag from the repo which caused this error. After referencing it in both values it’s working now. :slightly_smiling_face:
Thank you!

1 Like