Docker Community Forums

Share and learn in the Docker community.

Unable to start Portainer Instance

Sorry if I didn’t categorise this topic correctly :frowning: I’m in a bit of a bind…

I’m trying to use Docker on Artix OpenRC, but am failing pretty hard.

➜  ~ docker-compose version
docker-compose version 1.29.2, build unknown
docker-py version: 5.0.2
CPython version: 3.9.7
OpenSSL version: OpenSSL 1.1.1l  24 Aug 2021

I’m trying to get my first container running (Portainer). But, whenever I try to run the following compose file:

version: "3.2"
services:
    portainer:
        image: portainer/portainer-ce
        container_name: portainer
        restart: unless-stopped
        ports:
            - "9000:9000"
            - "8000:8000"
        volumes:
            - /srv/portainer/data:/data

I encounter the following monstrosity:

➜  Scripts sudo docker-compose -f /srv/docker_files/portainer.yml up
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/lib/python3.9/site-packages/urllib3/connectionpool.py", line 394, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.9/http/client.py", line 1279, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1325, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1274, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1034, in _send_output
    self.send(msg)
  File "/usr/lib/python3.9/http/client.py", line 974, in send
    self.connect()
  File "/usr/lib/python3.9/site-packages/docker/transport/unixconn.py", line 30, in connect
    sock.connect(self.unix_socket)
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/usr/lib/python3.9/site-packages/urllib3/util/retry.py", line 532, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/lib/python3.9/site-packages/urllib3/packages/six.py", line 769, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/lib/python3.9/site-packages/urllib3/connectionpool.py", line 394, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.9/http/client.py", line 1279, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1325, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1274, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1034, in _send_output
    self.send(msg)
  File "/usr/lib/python3.9/http/client.py", line 974, in send
    self.connect()
  File "/usr/lib/python3.9/site-packages/docker/transport/unixconn.py", line 30, in connect
    sock.connect(self.unix_socket)
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/docker/api/client.py", line 214, in _retrieve_server_version
    return self.version(api_version=False)["ApiVersion"]
  File "/usr/lib/python3.9/site-packages/docker/api/daemon.py", line 181, in version
    return self._result(self._get(url), json=True)
  File "/usr/lib/python3.9/site-packages/docker/utils/decorators.py", line 46, in inner
    return f(self, *args, **kwargs)
  File "/usr/lib/python3.9/site-packages/docker/api/client.py", line 237, in _get
    return self.get(url, **self._set_request_timeout(kwargs))
  File "/usr/lib/python3.9/site-packages/requests/sessions.py", line 555, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3.9/site-packages/requests/adapters.py", line 498, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 33, in <module>
    sys.exit(load_entry_point('docker-compose==1.29.2', 'console_scripts', 'docker-compose')())
  File "/usr/lib/python3.9/site-packages/compose/cli/main.py", line 81, in main
    command_func()
  File "/usr/lib/python3.9/site-packages/compose/cli/main.py", line 200, in perform_command
    project = project_from_options('.', options)
  File "/usr/lib/python3.9/site-packages/compose/cli/command.py", line 60, in project_from_options
    return get_project(
  File "/usr/lib/python3.9/site-packages/compose/cli/command.py", line 152, in get_project
    client = get_client(
  File "/usr/lib/python3.9/site-packages/compose/cli/docker_client.py", line 41, in get_client
    client = docker_client(
  File "/usr/lib/python3.9/site-packages/compose/cli/docker_client.py", line 170, in docker_client
    client = APIClient(use_ssh_client=not use_paramiko_ssh, **kwargs)
  File "/usr/lib/python3.9/site-packages/docker/api/client.py", line 197, in __init__
    self._version = self._retrieve_server_version()
  File "/usr/lib/python3.9/site-packages/docker/api/client.py", line 221, in _retrieve_server_version
    raise DockerException(
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

I know I’m screwing up somewhere, and I’m thinking it’s something pretty obvious with my given track record. But, I can’t tell where I’m going wrong.

I attempted to manually run dockerd, just to see what would happen, and encountered this:

➜  ~ sudo dockerd
INFO[2021-09-20T21:27:13.822623716-04:00] Starting up
INFO[2021-09-20T21:27:13.826501470-04:00] libcontainerd: started new containerd process  pid=6675
INFO[2021-09-20T21:27:13.826575924-04:00] parsed scheme: "unix"                         module=grpc
INFO[2021-09-20T21:27:13.826607002-04:00] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2021-09-20T21:27:13.826647978-04:00] ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}  module=grpc
INFO[2021-09-20T21:27:13.826682275-04:00] ClientConn switching balancer to "pick_first"  module=grpc
WARN[0000] deprecated version : `1`, please switch to version `2`
INFO[2021-09-20T21:27:13.878370983-04:00] starting containerd                           revision=72cec4be58a9eb6b2910f5d10f1c01ca47d231c0 version=v1.5.5
INFO[2021-09-20T21:27:13.951279735-04:00] loading plugin "io.containerd.content.v1.content"...  type=io.containerd.content.v1
INFO[2021-09-20T21:27:13.951425294-04:00] loading plugin "io.containerd.snapshotter.v1.aufs"...  type=io.containerd.snapshotter.v1
INFO[2021-09-20T21:27:13.957016125-04:00] skip loading plugin "io.containerd.snapshotter.v1.aufs"...  error="aufs is not supported (modprobe aufs failed: exit status 1 \"modprobe: FATAL: Module aufs not found in directory /lib/modules/5.14.2-artix1-2\\n\"): skip plugin" type=io.containerd.snapshotter.v1
INFO[2021-09-20T21:27:13.957140901-04:00] loading plugin "io.containerd.snapshotter.v1.btrfs"...  type=io.containerd.snapshotter.v1
INFO[2021-09-20T21:27:13.957472183-04:00] skip loading plugin "io.containerd.snapshotter.v1.btrfs"...  error="path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.btrfs (ext4) must be a btrfs filesystem to be used with the btrfs snapshotter: skip plugin" type=io.containerd.snapshotter.v1
INFO[2021-09-20T21:27:13.957517620-04:00] loading plugin "io.containerd.snapshotter.v1.devmapper"...  type=io.containerd.snapshotter.v1
WARN[2021-09-20T21:27:13.957737573-04:00] failed to load plugin io.containerd.snapshotter.v1.devmapper  error="devmapper not configured"
INFO[2021-09-20T21:27:13.957772899-04:00] loading plugin "io.containerd.snapshotter.v1.native"...  type=io.containerd.snapshotter.v1
INFO[2021-09-20T21:27:13.957834832-04:00] loading plugin "io.containerd.snapshotter.v1.overlayfs"...  type=io.containerd.snapshotter.v1
INFO[2021-09-20T21:27:13.959018879-04:00] loading plugin "io.containerd.snapshotter.v1.zfs"...  type=io.containerd.snapshotter.v1
INFO[2021-09-20T21:27:13.959314196-04:00] skip loading 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: skip plugin" type=io.containerd.snapshotter.v1
INFO[2021-09-20T21:27:13.959360041-04:00] loading plugin "io.containerd.metadata.v1.bolt"...  type=io.containerd.metadata.v1
WARN[2021-09-20T21:27:13.959412236-04:00] could not use snapshotter devmapper in metadata plugin  error="devmapper not configured"
INFO[2021-09-20T21:27:13.959445303-04:00] metadata content store policy set             policy=shared
INFO[2021-09-20T21:27:13.959636547-04:00] loading plugin "io.containerd.differ.v1.walking"...  type=io.containerd.differ.v1
INFO[2021-09-20T21:27:13.959687851-04:00] loading plugin "io.containerd.gc.v1.scheduler"...  type=io.containerd.gc.v1
INFO[2021-09-20T21:27:13.959774547-04:00] loading plugin "io.containerd.service.v1.introspection-service"...  type=io.containerd.service.v1
INFO[2021-09-20T21:27:13.960807734-04:00] loading plugin "io.containerd.service.v1.containers-service"...  type=io.containerd.service.v1
INFO[2021-09-20T21:27:13.960876667-04:00] loading plugin "io.containerd.service.v1.content-service"...  type=io.containerd.service.v1
INFO[2021-09-20T21:27:13.960913507-04:00] loading plugin "io.containerd.service.v1.diff-service"...  type=io.containerd.service.v1
INFO[2021-09-20T21:27:13.960952030-04:00] loading plugin "io.containerd.service.v1.images-service"...  type=io.containerd.service.v1
INFO[2021-09-20T21:27:13.960993641-04:00] loading plugin "io.containerd.service.v1.leases-service"...  type=io.containerd.service.v1
INFO[2021-09-20T21:27:13.961032979-04:00] loading plugin "io.containerd.service.v1.namespaces-service"...  type=io.containerd.service.v1
INFO[2021-09-20T21:27:13.961071602-04:00] loading plugin "io.containerd.service.v1.snapshots-service"...  type=io.containerd.service.v1
INFO[2021-09-20T21:27:13.961109844-04:00] loading plugin "io.containerd.runtime.v1.linux"...  type=io.containerd.runtime.v1
INFO[2021-09-20T21:27:13.961250330-04:00] loading plugin "io.containerd.runtime.v2.task"...  type=io.containerd.runtime.v2
INFO[2021-09-20T21:27:13.961367291-04:00] loading plugin "io.containerd.monitor.v1.cgroups"...  type=io.containerd.monitor.v1
INFO[2021-09-20T21:27:13.963171368-04:00] loading plugin "io.containerd.service.v1.tasks-service"...  type=io.containerd.service.v1
INFO[2021-09-20T21:27:13.963234098-04:00] loading plugin "io.containerd.internal.v1.restart"...  type=io.containerd.internal.v1
INFO[2021-09-20T21:27:13.963362477-04:00] loading plugin "io.containerd.grpc.v1.containers"...  type=io.containerd.grpc.v1
INFO[2021-09-20T21:27:13.963405403-04:00] loading plugin "io.containerd.grpc.v1.content"...  type=io.containerd.grpc.v1
INFO[2021-09-20T21:27:13.963442513-04:00] loading plugin "io.containerd.grpc.v1.diff"...  type=io.containerd.grpc.v1
INFO[2021-09-20T21:27:13.963479216-04:00] loading plugin "io.containerd.grpc.v1.events"...  type=io.containerd.grpc.v1
INFO[2021-09-20T21:27:13.963515630-04:00] loading plugin "io.containerd.grpc.v1.healthcheck"...  type=io.containerd.grpc.v1
INFO[2021-09-20T21:27:13.963553184-04:00] loading plugin "io.containerd.grpc.v1.images"...  type=io.containerd.grpc.v1
INFO[2021-09-20T21:27:13.963589901-04:00] loading plugin "io.containerd.grpc.v1.leases"...  type=io.containerd.grpc.v1
INFO[2021-09-20T21:27:13.963637313-04:00] loading plugin "io.containerd.grpc.v1.namespaces"...  type=io.containerd.grpc.v1
INFO[2021-09-20T21:27:13.963678049-04:00] loading plugin "io.containerd.internal.v1.opt"...  type=io.containerd.internal.v1
INFO[2021-09-20T21:27:13.964755679-04:00] loading plugin "io.containerd.grpc.v1.snapshots"...  type=io.containerd.grpc.v1
INFO[2021-09-20T21:27:13.964840106-04:00] loading plugin "io.containerd.grpc.v1.tasks"...  type=io.containerd.grpc.v1
INFO[2021-09-20T21:27:13.964881474-04:00] loading plugin "io.containerd.grpc.v1.version"...  type=io.containerd.grpc.v1
INFO[2021-09-20T21:27:13.964916571-04:00] loading plugin "io.containerd.grpc.v1.introspection"...  type=io.containerd.grpc.v1
INFO[2021-09-20T21:27:13.967152428-04:00] serving...                                    address=/var/run/docker/containerd/containerd-debug.sock
INFO[2021-09-20T21:27:13.967289085-04:00] serving...                                    address=/var/run/docker/containerd/containerd.sock.ttrpc
INFO[2021-09-20T21:27:13.967416868-04:00] serving...                                    address=/var/run/docker/containerd/containerd.sock
INFO[2021-09-20T21:27:13.967484684-04:00] containerd successfully booted in 0.092466s
INFO[2021-09-20T21:27:13.983149555-04:00] parsed scheme: "unix"                         module=grpc
INFO[2021-09-20T21:27:13.983383209-04:00] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2021-09-20T21:27:13.983932835-04:00] ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}  module=grpc
INFO[2021-09-20T21:27:13.984350562-04:00] ClientConn switching balancer to "pick_first"  module=grpc
INFO[2021-09-20T21:27:13.986569580-04:00] parsed scheme: "unix"                         module=grpc
INFO[2021-09-20T21:27:13.986613610-04:00] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2021-09-20T21:27:13.986672506-04:00] ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}  module=grpc
INFO[2021-09-20T21:27:13.986696691-04:00] ClientConn switching balancer to "pick_first"  module=grpc
ERRO[2021-09-20T21:27:13.996614318-04:00] failed to mount overlay: no such device       storage-driver=overlay2
ERRO[2021-09-20T21:27:13.996668420-04:00] [graphdriver] prior storage driver overlay2 failed: driver not supported
INFO[2021-09-20T21:27:13.998545930-04:00] stopping event stream following graceful shutdown  error="context canceled" module=libcontainerd namespace=plugins.moby
INFO[2021-09-20T21:27:13.998565871-04:00] stopping healthcheck following graceful shutdown  module=libcontainerd
failed to start daemon: error initializing graphdriver: driver not supported

