izer-xyz / 3cx-docker

3CX PBX Phone System docker image. [ x86_64 | ARM | v18.x ]
MIT License
28 stars 8 forks source link

Docker not started #17

Closed stsimadi closed 1 year ago

stsimadi commented 2 years ago

After initial setup docker not started

Set hostname to <535aa3c1620c>. Failed to add address 127.0.0.1 to loopback interface: Operation not permitted Failed to add address ::1 to loopback interface: Operation not permitted Failed to bring loopback interface up: Operation not permitted Failed to bump AF_UNIX datagram queue length, ignoring: Read-only file system Setting 'fs/file-max' to '9223372036854775807'. Failed to bump fs.file-max, ignoring: Read-only file system RLIMIT_NOFILE is already as high or higher than we need it, not bumping. Found cgroup2 on /sys/fs/cgroup/, full unified hierarchy Unified cgroup hierarchy is located at /sys/fs/cgroup. Failed to create /init.scope control group: Read-only file system Failed to allocate manager object: Read-only file system [!!!!!!] Failed to allocate manager object. Exiting PID 1...

sinegar commented 2 years ago

How did you create the container (full command line for docker run or docker compose file)?

What host are you running on?

Mist-Hunter commented 1 year ago

Thank you for this container, I'm looking forward to trying out 3CX. I'm getting the same issue.

If I run:

docker run \
  -d  \
  -t \
  --tmpfs /tmp \
  --tmpfs /run \
  --tmpfs /run/lock \
  -v      /sys/fs/cgroup:/sys/fs/cgroup:ro \
  -p      5015:5015 \
  -p      5000:5000 \
  -p      5001:5001 \
  -p      5060:5060 \
  -p      5060:5060/udp \
  -p      5090:5090 \
  -p      5090:5090/udp \
          ghcr.io/izer-xyz/3cx:latest

I get the same complaints:

First run. Configure instance ...

Check config tool logs in case of any issues /var/lib/3cxpbx/Data/Logs/PbxConfigTool.log

Run WebConfig on port :5015

Created symlink /etc/systemd/system/multi-user.target.wants/setup-3cx.service -> /etc/systemd/system/setup-3cx.service.

Start systemd

Welcome to Debian GNU/Linux 10 (buster)!

Failed to create /init.scope control group: Read-only file system

Failed to allocate manager object: Read-only file system

[!!!!!!] Failed to allocate manager object.

Exiting PID 1..

System details:

docker --version
Docker version 20.10.21, build baeda1f

lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

whoami
root
Mist-Hunter commented 1 year ago

Related (?) https://github.com/moby/moby/issues/42275

sinegar commented 1 year ago

Would you share the output of “docker info”?

sinegar commented 1 year ago

By the way, the issue you linked to make sense as it talks about cgroups v2 and it seems to be the problem for most of the tickets I get… Unfortunately, I don’t have a host with cgroups v2.

Mist-Hunter commented 1 year ago
> docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Docker Buildx (Docker Inc., v0.9.1-docker)
  scan: Docker Scan (Docker Inc., v0.21.0)

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 20.10.21
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 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.runtime.v1.linux runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 770bd0108c32f3fb5c73ae1264f7e503fe7b2661
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.10.0-19-amd64
 Operating System: Debian GNU/Linux 11 (bullseye)
 OSType: linux
 Architecture: x86_64
 CPUs: 6
 Total Memory: 23.53GiB
 Name: <REMOVED>
 ID: <REMOVED>
 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
Mist-Hunter commented 1 year ago

I found luck with this: https://serverfault.com/a/1083451

Here's a bit of code I put in my stand-up script based on the above (in case it's of use to anyone):

grubCFG="/etc/default/grub.d/cgroup.cfg"
if [ ! -f $grubCFG ]
then
echo 'GRUB_CMDLINE_LINUX=systemd.unified_cgroup_hierarchy=false' > $grubCFG
update-grub
echo "GRUB Config not correct, updating and rebooting."
sleep 1s
reboot
else
echo "$grubCFG already exists"
fi

After running the above, and rebooting, THEN starting creating the container (don't create before the change or it won't work), things come up as expected.

sinegar commented 1 year ago

@Mist-Hunter this is great! It really confirm the issue with cgroup version.

Thank you for reporting it back here. It will help some people (I will add it to the troubleshooting) running recent versions of some distros.

sinegar commented 1 year ago

Another option that worked for the github action was to add --cgroupns=host -v /sys/fs/cgroup:/sys/fs/cgroup:rw to the command line. cgroupns might not work with docker compose.

sinegar commented 1 year ago

Closing all issues before archiving the project.