scline/docker-cacti

FPM initialization failed

kevburkett opened this issue · 6 comments

Hi Sean, I was just going to try out the recent changes and seeing the following error after starting a test container with new volumes. I believe the www.sock file needs a permission change to either be owned by apache although I'm not completely sure.

2020-04-17_16:20 [Note] Setting cacti file permissions.
2020-04-17_16:20 [Note] Starting crond service.
2020-04-17_16:20 [Note] Starting snmpd service.
2020-04-17_16:20 [Note] Starting php-fpm service.
2020-04-17_16:20 [Note] Starting httpd service.
[17-Apr-2020 16:20:37] ERROR: [pool www] failed to read the ACL of the socket '/run/php-fpm/www.sock': Operation not supported (95)
[17-Apr-2020 16:20:37] ERROR: FPM initialization failed
kevin@p-serv-01:~/docker/cacti-test$ docker exec -it cacti /bin/bash
[root@cacti /]# ls -l /run/php-fpm/www.sock 
srw-rw---- 1 root root 0 Apr 17 16:20 /run/php-fpm/www.sock

Let me know if there's any further info you need.

Thanks,
Kevin

Hrmm, I have not been able to reproduce that. I am testing with the following compose file:

docker-compose.yml

version: '2'
services:


  cacti:
    image: "smcline06/cacti"
    container_name: cacti
    domainname: example.com
    hostname: cacti
    ports:
      - "80:80"
      - "443:443"
    environment:
      - DB_NAME=cacti_master
      - DB_USER=cactiuser
      - DB_PASS=cactipassword
      - DB_HOST=db
      - DB_PORT=3306
      - DB_ROOT_PASS=rootpassword
      - INITIALIZE_DB=1
      - TZ=America/Los_Angeles
    volumes:
      - cacti-data:/cacti
      - cacti-spine:/spine
      - cacti-backups:/backups
    links:
      - db


  db:
    image: "mariadb:10.3"
    container_name: cacti_db
    domainname: example.com
    hostname: db
    ports:
      - "3306:3306"
    command:
      - mysqld
      - --character-set-server=utf8mb4
      - --collation-server=utf8mb4_unicode_ci
      - --max_connections=200
      - --max_heap_table_size=128M
      - --max_allowed_packet=32M
      - --tmp_table_size=128M
      - --join_buffer_size=128M
      - --innodb_buffer_pool_size=1G
      - --innodb_doublewrite=ON
      - --innodb_flush_log_at_timeout=3
      - --innodb_read_io_threads=32
      - --innodb_write_io_threads=16
      - --innodb_buffer_pool_instances=9
      - --innodb_file_format=Barracuda
      - --innodb_large_prefix=1
      - --innodb_io_capacity=5000
      - --innodb_io_capacity_max=10000
    environment:
      - MYSQL_ROOT_PASSWORD=rootpassword
      - TZ=America/Los_Angeles
    volumes:
      - cacti-db:/var/lib/mysql


volumes:
  cacti-db:
  cacti-data:
  cacti-spine:
  cacti-backups:

Logs from initial startup:

2020-04-17_17:18 [Apache] Validating httpd cacti configuration is present.
2020-04-17_17:18 [Apache] /etc/httpd/conf.d/cacti.conf exist, nothing to do.
2020-04-17_17:18 [Apache] Missing HTTPS certs, generating self-signed one's.
Generating a RSA private key
................................................................++++
..........................++++
writing new private key to '/etc/ssl/certs/cacti.key'
-----
2020-04-17_17:18 [Note] Setting cacti file permissions.
2020-04-17_17:18 [Note] Starting crond service.
2020-04-17_17:18 [Note] Starting snmpd service.
2020-04-17_17:18 [Note] Starting php-fpm service.
2020-04-17_17:18 [Note] Starting httpd service.
➜  docker-cacti git:(master) ✗ docker-compose down

Permissions

➜  docker-cacti git:(master) ✗ docker exec -it cacti ls -alh /run/php-fpm/
total 16K
drwxr-xr-x  2 root root 4.0K Apr 17 17:26 .
drwxr-xr-x  1 root root 4.0K Apr 17 17:26 ..
-rw-r--r--  1 root root    2 Apr 17 17:26 php-fpm.pid
srw-rw----+ 1 root root    0 Apr 17 17:26 www.sock

Can I get your compose file to test and attempt to reproduce locally? Can you also tell me the version of docker and compose you are running so I can try to replicate things from that front as well.

Thanks for checking into this. Here's the info:

Version Info

kevin@p-serv-01:~/docker/cacti-test$ docker --version
Docker version 19.03.8, build afacb8b7f0
kevin@p-serv-01:~/docker/cacti-test$ docker-compose -v
docker-compose version 1.25.3, build unknown

docker-compose.yml
Note that I changed the exposed port from 80 to 8008 to avoid a conflict while testing and did not expose port 443. I used the updated cacti_single_install.yml example.

version: '2'
services:


  cacti:
    image: "smcline06/cacti"
    container_name: cacti
    domainname: example.com
    hostname: cacti
    ports:
      - "8008:80"
      #- "443:443"
    environment:
      - DB_NAME=cacti_master
      - DB_USER=cactiuser
      - DB_PASS=cactipassword
      - DB_HOST=db
      - DB_PORT=3306
      - DB_ROOT_PASS=rootpassword
      - INITIALIZE_DB=1
      - TZ=America/Los_Angeles
    volumes:
      - cacti-data:/cacti
      - cacti-spine:/spine
      - cacti-backups:/backups
    links:
      - db


  db:
    image: "mariadb:10.3"
    container_name: cacti_db
    domainname: example.com
    hostname: db
    ports:
      - "3306:3306"
    command:
      - mysqld
      - --character-set-server=utf8mb4
      - --collation-server=utf8mb4_unicode_ci
      - --max_connections=200
      - --max_heap_table_size=128M
      - --max_allowed_packet=32M
      - --tmp_table_size=128M
      - --join_buffer_size=128M
      - --innodb_buffer_pool_size=1G
      - --innodb_doublewrite=ON
      - --innodb_flush_log_at_timeout=3
      - --innodb_read_io_threads=32
      - --innodb_write_io_threads=16
      - --innodb_buffer_pool_instances=9
      - --innodb_file_format=Barracuda
      - --innodb_large_prefix=1
      - --innodb_io_capacity=5000
      - --innodb_io_capacity_max=10000
    environment:
      - MYSQL_ROOT_PASSWORD=rootpassword
      - TZ=America/Los_Angeles
    volumes:
      - cacti-db:/var/lib/mysql


volumes:
  cacti-db:
  cacti-data:
  cacti-spine:
  cacti-backups:

Logs
Here are the full logs while bringing up the containers.
cacti_docker_logs.txt

kevin@p-serv-01:~/docker/cacti-test$ docker exec -it cacti ls -alh /run/php-fpm
total 8.0K
drwxr-xr-x  2 root root 4.0K Apr 17 19:18 .
drwxr-xr-x 15 root root 4.0K Apr 17 19:18 ..
srw-rw----  1 root root    0 Apr 17 19:18 www.sock

Updated a few things that I hope solved the issue in your environment. I still could not get it to happen for me. Can you please test the following compose (simply using smcline06/cacti:1.2.11a) as the image.

version: '2'
services:


  cacti:
    image: "smcline06/cacti:1.2.11a"
    container_name: cacti
    domainname: example.com
    hostname: cacti
    ports:
      - "8008:80"
      #- "443:443"
    environment:
      - DB_NAME=cacti_master
      - DB_USER=cactiuser
      - DB_PASS=cactipassword
      - DB_HOST=db
      - DB_PORT=3306
      - DB_ROOT_PASS=rootpassword
      - INITIALIZE_DB=1
      - TZ=America/Los_Angeles
    volumes:
      - cacti-data:/cacti
      - cacti-spine:/spine
      - cacti-backups:/backups
    links:
      - db


  db:
    image: "mariadb:10.3"
    container_name: cacti_db
    domainname: example.com
    hostname: db
    ports:
      - "3306:3306"
    command:
      - mysqld
      - --character-set-server=utf8mb4
      - --collation-server=utf8mb4_unicode_ci
      - --max_connections=200
      - --max_heap_table_size=128M
      - --max_allowed_packet=32M
      - --tmp_table_size=128M
      - --join_buffer_size=128M
      - --innodb_buffer_pool_size=1G
      - --innodb_doublewrite=ON
      - --innodb_flush_log_at_timeout=3
      - --innodb_read_io_threads=32
      - --innodb_write_io_threads=16
      - --innodb_buffer_pool_instances=9
      - --innodb_file_format=Barracuda
      - --innodb_large_prefix=1
      - --innodb_io_capacity=5000
      - --innodb_io_capacity_max=10000
    environment:
      - MYSQL_ROOT_PASSWORD=rootpassword
      - TZ=America/Los_Angeles
    volumes:
      - cacti-db:/var/lib/mysql


volumes:
  cacti-db:
  cacti-data:
  cacti-spine:
  cacti-backups:

The end result should make the permissions as follows

ls -alh /run/php-fpm/
total 16K
drwxr-xr-x 2 root   root   4.0K Apr 18 07:39 .
drwxr-xr-x 1 root   root   4.0K Apr 18 07:39 ..
-rw-r--r-- 1 root   root      4 Apr 18 07:39 php-fpm.pid
srw-rw---- 1 apache apache    0 Apr 18 07:39 www.sock

All working. Web service started up with no errors. Odd that you didn't see the same thing while testing. I'm not sure why our environment's would be any different, but thanks for the help with this. Glad it's working now.

Generating a RSA private key
........................................++++
.............++++
writing new private key to '/etc/ssl/certs/cacti.key'
-----
2020-04-18_08:35 [Note] Setting cacti file permissions.
2020-04-18_08:35 [Note] Starting crond service.
2020-04-18_08:35 [Note] Starting snmpd service.
2020-04-18_08:35 [Note] Starting php-fpm service.
2020-04-18_08:35 [Note] Starting httpd service.
kevin@p-serv-01:~/docker/cacti-test$ docker exec -it cacti ls -alh /run/php-fpm/
total 12K
drwxr-xr-x  2 root   root   4.0K Apr 18 08:35 .
drwxr-xr-x 15 root   root   4.0K Apr 18 08:35 ..
-rw-r--r--  1 root   root      4 Apr 18 08:35 php-fpm.pid
srw-rw----  1 apache apache    0 Apr 18 08:35 www.sock

Thanks,
Kevin

Awesome, thanks for testing and validating things (^_^)/

Closing, this has now been pushed to latest and 1.2.11a tags.