tiredofit / docker-freepbx

Dockerized FreePBX 15 w/Asterisk 17, Seperate MySQL Database support, and Data Persistence and UCP
MIT License
515 stars 235 forks source link

freepbx-app fails to start #159

Open promo776 opened 4 years ago

promo776 commented 4 years ago

When I start the container, it throws this error:

gzip: stdin: unexpected end of file tar: Child returned status 1 tar: Error is not recoverable: exiting now

disruptivepatternmaterial commented 3 years ago

I get this...seems similarish


reepbx-app          | STARTING ASTERISK
freepbx-app          | Asterisk Started
freepbx-app          | + '[' '!' -f /var/run/asterisk/asterisk.pid ']'
freepbx-app          | + var_false TRUE
freepbx-app          | + '[' TRUE = FALSE ']'
freepbx-app          | + '[' TRUE = false ']'
freepbx-app          | + '[' TRUE = NO ']'
freepbx-app          | + '[' TRUE = no ']'
freepbx-app          | + print_notice 'Installing FreePBX 15.0.16.56 source code (db embedded)'
freepbx-app          | + output_off
freepbx-app          | + '[' TRUE = TRUE ']'
freepbx-app          | + set +x
freepbx-app          | [NOTICE] /etc/cont-init.d/10-freepbx ** [freepbx] Installing FreePBX 15.0.16.56 source code (db embedded)
freepbx-app          | + silent ./install -n --webroot=/var/www/html
freepbx-app          | + '[' TRUE = TRUE ']'
freepbx-app          | + ./install -n --webroot=/var/www/html
freepbx-app          | Assuming you are Database Root
freepbx-app          | Checking if SELinux is enabled...Its not (good)!
freepbx-app          | Reading /etc/asterisk/asterisk.conf...Done
freepbx-app          | Checking if Asterisk is running and we can talk to it as the 'asterisk' user...Yes. Determined Asterisk version to be: 17.6.0
freepbx-app          | Checking if NodeJS is installed and we can get a version from it...Yes. Determined NodeJS version to be: 10.22.1
freepbx-app          | Preliminary checks done. Starting FreePBX Installation
freepbx-app          | Checking if this is a new install...Yes (No /etc/freepbx.conf file detected)
freepbx-app          | Database Root installation checking credentials and permissions..Error!
freepbx-app          | Invalid Database Permissions. The error was: SQLSTATE[HY000] [2002] No such file or directory
freepbx-app          | + sed -i '/^preload = chan_local.so$/d' /etc/asterisk/modules.conf
freepbx-app          | + '[' '!' -f /usr/sbin/fwconsole ']'
freepbx-app          | + print_error 'Can'\''t seem to locate /usr/sbin/fwconsole.. exiting'
freepbx-app          | + output_off
freepbx-app          | + '[' TRUE = TRUE ']'
freepbx-app          | + set +x
freepbx-app          | [ERROR] /etc/cont-init.d/10-freepbx ** [freepbx] Can't seem to locate /usr/sbin/fwconsole.. exiting
freepbx-app          | + exit 1
freepbx-app          | [cont-init.d] 10-freepbx: exited 1.
freepbx-app          | [cont-init.d] 15-socat: executing... 
freepbx-app          | + prepare_service single
freepbx-app          | + '[' -n single ']'
freepbx-app          | + case "$(dirname "$0")" in
freepbx-app          | ++ dirname /var/run/s6/etc/cont-init.d/15-socat
freepbx-app          | + get_defaults single
freepbx-app          | + '[' -n single ']'
freepbx-app          | + case "$1" in
freepbx-app          | + case "$(dirname "$0")" in
freepbx-app          | ++ dirname /var/run/s6/etc/cont-init.d/15-socat
freepbx-app          | ++ basename /var/run/s6/etc/cont-init.d/15-socat
freepbx-app          | + '[' -f /assets/defaults/15-socat ']'
freepbx-app          | ++ basename /var/run/s6/etc/cont-init.d/15-socat
freepbx-app          | + print_debug 'Container: No defaults available for 15-socat'
freepbx-app          | + output_off
freepbx-app          | + '[' TRUE = TRUE ']'
freepbx-app          | + set +x
freepbx-app          | [DEBUG] /etc/cont-init.d/15-socat ** [container] Container: No defaults available for 15-socat
freepbx-app          | + get_functions single
freepbx-app          | + '[' -n single ']'
freepbx-app          | + case "$1" in
freepbx-app          | + case "$(dirname "$0")" in
freepbx-app          | ++ dirname /var/run/s6/etc/cont-init.d/15-socat
freepbx-app          | ++ basename /var/run/s6/etc/cont-init.d/15-socat
freepbx-app          | + '[' -f /assets/functions/15-socat ']'
freepbx-app          | ++ basename /var/run/s6/etc/cont-init.d/15-socat
freepbx-app          | + print_debug 'Container: No functions available for 15-socat'
freepbx-app          | + output_off
freepbx-app          | + '[' TRUE = TRUE ']'
freepbx-app          | + set +x
freepbx-app          | [DEBUG] /etc/cont-init.d/15-socat ** [container] Container: No functions available for 15-socat
freepbx-app          | + PROCESS_NAME=socat
freepbx-app          | + '[' '' '!=' localhost -a '' '!=' 127.0.0.1 -o '' '!=' 25 ']'
freepbx-app          | + var_true FALSE
freepbx-app          | + '[' FALSE = TRUE ']'
freepbx-app          | + '[' FALSE = true ']'
freepbx-app          | + '[' FALSE = YES ']'
freepbx-app          | + '[' FALSE = yes ']'
freepbx-app          | + service_stop 15-socat
freepbx-app          | ++ basename /var/run/s6/etc/cont-init.d/15-socat
freepbx-app          | + '[' 15-socat '!=' 15-socat ']'
freepbx-app          | + DONOTSTART=TRUE
freepbx-app          | + liftoff
freepbx-app          | + output_off
freepbx-app          | + '[' TRUE = TRUE ']'
freepbx-app          | + set +x
freepbx-app          | [cont-init.d] 15-socat: exited 0.
freepbx-app          | [cont-init.d] 99-container: executing... 
freepbx-app          | + PROCESS_NAME=container
freepbx-app          | + var_false FALSE
freepbx-app          | + '[' FALSE = FALSE ']'
freepbx-app          | + output_off
freepbx-app          | + '[' TRUE = TRUE ']'
freepbx-app          | + set +x
freepbx-app          | **********************************************************************************************************************
freepbx-app          | **********************************************************************************************************************
freepbx-app          | ****                                                                                                              ****
freepbx-app          | ****       ERROR - Some initialization scripts haven't completed - All services are now halted                    ****
freepbx-app          | ****             - The following scripts in '/etc/cont-init.d' did not pass their completion check                ****
freepbx-app          | ****                                                                                                              ****
freepbx-app          | **********************************************************************************************************************
freepbx-app          | **********************************************************************************************************************
freepbx-app          | 
freepbx-app          | 10-freepbx
freepbx-app          | 
freepbx-app          | 
freepbx-app          | **********************************************************************************************************************
freepbx-app          | **********************************************************************************************************************
freepbx-app          | ****                                                                                                              ****
freepbx-app          | ****       This could have happened for a variety of reasons. Please make sure you have followed the README       ****
freepbx-app          | ****       relating to this image and have proper configuration such as environment variables and volumes set     ****
freepbx-app          | ****                                                                                                              ****
freepbx-app          | ****       If you feel that you have encountered a bug, please submit an issue on the revision control system     ****
freepbx-app          | ****       and provide full debug logs by setting the environment variable 'DEBUG_MODE=TRUE'                      ****
freepbx-app          | ****                                                                                                              ****
freepbx-app          | **********************************************************************************************************************
freepbx-app          | **********************************************************************************************************************
freepbx-app          | [cont-init.d] 99-container: exited 1.
disruptivepatternmaterial commented 3 years ago

I cannot for the life of my figure out what is going wrong...

tiredofit commented 3 years ago

@ntableman Your database is failing so the whole initial install fails. Internal DB? External DB? What's the host and what filesystem are you using?

rusxakep commented 3 years ago

At current moment, running database instance copyed to /data, who linked to /var/lib/mysql, that's wrong and can cause corrupted database.

from 10-freepbx:

`if var_false "$DB_EMBEDDED" ; then sanity_db db_ready mariadb fi

if [ ! -f /data/.installed ]; then print_notice "Creating default configuration files" mkdir -p /data cp -R /assets/config/* /data/ fi`

I preparing patch for this and some other bugs in my next PR. I think change it to something: rsync -av /assets/config/* /data --exclude var/lib/mysql --exclude var/lib/mongodb

tiredofit commented 3 years ago

@rusxakep Do you think this is because of the symlink that is in place? This has been a long standing issue for those using WSL 1, and also has reared it's head for quite some time with Ubuntu distros. I've never been able to recreate it for myself, but open to some suggestions.

disruptivepatternmaterial commented 3 years ago

What is curious (as observed) is the exact came docker-compose works fine on my mac, but not on Ubuntu host. @rusxakep and @tiredofit let me know if there is any other debug or details I can provide.

rusxakep commented 3 years ago

@tiredofit Maybe. You can't change database files while database is working under processing your requests. You have a small chance of getting damaged image.

You should move 'copy database files' stage from 10-freepbx to earlier stage, i.e. before service mysql start.

I am testing PR now, please be patient :-)

@ntableman Are you using NFS (or other network disk drive?) for mysql data?

disruptivepatternmaterial commented 3 years ago

@rusxakep no, internal SSD - the only drive in the setup.

promo776 commented 3 years ago

I finally had some time to play with this more, and indeed the issue I am having is the database is not starting. I am using the tiredofit/mariadb docker image from the compose file.

Here is the output:

2020-11-17 6:35:48 0 [Note] InnoDB: Using Linux native AIO 2020-11-17 6:35:48 0 [Note] InnoDB: Uses event mutexes 2020-11-17 6:35:48 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 2020-11-17 6:35:48 0 [Note] InnoDB: Number of pools: 1 2020-11-17 6:35:48 0 [Note] InnoDB: Using SSE4.2 crc32 instructions 2020-11-17 6:35:48 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts) 2020-11-17 6:35:48 0 [Note] InnoDB: Initializing buffer pool, total size = 268435456, chunk size = 134217728 2020-11-17 6:35:48 0 [Note] InnoDB: Completed initialization of buffer pool 2020-11-17 6:35:48 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). 2020-11-17 6:35:48 0 [ERROR] InnoDB: The Auto-extending innodb_system data file './ibdata1' is of a different size 0 pages than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages! 2020-11-17 6:35:48 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error 2020-11-17 6:35:48 0 [Note] InnoDB: Starting shutdown... 2020-11-17 6:35:48 0 [ERROR] Plugin 'InnoDB' init function returned error. 2020-11-17 6:35:48 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 2020-11-17 6:35:48 0 [ERROR] Unknown/unsupported storage engine: InnoDB 2020-11-17 6:35:48 0 [ERROR] Aborting [cont-init.d] 10-mariadb: exited 0. [cont-init.d] 20-mariadb-backup: executing... [NOTICE] ** [mariadb-backup] Disabling Scheduled Backups [cont-init.d] 20-mariadb-backup: exited 0. [cont-init.d] 99-container: executing... [cont-init.d] 99-container: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done. [INFO] ** [mariadb] Starting MariaDB 10.5.5 [INFO] ** [zabbix] Starting Zabbix Agent [INFO] ** [mariadb] Starting MariaDB 10.5.5

The last line just repeats for ever, and never starts.

rusxakep commented 3 years ago

I finally had some time to play with this more, and indeed the issue I am having is the database is not starting. I am using the tiredofit/mariadb docker image from the compose file.

Here is the output:

2020-11-17 6:35:48 0 [Note] InnoDB: Using Linux native AIO 2020-11-17 6:35:48 0 [Note] InnoDB: Uses event mutexes 2020-11-17 6:35:48 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 2020-11-17 6:35:48 0 [Note] InnoDB: Number of pools: 1 2020-11-17 6:35:48 0 [Note] InnoDB: Using SSE4.2 crc32 instructions 2020-11-17 6:35:48 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts) 2020-11-17 6:35:48 0 [Note] InnoDB: Initializing buffer pool, total size = 268435456, chunk size = 134217728 2020-11-17 6:35:48 0 [Note] InnoDB: Completed initialization of buffer pool 2020-11-17 6:35:48 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). 2020-11-17 6:35:48 0 [ERROR] InnoDB: The Auto-extending innodb_system data file './ibdata1' is of a different size 0 pages than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages! 2020-11-17 6:35:48 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error 2020-11-17 6:35:48 0 [Note] InnoDB: Starting shutdown... 2020-11-17 6:35:48 0 [ERROR] Plugin 'InnoDB' init function returned error. 2020-11-17 6:35:48 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 2020-11-17 6:35:48 0 [ERROR] Unknown/unsupported storage engine: InnoDB 2020-11-17 6:35:48 0 [ERROR] Aborting [cont-init.d] 10-mariadb: exited 0. [cont-init.d] 20-mariadb-backup: executing... [NOTICE] ** [mariadb-backup] Disabling Scheduled Backups [cont-init.d] 20-mariadb-backup: exited 0. [cont-init.d] 99-container: executing... [cont-init.d] 99-container: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done. [INFO] ** [mariadb] Starting MariaDB 10.5.5 [INFO] ** [zabbix] Starting Zabbix Agent [INFO] ** [mariadb] Starting MariaDB 10.5.5

The last line just repeats for ever, and never starts.

Update tiredofit/mariadb to actual version and try again. Please read: https://bugs.mysql.com/bug.php?id=96497