I think my docker installation is broken, and may need to be nuked from orbit for a re-attempt :frowning: No idea how that happened. I’ll let you know how it goes…

sudo pacman -R docker-compose docker-openrc docker
sudo rm -rf /var/lib/docker /etc/docker
sudo rm /etc/apparmor.d/docker
sudo groupdel docker
sudo rm -rf /var/run/docker.sock

reboot...

sudo rm -rf /var/lib/docker /etc/docker

reboot...

My tiny container world, wiped clean :expressionless: Time to start from scratch…

The good thing is, docker-compose appears to have gotten its last update in May. My installation was from PKGBUILD, since the package isn’t in the repos yet for some reason. One less thing to worry about updating (or breaking during said updates). docker-openrc is just init scripts, and appears to have gotten its last update sometime in 2016 :thinking: The only thing left to go wrong in this regard is docker.

The process to get back to square one:

sudo pacman -S docker docker-openrc

# Download the PKGBUILD to the current pwd
# Install dependencies and sub-dependencies like crazy:

makepkg -cs
sudo pacman -U x.pkg.tar.xz

# Repeat this for docker-compose as well when the time comes as well

sudo rc-update add docker default
sudo rc-service docker start

sudo docker info

All of that ultimately leads to this:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Build with BuildKit (Docker Inc., v0.6.1-docker)

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 20.10.8
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: false
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 72cec4be58a9eb6b2910f5d10f1c01ca47d231c0
 runc version: v1.0.2-0-g52b36a2d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.14.6-artix1-1
 Operating System: Artix Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 15.65GiB
 Name: ArtixServ
 ID: UG7V:H6FK:OSXR:ZJKU:BZ3P:QLDI:PQ7H:PU7L:HADG:6UJX:6MAC:4CD3
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Time to see if I’m able to use docker-compose to deploy portainer/portainer-ce :thinking:

And now, to introduce a better compose file:

version: "3.2"
services:
    portainer:
        image: portainer/portainer-ce
        container_name: portainer
        restart: unless-stopped
        ports:
            - "9000:9000"
            - "8000:8000"
        volumes:
            - /srv/portainer/data:/data
            - /var/run/docker.sock:/var/run/docker.sock

The - /srv/portainer/data:/data part can be replaced with the install location of your choice. I suppose this blunder of mine can be used to help others avoid the same silly mistakes I made :grinning_face_with_smiling_eyes: