Closed alpharde closed 6 years ago
A couple lines down in that Debug mode it states the following:
/usr/sbin/safe_asterisk: 96: ulimit: error setting limit (Operation not permitted)
-
Wondering: what Architecture are you running this on/OS/Kernel Ver? Do you by chance have SELinux enabled? I believe I'm going to have to build some more informative debugging into this image so that it can halt upon these errors. I'll take a peek at the safe_asterisk script and see just what exactly it is doing. In short term, I wonder if you would have the same issue with "privileged: true" ? Doesn't seem to need it on my system but there's been a few weird incidents like this on this image.
CentOS 7 Linux localhost.localdomain 3.10.0-693.11.1.el7.x86_64 #1 SMP Mon Dec 4 23:52:40 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux Docker version 17.09.1-ce, build 19e2cf6 Selinux is disabled
Ran with docker run --privileged and some errors disappeared, but it's still coughing up errors:
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-zabbix: executing...
[cont-init.d] 01-zabbix: exited 0.
[cont-init.d] 02-cron: executing...
**** [cron] Disabling Cron
[cont-init.d] 02-cron: exited 0.
[cont-init.d] 03-smtp: executing...
**** [smtp] Disabling SMTP Features
[cont-init.d] 03-smtp: exited 0.
[cont-init.d] 04-fail2ban: executing...
** [fail2ban] Starting Fail2ban
Starting authentication failure monitor: fail2ban.
[cont-init.d] 04-fail2ban: exited 0.
[cont-init.d] 09-mariadb: executing...
[cont-init.d] 09-mariadb: exited 0.
[cont-init.d] 10-freepbx: executing...
+ [[ FALSE = \T\R\U\E ]]
+ DB_EMBEDDED=FALSE
+ '[' FALSE = FALSE ']'
+ '[' '!' -n DB_HOST ']'
+ '[' '!' -n DB_NAME ']'
+ '[' '!' -n DB_USER ']'
+ '[' '!' -n DB_PASS ']'
+ DB_PORT=3306
+ RTP_START=18000
+ RTP_END=20000
+ '[' FALSE = FALSE ']'
+ true
+ mysqlcmd='mysql -uasterisk -hfreepbxdb -pswIdPmOvKYoL'
++ mysql -uasterisk -hfreepbxdb -pswIdPmOvKYoL -e 'SELECT COUNT(*) FROM information_schema.FILES;'
+ out='COUNT(*)
0'
+ echo 'COUNT(*)
0'
+ grep -E 'COUNT|Enter'
** [freepbx] DB Server is available !
+ '[' 0 -eq 0 ']'
+ echo '** [freepbx] DB Server is available !'
+ break
+ '[' '!' -f /data/.installed ']'
+ echo '** [freepbx] Creating Default Configuration Files'
** [freepbx] Creating Default Configuration Files
+ cp -R /assets/config/home /assets/config/var /data/
** [freepbx] Setting File Permissions
+ echo '** [freepbx] Setting File Permissions'
+ mkdir -p /data/etc/asterisk
+ mkdir -p /data/var/lib/asterisk/agi-bin /data/var/lib/asterisk/bin /data/var/lib/asterisk/playback
+ mkdir -p /data/var/spool/asterisk/dictate /data/var/spool/asterisk/meetme /data/var/spool/asterisk/monitor /data/var/spool/asterisk/recording /data/var/spool/asterisk/system /data/var/spool/asterisk/tmp /data/var/spool/asterisk/voicemail
+ mkdir -p /data/var/run/asterisk
+ chown -R asterisk:asterisk /data
+ '[' '!' -f /var/www/html/admin/index.php ']'
+ echo '** [freepbx] New Install Detected - Please wait while we fetch FreePBX...'
+ '[' FALSE = FALSE ']'
+ cat
** [freepbx] New Install Detected - Please wait while we fetch FreePBX...
+ sudo -u asterisk gpg --refresh-keys --keyserver pgp.mit.edu
+ sudo -u asterisk gpg --keyserver pgp.mit.edu --recv-key 9F9169F4B33B4659
+ sudo -u asterisk gpg --keyserver pgp.mit.edu --recv-key 3DDB2122FE6D84F7
+ sudo -u asterisk gpg --keyserver pgp.mit.edu --recv-key 86CE877469D2EAD9
+ cd /usr/src
+ git clone -b release/14.0 --single-branch https://github.com/FreePBX/framework.git freepbx
+ cd /usr/src/freepbx
+ cp -R /etc/odbc.ini /usr/src/freepbx/installlib/files/odbc.ini
+ ./start_asterisk start
STARTING ASTERISK
cat: /var/run/asterisk/asterisk.pid: No such file or directory
cat: /var/run/asterisk/asterisk.pid: No such file or directory
Asterisk Started
+ '[' FALSE = FALSE ']'
+ sed -i -e 's/$amp_conf\['\''AMPDBHOST'\''\] = '\''localhost'\'';/$amp_conf\['\''AMPDBHOST'\''\] = '\''freepbxdb'\'';/g' /usr/src/freepbx/installlib/installcommand.class.php
+ sed -i -e 's/$amp_conf\['\''CDRDBNAME'\''\] : '\''asteriskcdrdb'\'',/$amp_conf\['\''CDRDBNAME'\''\] : '\''asterisk'\'',/g' /usr/src/freepbx/installlib/installcommand.class.php
+ sed -i -e 's/$amp_conf\['\''CDRDBNAME'\''\] : '\''asteriskcdrdb'\'',/$amp_conf\['\''CDRDBNAME'\''\] : '\''asterisk'\'',/g' /usr/src/freepbx/amp_conf/htdocs/admin/bootstrap.php
+ echo '** [freepbx] Installing FreePBX'
+ '[' FALSE = FALSE ']'
+ ./install -n --dbuser=asterisk --dbpass=swIdPmOvKYoL --dbname=asterisk --cdrdbname=asterisk --webroot=/var/www/html
** [freepbx] Installing FreePBX
Checking if SELinux is enabled...Its not (good)!
No /etc/asterisk/asterisk.conf file detected. Installing...Writing /etc/asterisk/asterisk.conf...Done
Checking if Asterisk is running and we can talk to it as the 'asterisk' user...Error!
Error communicating with Asterisk. Ensure that Asterisk is properly installed and running as the asterisk user
Asterisk does not appear to be running
Try starting Asterisk with the './start_asterisk start' command in this directory
+ '[' FALSE = FALSE ']'
+ cat
** [freepbx] Enabling Default Modules
+ echo '** [freepbx] Enabling Default Modules'
+ fwconsole ma upgrade framework core
/var/run/s6/etc/cont-init.d/10-freepbx: line 130: fwconsole: command not found
+ fwconsole ma download cdr
/var/run/s6/etc/cont-init.d/10-freepbx: line 131: fwconsole: command not found
+ '[' FALSE = FALSE ']'
+ mysql -uasterisk -pswIdPmOvKYoL -hfreepbxdb asterisk
+ mysql -uasterisk -pswIdPmOvKYoL -hfreepbxdb -e 'USE asterisk; UPDATE freepbx_settings SET `value` = "freepbxdb" WHERE keyword = "CDRDBHOST"; UPDATE freepbx_settings SET `value` = "asterisk" WHERE keyword = "CDRDBNAME"; UPDATE freepbx_settings SET `value` = "swIdPmOvKYoL" WHERE keyword = "CDRDBPASS"; UPDATE freepbx_settings SET `value` = "asterisk" WHERE keyword = "CDRDBUSER"; UPDATE freepbx_settings SET `value` = "mysql" WHERE keyword = "CDRDBTYPE"; UPDATE freepbx_settings SET `value` = "3306" WHERE keyword = "CDRDBPORT"; UPDATE freepbx_settings SET `value` = "cdr" WHERE keyword = "CDRDBTABLENAME";'
ERROR 1146 (42S02) at line 1: Table 'asterisk.freepbx_settings' doesn't exist
+ cp -R /var/www/html/admin/modules/cdr/install.php /var/www/html/admin/modules/cdr/.install.php
cp: cannot stat '/var/www/html/admin/modules/cdr/install.php': No such file or directory
+ sed -i -e 's/\$db_host = !empty(\$db_host) ? \$db_host : "localhost";/\$db_host = !empty(\$db_host) ? \$db_host : "freepbxdb";/g' /www/freepbx/admin/modules/cdr/install.php
sed: can't read /www/freepbx/admin/modules/cdr/install.php: No such file or directory
+ sed -i -e 's/\$db_name = !empty(\$db_name) ? \$db_name : "asteriskcdrdb";/\$db_name = !empty(\$db_name) ? \$db_name : "asterisk";/g' /www/freepbx/admin/modules/cdr/install.php
sed: can't read /www/freepbx/admin/modules/cdr/install.php: No such file or directory
+ fwconsole ma install cdr
/var/run/s6/etc/cont-init.d/10-freepbx: line 140: fwconsole: command not found
+ cp -R /var/www/html/admin/modules/cdr/.install.php /var/www/html/admin/modules/cdr/install.php
cp: cannot stat '/var/www/html/admin/modules/cdr/.install.php': No such file or directory
+ fwconsole ma upgrade voicemail sipsettings infoservices featurecodeadmin logfiles callrecording dashboard music conferences
/var/run/s6/etc/cont-init.d/10-freepbx: line 146: fwconsole: command not found
+ fwconsole ma upgrade certman userman pm2
/var/run/s6/etc/cont-init.d/10-freepbx: line 147: fwconsole: command not found
+ fwconsole chown
/var/run/s6/etc/cont-init.d/10-freepbx: line 148: fwconsole: command not found
+ fwconsole reload
/var/run/s6/etc/cont-init.d/10-freepbx: line 149: fwconsole: command not found
+ fwconsole ma upgrade ucp
/var/run/s6/etc/cont-init.d/10-freepbx: line 150: fwconsole: command not found
+ fwconsole chown
/var/run/s6/etc/cont-init.d/10-freepbx: line 151: fwconsole: command not found
+ fwconsole reload
/var/run/s6/etc/cont-init.d/10-freepbx: line 152: fwconsole: command not found
+ fwconsole restart
/var/run/s6/etc/cont-init.d/10-freepbx: line 153: fwconsole: command not found
+ fwconsole stop
/var/run/s6/etc/cont-init.d/10-freepbx: line 154: fwconsole: command not found
+ cd /
+ rm -rf /usr/src/freepbx
+ touch /data/.installed
+ '[' '!' -f /usr/sbin/fwconsole ']'
+ ln -s /var/lib/asterisk/bin/fwconsole /usr/sbin/fwconsole
+ '[' '!' -f /usr/sbin/amportal ']'
+ ln -s /var/lib/asterisk/bin/amportal /usr/sbin/amportal
+ '[' '!' -f /data/etc/amportal.conf ']'
+ mkdir -p /data/etc/
+ cp -R /etc/amportal.conf /data/etc/
cp: cannot stat '/etc/amportal.conf': No such file or directory
+ rm -rf /etc/amportal.conf
+ touch /data/etc/amportal.conf
+ chown asterisk:asterisk /data/etc/amportal.conf
+ ln -s /data/etc/amportal.conf /etc/amportal.conf
+ '[' FALSE = TRUE ']'
** [freepbx] Setting Configuration
+ '[' FALSE = FALSE ']'
+ echo '** [freepbx] Setting Configuration'
+ cat
+ cat
+ '[' '!' -f /etc/asterisk/cdr_adaptive_odbc.conf ']'
+ cat
+ chown asterisk:asterisk /etc/freepbx.conf
+ '[' FALSE = FALSE ']'
+ echo '** [freepbx] Set RTP Ports'
+ mysql -uasterisk -pswIdPmOvKYoL -hfreepbxdb -e 'USE asterisk; UPDATE sipsettings SET `data` = "18000" WHERE keyword = "rtpstart"; UPDATE sipsettings SET `data` = "20000" WHERE keyword = "rtpend";'
** [freepbx] Set RTP Ports
ERROR 1146 (42S02) at line 1: Table 'asterisk.sipsettings' doesn't exist
+ mysql -uasterisk -pswIdPmOvKYoL -hfreepbxdb -e 'USE asterisk; ALTER TABLE featurecodes CHANGE column helptext helptext VARCHAR(10000);'
ERROR 1146 (42S02) at line 1: Table 'asterisk.featurecodes' doesn't exist
+ echo '** [freepbx] Starting Asterisk'
+ fwconsole chown
** [freepbx] Starting Asterisk
+ fwconsole start
+ fwconsole reload
+ chown -R asterisk /etc/asterisk/asterisk.conf /etc/asterisk/cdr_adaptive_odbc.conf
+ cat
+ a2enconf allowoverride
+ sed -i 's/\(APACHE_RUN_USER=\)\(.*\)/\1asterisk/g' /etc/apache2/envvars
+ sed -i 's/\(APACHE_RUN_GROUP=\)\(.*\)/\1asterisk/g' /etc/apache2/envvars
+ chown asterisk. /run/lock/apache2
+ a2enmod rewrite
+ service apache2 restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.6. Set the 'ServerName' directive globally to suppress this message
cat: /var/run/asterisk/asterisk.pid: No such file or directory
+ mkdir -p /tmp/state
+ touch /tmp/state/10-freepbx-init
[cont-init.d] 10-freepbx: exited 0.
[cont-init.d] 99-container-init: executing...
[cont-init.d] 99-container-init: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
**** [zabbix] Starting Zabbix Agent
cat: /var/run/asterisk/asterisk.pid: No such file or directory
cat: /var/run/asterisk/asterisk.pid: No such file or directory
cat: /var/run/asterisk/asterisk.pid: No such file or directory
cat: /var/run/asterisk/asterisk.pid: No such file or directory
cat: /var/run/asterisk/asterisk.pid: No such file or directory
cat: /var/run/asterisk/asterisk.pid: No such file or directory
cat: /var/run/asterisk/asterisk.pid: No such file or directory```
Finally I took some time debugging it today. The image runs fine on my computer (Haswell) but fails on my two test servers (Nehalem Xeon). I've heard Asterisk doesn't play well with different processors if not told to in the build options and since it's dying with Illegal Instruction this seems to be case? Guess I'll play a bit with build options and see what I get.
If you find it out, please do let me know and I'll add to the image and even make a seperate tag specific for architectures. I thought I would have gotten it by disabling the BUILD_NATIVE flag. Guess not.
Nope, I couldn't debug this, every flag I found failed. So I just cloned the image and enabled BUILD_NATIVE so it would build specifically for my CPU, this made the illegal instruction problem disappear. Maybe I could get the traces sent to Digium so they figure it out, but I don't know how to generate them.
Now I'm having problems with FreePBX itself. (maybe they changed something and it broke?)
Critical: retrieve_conf failed, config not applied Reload failed because retrieve_conf encountered an error: 255 Error: No Conference Room App
Neither app_meetme nor app_confbridge is configured in Asterisk, conferencing, paging and other functionality will not work properly
Install log:
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-zabbix: executing...
[cont-init.d] 01-zabbix: exited 0.
[cont-init.d] 02-cron: executing...
**** [cron] Disabling Cron
[cont-init.d] 02-cron: exited 0.
[cont-init.d] 03-smtp: executing...
**** [smtp] Disabling SMTP Features
[cont-init.d] 03-smtp: exited 0.
[cont-init.d] 04-fail2ban: executing...
** [fail2ban] Starting Fail2ban
Starting authentication failure monitor: fail2ban.
[cont-init.d] 04-fail2ban: exited 0.
[cont-init.d] 09-mariadb: executing...
[cont-init.d] 09-mariadb: exited 0.
[cont-init.d] 10-freepbx: executing...
+ [[ FALSE = \T\R\U\E ]]
+ DB_EMBEDDED=FALSE
+ '[' FALSE = FALSE ']'
+ '[' '!' -n DB_HOST ']'
+ '[' '!' -n DB_NAME ']'
+ '[' '!' -n DB_USER ']'
+ '[' '!' -n DB_PASS ']'
+ DB_PORT=3306
+ RTP_START=18000
+ RTP_END=20000
+ '[' FALSE = FALSE ']'
+ true
+ mysqlcmd='mysql -uasterisk -hfreepbxdb -paXaq78w3WOw8tG9 -P3306'
++ mysql -uasterisk -hfreepbxdb -paXaq78w3WOw8tG9 -P3306 -e 'SELECT COUNT(*) FROM information_schema.FILES;'
+ out='COUNT(*)
0'
+ echo 'COUNT(*)
0'
+ grep -E 'COUNT|Enter'
** [freepbx] DB Server is available !
+ '[' 0 -eq 0 ']'
+ echo '** [freepbx] DB Server is available !'
+ break
** [freepbx] Creating Default Configuration Files
+ '[' '!' -f /data/.installed ']'
+ echo '** [freepbx] Creating Default Configuration Files'
+ cp -R /assets/config/home /assets/config/var /data/
** [freepbx] Setting File Permissions
+ echo '** [freepbx] Setting File Permissions'
+ mkdir -p /data/etc/asterisk
+ mkdir -p /data/var/lib/asterisk/agi-bin /data/var/lib/asterisk/bin /data/var/lib/asterisk/playback
+ mkdir -p /data/var/spool/asterisk/dictate /data/var/spool/asterisk/meetme /data/var/spool/asterisk/monitor /data/var/spool/asterisk/recording /data/var/spool/asterisk/system /data/var/spool/asterisk/tmp /data/var/spool/asterisk/voicemail
+ mkdir -p /data/var/run/asterisk
+ chown -R asterisk:asterisk /data
** [freepbx] New Install Detected - Please wait while we fetch FreePBX...
+ '[' '!' -f /var/www/html/admin/index.php ']'
+ echo '** [freepbx] New Install Detected - Please wait while we fetch FreePBX...'
+ '[' FALSE = FALSE ']'
+ cat
+ sudo -u asterisk gpg --refresh-keys --keyserver pgp.mit.edu
+ sudo -u asterisk gpg --keyserver pgp.mit.edu --recv-key 9F9169F4B33B4659
+ sudo -u asterisk gpg --keyserver pgp.mit.edu --recv-key 3DDB2122FE6D84F7
+ sudo -u asterisk gpg --keyserver pgp.mit.edu --recv-key 86CE877469D2EAD9
+ cd /usr/src
+ git clone -b release/14.0 --single-branch https://github.com/FreePBX/framework.git freepbx
+ cd /usr/src/freepbx
+ cp -R /etc/odbc.ini /usr/src/freepbx/installlib/files/odbc.ini
+ ./start_asterisk start
STARTING ASTERISK
Asterisk Started
+ '[' FALSE = FALSE ']'
+ sed -i -e 's/$amp_conf\['\''AMPDBHOST'\''\] = '\''localhost'\'';/$amp_conf\['\''AMPDBHOST'\''\] = '\''freepbxdb'\'';/g' /usr/src/freepbx/installlib/installcommand.class.php
+ sed -i -e 's/$amp_conf\['\''CDRDBNAME'\''\] : '\''asteriskcdrdb'\'',/$amp_conf\['\''CDRDBNAME'\''\] : '\''asterisk'\'',/g' /usr/src/freepbx/installlib/installcommand.class.php
+ sed -i -e 's/$amp_conf\['\''CDRDBNAME'\''\] : '\''asteriskcdrdb'\'',/$amp_conf\['\''CDRDBNAME'\''\] : '\''asterisk'\'',/g' /usr/src/freepbx/amp_conf/htdocs/admin/bootstrap.php
** [freepbx] Installing FreePBX
+ echo '** [freepbx] Installing FreePBX'
+ '[' FALSE = FALSE ']'
+ ./install -n --dbuser=asterisk --dbpass=aXaq78w3WOw8tG9 --dbname=asterisk --cdrdbname=asterisk --webroot=/var/www/html
Checking if SELinux is enabled...Its not (good)!
No /etc/asterisk/asterisk.conf file detected. Installing...Writing /etc/asterisk/asterisk.conf...Done
Checking if Asterisk is running and we can talk to it as the 'asterisk' user...Yes. Determined Asterisk version to be: 14.7.5
Preliminary checks done. Starting FreePBX Installation
Checking if this is a new install...Yes (No /etc/freepbx.conf file detected)
Database installation checking credentials and permissions..Connected!
Empty asterisk Database going to populate it
Updating table admin...Done
Updating table ampusers...Done
Updating table cronmanager...Done
Updating table featurecodes...Done
Updating table freepbx_log...Done
Updating table freepbx_settings...Done
Updating table globals...Done
Updating table module_xml...Done
Updating table modules...Done
Updating table notifications...Done
Initializing FreePBX Settings
Changing AMPMGRPASS [amp111] to match what was given at install time: def3fcbbf20504f979722bbb3e3b2f50
Finished initalizing settings
Copying files (this may take a bit)....
0/5804 [>---------------------------] 0%
100/5804 [>---------------------------] 1%
200/5804 [>---------------------------] 3%
300/5804 [=>--------------------------] 5%
400/5804 [=>--------------------------] 6%
500/5804 [==>-------------------------] 8%
600/5804 [==>-------------------------] 10%
700/5804 [===>------------------------] 12%
800/5804 [===>------------------------] 13%
900/5804 [====>-----------------------] 15%
1000/5804 [====>-----------------------] 17%
1100/5804 [=====>----------------------] 18%
1200/5804 [=====>----------------------] 20%
1300/5804 [======>---------------------] 22%
1400/5804 [======>---------------------] 24%
1500/5804 [=======>--------------------] 25%
1600/5804 [=======>--------------------] 27%
1700/5804 [========>-------------------] 29%
1800/5804 [========>-------------------] 31%
1900/5804 [=========>------------------] 32%
2000/5804 [=========>------------------] 34%
2100/5804 [==========>-----------------] 36%
2200/5804 [==========>-----------------] 37%
2300/5804 [===========>----------------] 39%
2400/5804 [===========>----------------] 41%
2500/5804 [============>---------------] 43%
2600/5804 [============>---------------] 44%
2700/5804 [=============>--------------] 46%
2800/5804 [=============>--------------] 48%
2900/5804 [=============>--------------] 49%
3000/5804 [==============>-------------] 51%
3100/5804 [==============>-------------] 53%
3200/5804 [===============>------------] 55%
3300/5804 [===============>------------] 56%
3400/5804 [================>-----------] 58%
3500/5804 [================>-----------] 60%
3600/5804 [=================>----------] 62%
3700/5804 [=================>----------] 63%
3800/5804 [==================>---------] 65%
3900/5804 [==================>---------] 67%
4000/5804 [===================>--------] 68%
4100/5804 [===================>--------] 70%
4200/5804 [====================>-------] 72%
4300/5804 [====================>-------] 74%
4400/5804 [=====================>------] 75%
4500/5804 [=====================>------] 77%
4600/5804 [======================>-----] 79%
4700/5804 [======================>-----] 80%
4800/5804 [=======================>----] 82%
4900/5804 [=======================>----] 84%
5000/5804 [========================>---] 86%
5100/5804 [========================>---] 87%
5200/5804 [=========================>--] 89%
5300/5804 [=========================>--] 91%
5400/5804 [==========================>-] 93%
5500/5804 [==========================>-] 94%
5600/5804 [===========================>] 96%
5700/5804 [===========================>] 98%
5800/5804 [===========================>] 99%
Done
bin is: /var/lib/asterisk/bin
sbin is: /usr/sbin
Symlinking /var/lib/asterisk/bin/fwconsole to /usr/sbin/fwconsole ...Done
Symlinking /var/lib/asterisk/bin/amportal to /usr/sbin/amportal ...Done
Finishing up directory processes...Done!
Running variable replacement...Done
Creating missing #include files...Done
Setting up Asterisk Manager Connection...Done
Running through upgrades...
Checking for upgrades..
No further upgrades necessary
Finished upgrades
Setting FreePBX version to 14.0.1.27...Done
Writing out /etc/amportal.conf...Done
Writing out /etc/freepbx.conf...Done
5804/5804 [============================] 100%sh: 1: cannot create /dev/tty: No such device or address
Installing framework...
Updating table admin...Done
Updating table ampusers...Done
Updating table cronmanager...Done
Updating table featurecodes...Done
Updating table freepbx_log...Done
Updating table freepbx_settings...Done
Updating table globals...Done
Updating table module_xml...Done
Updating table modules...Done
Updating table notifications...Done
No directory /var/www/html/admin/modules/framework/amp_conf/htdocs, install script not needed
Generating CSS...Done
Module framework successfully installed
Updating Hooks...Done
Done
Trusting FreePBX...Trusted
sh: 1: cannot create /dev/tty: No such device or address
Generating default configurations...
Finished generating default configurations
You have successfully installed FreePBX
+ '[' FALSE = FALSE ']'
+ cat
** [freepbx] Enabling Default Modules
+ echo '** [freepbx] Enabling Default Modules'
+ fwconsole ma upgrade framework core
No repos specified, using: [standard] from last GUI settings
framework is newer than online version, unable to upgrade
core is newer than online version, unable to upgrade
Updating Hooks...Done
+ fwconsole ma download cdr
No repos specified, using: [standard] from last GUI settings
Downloading module 'cdr'
Processing cdr
Downloading...
0/169875 [>---------------------------] 0%
20520/169875 [===>------------------------] 12%
35568/169875 [=====>----------------------] 20%
51984/169875 [========>-------------------] 30%
68400/169875 [===========>----------------] 40%
88920/169875 [==============>-------------] 52%
102600/169875 [================>-----------] 60%
119016/169875 [===================>--------] 70%
136800/169875 [======================>-----] 80%
Finished downloading
153216/169875 [=========================>--] 90%
Extracting...Done
Download completed in 7 seconds
169875/169875 [============================] 100%+ '[' FALSE = FALSE ']'
+ mysql -uasterisk -paXaq78w3WOw8tG9 -hfreepbxdb -P3306 asterisk
+ mysql -uasterisk -paXaq78w3WOw8tG9 -hfreepbxdb -P3306 -e 'USE asterisk; UPDATE freepbx_settings SET `value` = "freepbxdb" WHERE keyword = "CDRDBHOST"; UPDATE freepbx_settings SET `value` = "asterisk" WHERE keyword = "CDRDBNAME"; UPDATE freepbx_settings SET `value` = "aXaq78w3WOw8tG9" WHERE keyword = "CDRDBPASS"; UPDATE freepbx_settings SET `value` = "asterisk" WHERE keyword = "CDRDBUSER"; UPDATE freepbx_settings SET `value` = "mysql" WHERE keyword = "CDRDBTYPE"; UPDATE freepbx_settings SET `value` = "3306" WHERE keyword = "CDRDBPORT"; UPDATE freepbx_settings SET `value` = "cdr" WHERE keyword = "CDRDBTABLENAME";'
+ cp -R /var/www/html/admin/modules/cdr/install.php /var/www/html/admin/modules/cdr/.install.php
+ sed -i -e 's/\$db_host = !empty(\$db_host) ? \$db_host : "localhost";/\$db_host = !empty(\$db_host) ? \$db_host : "freepbxdb";/g' /www/freepbx/admin/modules/cdr/install.php
sed: can't read /www/freepbx/admin/modules/cdr/install.php: No such file or directory
+ sed -i -e 's/\$db_name = !empty(\$db_name) ? \$db_name : "asteriskcdrdb";/\$db_name = !empty(\$db_name) ? \$db_name : "asterisk";/g' /www/freepbx/admin/modules/cdr/install.php
sed: can't read /www/freepbx/admin/modules/cdr/install.php: No such file or directory
+ fwconsole ma install cdr
Detected Missing Dependency of: core
Downloading Missing Dependency of: core
Processing core
Downloading...
0/1102743 [>---------------------------] 0%
110808/1102743 [==>-------------------------] 10%
221616/1102743 [=====>----------------------] 20%
331056/1102743 [========>-------------------] 30%
441864/1102743 [===========>----------------] 40%
555408/1102743 [==============>-------------] 50%
666216/1102743 [================>-----------] 60%
774288/1102743 [===================>--------] 70%
883728/1102743 [======================>-----] 80%
993168/1102743 [=========================>--] 90%
Finished downloading
Extracting...Done
Module core successfully downloaded
Installing Missing Dependency of: core
Updating table trunks...Done
Updating table pjsip...Done
Updating table sip...Done
Updating table dahdi...Done
Updating table iax...Done
Updating table indications_zonelist...Done
Updating table devices...Done
Updating table users...Done
Updating table incoming...Done
Updating table outbound_routes...Done
Updating table dahdichandids...Done
Updating table outbound_route_patterns...Done
Updating table outbound_route_sequence...Done
Updating table outbound_route_trunks...Done
Updating table outbound_routes...Done
Updating table trunk_dialpatterns...Done
Migrating pickup groups to named pickup groups
Migrating call groups to named call groups
Checking for possibly invalid emergency caller id fields..none found
Migrating old media encryption values...done
Generating CSS...Done
Installed Missing Dependency of: core
Checking if field cnum is present in cdr table..OK!
Checking if field cnam is present in cdr table..OK!
Checking if field outbound_cnum is present in cdr table..OK!
Checking if field outbound_cnam is present in cdr table..OK!
Checking if field dst_cnam is present in cdr table..OK!
Checking if field linkedid is present in cdr table..Adding!
Checking if field peeraccount is present in cdr table..Adding!
Checking if field sequence is present in cdr table..Adding!
OK!
Generating CSS...Done
Module cdr successfully installed
Updating Hooks...Done
1102743/1102743 [============================] 100%+ cp -R /var/www/html/admin/modules/cdr/.install.php /var/www/html/admin/modules/cdr/install.php
+ fwconsole ma upgrade voicemail sipsettings infoservices featurecodeadmin logfiles callrecording dashboard music conferences
No repos specified, using: [standard] from last GUI settings
voicemail is newer than online version, unable to upgrade
sipsettings is newer than online version, unable to upgrade
infoservices is newer than online version, unable to upgrade
featurecodeadmin is newer than online version, unable to upgrade
logfiles is newer than online version, unable to upgrade
callrecording is newer than online version, unable to upgrade
dashboard is newer than online version, unable to upgrade
music is newer than online version, unable to upgrade
conferences is newer than online version, unable to upgrade
Updating Hooks...Done
+ fwconsole ma upgrade certman userman pm2
No repos specified, using: [standard] from last GUI settings
certman is newer than online version, unable to upgrade
userman is newer than online version, unable to upgrade
pm2 is newer than online version, unable to upgrade
Updating Hooks...Done
+ fwconsole chown
Taking too long? Customize the chown command, See http://wiki.freepbx.org/display/FOP/FreePBX+Chown+Conf
Setting Permissions...
Setting base permissions...Done
Setting specific permissions...
0 [>---------------------------]
Finished setting permissions
100 [---------------->-----------]+ fwconsole reload
Reloading FreePBX
Error(s) have occured, the following is the retrieve_conf output:
exit: 255
Unable to continue. SQLSTATE[42S02]: Base table or view not found: 1146 Table 'asterisk.voicemail_admin' doesn't exist in /var/www/html/admin/libraries/BMO/Database.class.php on line 338
#0 /var/www/html/admin/libraries/BMO/Database.class.php(338): PDO->query('SELECT `value` ...')
#1 /var/www/html/admin/libraries/BMO/Database.class.php(285): FreePBX\Database->sql_getOne('SELECT `value` ...')
#2 /var/www/html/admin/libraries/DB.class.php(235): FreePBX\Database->sql('SELECT `value` ...', 'getOne', 3)
#3 /var/www/html/admin/libraries/sql.functions.php(29): DB->sql('SELECT `value` ...', 'getOne')
#4 /var/www/html/admin/modules/core/functions.inc.php(3294): sql('SELECT `value` ...', 'getOne')
#5 /var/www/html/admin/libraries/BMO/DialplanHooks.class.php(95): core_do_get_config('asterisk')
#6 /data/var/lib/asterisk/bin/retrieve_conf(861): FreePBX\DialplanHooks->processHooks('asterisk', Array)
#7 {main}
+ fwconsole ma upgrade ucp
No repos specified, using: [standard] from last GUI settings
ucp is newer than online version, unable to upgrade
Updating Hooks...Done
+ fwconsole chown
Taking too long? Customize the chown command, See http://wiki.freepbx.org/display/FOP/FreePBX+Chown+Conf
Setting Permissions...
Setting base permissions...Done
Setting specific permissions...
0 [>---------------------------]
100 [---------------->-----------]
Finished setting permissions
200 [---->-----------------------]+ fwconsole reload
Reloading FreePBX
Error(s) have occured, the following is the retrieve_conf output:
exit: 255
Unable to continue. SQLSTATE[42S02]: Base table or view not found: 1146 Table 'asterisk.voicemail_admin' doesn't exist in /var/www/html/admin/libraries/BMO/Database.class.php on line 338
#0 /var/www/html/admin/libraries/BMO/Database.class.php(338): PDO->query('SELECT `value` ...')
#1 /var/www/html/admin/libraries/BMO/Database.class.php(285): FreePBX\Database->sql_getOne('SELECT `value` ...')
#2 /var/www/html/admin/libraries/DB.class.php(235): FreePBX\Database->sql('SELECT `value` ...', 'getOne', 3)
#3 /var/www/html/admin/libraries/sql.functions.php(29): DB->sql('SELECT `value` ...', 'getOne')
#4 /var/www/html/admin/modules/core/functions.inc.php(3294): sql('SELECT `value` ...', 'getOne')
#5 /var/www/html/admin/libraries/BMO/DialplanHooks.class.php(95): core_do_get_config('asterisk')
#6 /data/var/lib/asterisk/bin/retrieve_conf(861): FreePBX\DialplanHooks->processHooks('asterisk', Array)
#7 {main}
+ fwconsole restart
Running FreePBX shutdown...
Shutting down Asterisk Gracefully. Will forcefully kill after 30 seconds.
Press C to Cancel
Press N to shut down NOW
stty: 'standard input': Inappropriate ioctl for device
stty: 'standard input': Inappropriate ioctl for device
[>---------------------------] < 1 sec[>---------------------------] < 1 sec
[---------------->-----------] < 1 secstty: 'standard input': Inappropriate ioctl for device
Running FreePBX startup...
Starting Asterisk...
[>---------------------------] < 1 sec
[->--------------------------] < 1 sec
[-->-------------------------] < 1 sec
[--->------------------------] < 1 sec
[---->-----------------------] < 1 sec
[----->----------------------] < 1 sec
[------>---------------------] < 1 sec
Asterisk Started
[------->--------------------] < 1 sec
[-------->-------------------] 3 secs+ fwconsole stop
Running FreePBX shutdown...
Shutting down Asterisk Gracefully. Will forcefully kill after 30 seconds.
Press C to Cancel
Press N to shut down NOW
stty: 'standard input': Inappropriate ioctl for device
stty: 'standard input': Inappropriate ioctl for device
[>---------------------------] < 1 sec[>---------------------------] < 1 sec
[---------------->-----------] < 1 secstty: 'standard input': Inappropriate ioctl for device
+ cd /
+ rm -rf /usr/src/freepbx
+ touch /data/.installed
+ '[' '!' -f /usr/sbin/fwconsole ']'
+ '[' '!' -f /usr/sbin/amportal ']'
+ '[' '!' -f /data/etc/amportal.conf ']'
+ mkdir -p /data/etc/
+ cp -R /etc/amportal.conf /data/etc/
+ rm -rf /etc/amportal.conf
+ touch /data/etc/amportal.conf
+ chown asterisk:asterisk /data/etc/amportal.conf
+ ln -s /data/etc/amportal.conf /etc/amportal.conf
+ '[' FALSE = TRUE ']'
+ '[' FALSE = FALSE ']'
+ echo '** [freepbx] Setting Configuration'
** [freepbx] Setting Configuration
+ cat
+ cat
+ '[' '!' -f /etc/asterisk/cdr_adaptive_odbc.conf ']'
+ chown asterisk:asterisk /etc/freepbx.conf
** [freepbx] Set RTP Ports
+ '[' FALSE = FALSE ']'
+ echo '** [freepbx] Set RTP Ports'
+ mysql -uasterisk -paXaq78w3WOw8tG9 -hfreepbxdb -P3306 -e 'USE asterisk; UPDATE sipsettings SET `data` = "18000" WHERE keyword = "rtpstart"; UPDATE sipsettings SET `data` = "20000" WHERE keyword = "rtpend";'
ERROR 1146 (42S02) at line 1: Table 'asterisk.sipsettings' doesn't exist
+ mysql -uasterisk -paXaq78w3WOw8tG9 -hfreepbxdb -P3306 -e 'USE asterisk; ALTER TABLE featurecodes CHANGE column helptext helptext VARCHAR(10000);'
+ echo '** [freepbx] Starting Asterisk'
+ fwconsole chown
** [freepbx] Starting Asterisk
+ fwconsole start
+ fwconsole reload
+ chown -R asterisk /etc/asterisk/asterisk.conf /etc/asterisk/cdr_adaptive_odbc.conf /etc/asterisk/dnsmgr.conf /etc/asterisk/enum.conf /etc/asterisk/extensions.conf /etc/asterisk/features.conf /etc/asterisk/freepbx_module_admin.conf /etc/asterisk/http.conf /etc/asterisk/iax.conf /etc/asterisk/indications.conf /etc/asterisk/manager.conf /etc/asterisk/manager_additional.conf /etc/asterisk/manager_custom.conf /etc/asterisk/meetme.conf /etc/asterisk/meetme_additional.conf /etc/asterisk/meetme_general_additional.conf /etc/asterisk/meetme_general_custom.conf /etc/asterisk/modules.conf /etc/asterisk/musiconhold.conf /etc/asterisk/musiconhold_additional.conf /etc/asterisk/musiconhold_custom.conf /etc/asterisk/phpagi.conf /etc/asterisk/privacy.conf /etc/asterisk/queues.conf /etc/asterisk/queues_additional.conf /etc/asterisk/queues_custom.conf /etc/asterisk/queues_custom_general.conf /etc/asterisk/queues_general_additional.conf /etc/asterisk/queues_post_custom.conf /etc/asterisk/res_odbc.conf /etc/asterisk/rtp.conf /etc/asterisk/sip.conf /etc/asterisk/sip_notify.conf /etc/asterisk/udptl.conf /etc/asterisk/voicemail.conf /etc/asterisk/voicemail.conf.template
+ cat
+ a2enconf allowoverride
+ sed -i 's/\(APACHE_RUN_USER=\)\(.*\)/\1asterisk/g' /etc/apache2/envvars
+ sed -i 's/\(APACHE_RUN_GROUP=\)\(.*\)/\1asterisk/g' /etc/apache2/envvars
+ chown asterisk. /run/lock/apache2
+ a2enmod rewrite
+ service apache2 restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.4. Set the 'ServerName' directive globally to suppress this message
+ mkdir -p /tmp/state
+ touch /tmp/state/10-freepbx-init
[cont-init.d] 10-freepbx: exited 0.
[cont-init.d] 99-container-init: executing...
[cont-init.d] 99-container-init: exited 0.
[cont-init.d] done.
[services.d] starting services
**** [zabbix] Starting Zabbix Agent
[services.d] done.
Interesting about the Build Native. Well, at least thats solved for now, however it seems you've got some other issues here. What I'm seeing here is that it already thinks its been installed. I'm willing to guess since you've tried it a few times perhaps you have a volume somewhere that its making reference to which is causing the problems.
Can you get rid of your /data/ and logs folder in the directory and just start with the docker-compose.yml file?
Also, it might help before you start it up again for the first time to clean your old volumes from your system. I use docker volume prune -a
for that on my system.
Same issue with docker-compose file. I found out it's most likely due to the script not successfully installing the appropriate modules for FreePBX to work. I also can't install them manually from CLI...
Unable to install module sipsettings:
But I can install them from dashboard. Strange. Despite the huge warning telling me that the Framework module isn't signed, now everything seems to work.
Hey, got it fixed.
This should be enough for it to work (at least for me). Thanks for your time in building this image.
Sorry about my delay in getting back to this. We're now getting ready to use this in production and I believe that my list commit actually not meant to be put to the public for use, I am seeing the same issues.
Today I am rebuilding the images and seem to have resolved all the issues. You are right about the fwconsole ma upgrade. I was working off a local cache. Thanks for the pointers though, when I re-fired this back up on a new installation today I was scratching my head as to why things had stopped working.
I'm having several errors trying to deploy this on docker, also I'm always greeted with the "It works!" page on Apache.
First I create the appropriate volumes.
Then I deploy your mariadb image:
docker run -d --name freepbxdb -e MYSQL_ROOT_PASSWORD=passwordhere -e MYSQL_DATABASE=asterisk -e MYSQL_USER=asterisk -e MYSQL_PASSWORD=rootpasswordhere -v mariadb:/var/lib/mysql tiredofit/mariadb
And finally the FreePBX container:
docker run -d --name freepbxapp -e DB_EMBEDDED=FALSE -e ZABBIX_HOSTNAME=freepbx-app -e RTP_START=18000 -e RTP_FINISH=20000 -e DEBUG_MODE=TRUE -e DB_HOST=freepbxdb -e DB_NAME=asterisk -e DB_USER=asterisk -e DB_PASS=passwordhere -v freepbx-certs:/certs -v freepbx-web:/www/freepbx -v freepbx-logs:/www/logs -v freepbx-data:/data --link freepbxdb:freepbxdb -p 8000:80 -p 4569:4569 -p 5060:5060/udp -p 5160:5160 -p 18000-20000:18000-20000/udp tiredofit/freepbx
I have a couple of test images and portainer installed.
Docker log output: