ugoviti / izpbx

izPBX is a Turnkey Cloud Native Telephony System powered by Asterisk Engine and FreePBX Management GUI
GNU General Public License v3.0
189 stars 74 forks source link

Container doesn't run due to "illegal instruction" in /usr/sbin/safe_asterisk (architecture mismatch) #82

Open exentio opened 2 months ago

exentio commented 2 months ago

Hello, I'm trying to run the container but every release from 20.16.14 onwards crashes and keeps reloading due to an "illegal instruction" error, which is probably related to the CPU architecture: case on point, 20.16.14 is the release that introduced arm64 support.
20.16.13 seems to work, but I can't use it due to an issue that resembles #68, maybe a regression on FreePBX?

For context, the distro is Arch Linux and I'm using a Celeron J4125 machine.

izpbx     | =====================================================================
izpbx     | => !!! NEW INSTALLATION DETECTED :: FreePBX IS NOT INITIALIZED !!! <=
izpbx     | =====================================================================
izpbx     | --> missing '/data/.initialized' file... initializing FreePBX... try:[1/5]
izpbx     | 
izpbx     | 
izpbx     | STARTING ASTERISK
izpbx     | /usr/sbin/safe_asterisk: line 171:   529 Illegal instruction     (core dumped) nice -n $PRIORITY "${ASTSBINDIR}/asterisk" -f ${CLIARGS} ${ASTARGS} > /dev/${TTY} 2>&1 < /dev/${TTY}
izpbx     | Asterisk Started
izpbx     | /usr/sbin/safe_asterisk: line 171:   605 Illegal instruction     (core dumped) nice -n $PRIORITY "${ASTSBINDIR}/asterisk" -f ${CLIARGS} ${ASTARGS} > /dev/${TTY} 2>&1 < /dev/${TTY}
izpbx     | /usr/sbin/safe_asterisk: line 171:   681 Illegal instruction     (core dumped) nice -n $PRIORITY "${ASTSBINDIR}/asterisk" -f ${CLIARGS} ${ASTARGS} > /dev/${TTY} 2>&1 < /dev/${TTY}
izpbx     | --> installing FreePBX in '/data/var/www/html'
izpbx     | ---> START install FreePBX @ Sun Sep  1 01:56:55 CEST 2024
izpbx     | ---> creating and grantig access to FreePBX databases: asterisk, asteriskcdrdb
izpbx     | ++ ./install -n --skip-install --no-ansi --dbhost=127.0.0.1 --dbport=3307 --dbuser=asterisk --dbpass=XXXXXX --dbname=asterisk --cdrdbname=asteriskcdrdb --webroot=/data/var/www/html --astetcdir=/data/etc/asterisk --astvarlibdir=/data/var/lib/asterisk --astagidir=/data/var/lib/asterisk/agi-bin --astspooldir=/data/var/spool/asterisk --astrundir=/var/run/asterisk --astlogdir=/data/var/log/asterisk --ampbin=/data/var/lib/asterisk/bin --ampsbin=/data/var/lib/asterisk/sbin --ampcgibin=/data/var/www/cgi-bin --ampplayback=/data/var/lib/asterisk/playback --astmoddir=/usr/lib64/asterisk/modules
izpbx     | Checking if SELinux is enabled...Its not (good)!
izpbx     | Reading /etc/asterisk/asterisk.conf...Done
izpbx     | Checking if Asterisk is running and we can talk to it as the 'asterisk' user...Error!
izpbx     | Error communicating with Asterisk.  Ensure that Asterisk is properly installed and running as the asterisk user
izpbx     | Asterisk appears to be running as asterisk
izpbx     | Try starting Asterisk with the './start_asterisk start' command in this directory
izpbx     | ++ RETVAL=1
izpbx     | ++ set +x
izpbx     | ---> END install FreePBX @ Sun Sep  1 01:56:55 CEST 2024
izpbx     | --> WARNING: unable to install FreePBX 16... restarting in 10 seconds... try:[2/5]
izpbx     | /usr/sbin/safe_asterisk: line 171:   779 Illegal instruction     (core dumped) nice -n $PRIORITY "${ASTSBINDIR}/asterisk" -f ${CLIARGS} ${ASTARGS} > /dev/${TTY} 2>&1 < /dev/${TTY}
izpbx     | /usr/sbin/safe_asterisk: line 171:   851 Illegal instruction     (core dumped) nice -n $PRIORITY "${ASTSBINDIR}/asterisk" -f ${CLIARGS} ${ASTARGS} > /dev/${TTY} 2>&1 < /dev/${TTY}
ilia19945 commented 1 month ago

I have the same issue running on my mac m1

mymac:izpbx user$ docker-compose up -d [+] Running 4/4 ✔ Network izpbx_izpbx Created 0.0s ✔ Container izpbx-db Started 0.3s ✔ Container izpbx Started 0.4s ! izpbx The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

on the container:

2024-09-24 17:06:20 izpbx | => Starting container izPBX Cloud Native Telephony System -> izpbx-asterisk:20.16.16 (build:128 commit:ba5b039 date:2024-08-09) 2024-09-24 17:06:20 izpbx | =============================================================================== 2024-09-24 17:06:20 izpbx | => Executing izpbx-asterisk hooks: 2024-09-24 17:06:20 izpbx | --> Custom Script Hooks: OFF 2024-09-24 17:06:20 izpbx | --> fixing supervisord config file... 2024-09-24 17:06:20 izpbx | ---> RHEL Linux based distro detected 2024-09-24 17:06:20 izpbx | => Persistent storage path detected... relocating and reconfiguring system data and configuration files using basedir: '/data' 2024-09-24 17:06:20 izpbx | --> [01/17] INFO: [/etc/dnsmasq.d] detected directory data override path: '/data/etc/dnsmasq.d' 2024-09-24 17:06:20 izpbx | ----------> INFO: [/etc/dnsmasq.d] renaming '/etc/dnsmasq.d' to '/etc/dnsmasq.d.dist' 2024-09-24 17:06:20 izpbx | ----------> INFO: [/etc/dnsmasq.d] symlinking '/etc/dnsmasq.d' to '/data/etc/dnsmasq.d' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/etc/dnsmasq.d.dist] data dir '/data/etc/dnsmasq.d' is already initialized... skipping data initialization 2024-09-24 17:06:21 izpbx | --> [02/17] INFO: [/var/log/fail2ban] detected directory data override path: '/data/var/log/fail2ban' 2024-09-24 17:06:21 izpbx | ----------> WARN: [/var/log/fail2ban] default directory doesn't exist... creating empty directory '/var/log/fail2ban' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/var/log/fail2ban] renaming '/var/log/fail2ban' to '/var/log/fail2ban.dist' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/var/log/fail2ban] symlinking '/var/log/fail2ban' to '/data/var/log/fail2ban' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/var/log/fail2ban.dist] data dir '/data/var/log/fail2ban' is already initialized... skipping data initialization 2024-09-24 17:06:21 izpbx | --> [03/17] INFO: [/var/log/asterisk] detected directory data override path: '/data/var/log/asterisk' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/var/log/asterisk] renaming '/var/log/asterisk' to '/var/log/asterisk.dist' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/var/log/asterisk] symlinking '/var/log/asterisk' to '/data/var/log/asterisk' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/var/log/asterisk.dist] data dir '/data/var/log/asterisk' is already initialized... skipping data initialization 2024-09-24 17:06:21 izpbx | --> [04/17] INFO: [/etc/asterisk] detected directory data override path: '/data/etc/asterisk' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/etc/asterisk] renaming '/etc/asterisk' to '/etc/asterisk.dist' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/etc/asterisk] symlinking '/etc/asterisk' to '/data/etc/asterisk' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/etc/asterisk.dist] data dir '/data/etc/asterisk' is already initialized... skipping data initialization 2024-09-24 17:06:21 izpbx | --> [05/17] INFO: [/var/log/httpd] detected directory data override path: '/data/var/log/httpd' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/var/log/httpd] renaming '/var/log/httpd' to '/var/log/httpd.dist' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/var/log/httpd] symlinking '/var/log/httpd' to '/data/var/log/httpd' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/var/log/httpd.dist] data dir '/data/var/log/httpd' is already initialized... skipping data initialization 2024-09-24 17:06:21 izpbx | --> [06/17] INFO: [/home/asterisk] detected directory data override path: '/data/home/asterisk' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/home/asterisk] renaming '/home/asterisk' to '/home/asterisk.dist' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/home/asterisk] symlinking '/home/asterisk' to '/data/home/asterisk' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/home/asterisk.dist] data dir '/data/home/asterisk' is already initialized... skipping data initialization 2024-09-24 17:06:21 izpbx | --> [07/17] INFO: [/var/lib/fail2ban] detected directory data override path: '/data/var/lib/fail2ban' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/var/lib/fail2ban] renaming '/var/lib/fail2ban' to '/var/lib/fail2ban.dist' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/var/lib/fail2ban] symlinking '/var/lib/fail2ban' to '/data/var/lib/fail2ban' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/var/lib/fail2ban.dist] data dir '/data/var/lib/fail2ban' is already initialized... skipping data initialization 2024-09-24 17:06:21 izpbx | --> [08/17] INFO: [/root] detected directory data override path: '/data/root' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/root] renaming '/root' to '/root.dist' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/root] symlinking '/root' to '/data/root' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/root.dist] data dir '/data/root' is already initialized... skipping data initialization 2024-09-24 17:06:21 izpbx | --> [09/17] INFO: [/var/spool/asterisk] detected directory data override path: '/data/var/spool/asterisk' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/var/spool/asterisk] renaming '/var/spool/asterisk' to '/var/spool/asterisk.dist' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/var/spool/asterisk] symlinking '/var/spool/asterisk' to '/data/var/spool/asterisk' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/var/spool/asterisk.dist] data dir '/data/var/spool/asterisk' is already initialized... skipping data initialization 2024-09-24 17:06:21 izpbx | --> [10/17] INFO: [/usr/local/fop2] detected directory data override path: '/data/usr/local/fop2' 2024-09-24 17:06:21 izpbx | ----------> WARN: [/usr/local/fop2] default directory doesn't exist... creating empty directory '/usr/local/fop2' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/usr/local/fop2] renaming '/usr/local/fop2' to '/usr/local/fop2.dist' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/usr/local/fop2] symlinking '/usr/local/fop2' to '/data/usr/local/fop2' 2024-09-24 17:06:21 izpbx | ----------> INFO: [/usr/local/fop2.dist] data dir '/data/usr/local/fop2' is already initialized... skipping data initialization 2024-09-24 17:06:22 izpbx | --> [11/17] INFO: [/var/www] detected directory data override path: '/data/var/www' 2024-09-24 17:06:22 izpbx | ----------> INFO: [/var/www] renaming '/var/www' to '/var/www.dist' 2024-09-24 17:06:22 izpbx | ----------> INFO: [/var/www] symlinking '/var/www' to '/data/var/www' 2024-09-24 17:06:22 izpbx | ----------> INFO: [/var/www.dist] data dir '/data/var/www' is already initialized... skipping data initialization 2024-09-24 17:06:22 izpbx | --> [12/17] INFO: [/var/lib/tftpboot] detected directory data override path: '/data/var/lib/tftpboot' 2024-09-24 17:06:22 izpbx | ----------> WARN: [/var/lib/tftpboot] default directory doesn't exist... creating empty directory '/var/lib/tftpboot' 2024-09-24 17:06:22 izpbx | ----------> INFO: [/var/lib/tftpboot] renaming '/var/lib/tftpboot' to '/var/lib/tftpboot.dist' 2024-09-24 17:06:22 izpbx | ----------> INFO: [/var/lib/tftpboot] symlinking '/var/lib/tftpboot' to '/data/var/lib/tftpboot' 2024-09-24 17:06:22 izpbx | ----------> INFO: [/var/lib/tftpboot.dist] data dir '/data/var/lib/tftpboot' is already initialized... skipping data initialization 2024-09-24 17:06:22 izpbx | --> [13/17] INFO: [/var/spool/cron] detected directory data override path: '/data/var/spool/cron' 2024-09-24 17:06:22 izpbx | ----------> INFO: [/var/spool/cron] renaming '/var/spool/cron' to '/var/spool/cron.dist' 2024-09-24 17:06:22 izpbx | ----------> INFO: [/var/spool/cron] symlinking '/var/spool/cron' to '/data/var/spool/cron' 2024-09-24 17:06:22 izpbx | ----------> INFO: [/var/spool/cron.dist] data dir '/data/var/spool/cron' is already initialized... skipping data initialization 2024-09-24 17:06:22 izpbx | --> [14/17] INFO: [/var/lib/dnsmasq] detected directory data override path: '/data/var/lib/dnsmasq' 2024-09-24 17:06:22 izpbx | ----------> INFO: [/var/lib/dnsmasq] renaming '/var/lib/dnsmasq' to '/var/lib/dnsmasq.dist' 2024-09-24 17:06:22 izpbx | ----------> INFO: [/var/lib/dnsmasq] symlinking '/var/lib/dnsmasq' to '/data/var/lib/dnsmasq' 2024-09-24 17:06:22 izpbx | ----------> INFO: [/var/lib/dnsmasq.dist] data dir '/data/var/lib/dnsmasq' is already initialized... skipping data initialization 2024-09-24 17:06:22 izpbx | --> [15/17] INFO: [/var/lib/asterisk] detected directory data override path: '/data/var/lib/asterisk' 2024-09-24 17:06:22 izpbx | ----------> INFO: [/var/lib/asterisk] renaming '/var/lib/asterisk' to '/var/lib/asterisk.dist' 2024-09-24 17:06:22 izpbx | ----------> INFO: [/var/lib/asterisk] symlinking '/var/lib/asterisk' to '/data/var/lib/asterisk' 2024-09-24 17:06:22 izpbx | ----------> INFO: [/var/lib/asterisk.dist] data dir '/data/var/lib/asterisk' is already initialized... skipping data initialization 2024-09-24 17:06:22 izpbx | --> [16/17] INFO: [/etc/amportal.conf] file data override detected: default:[/etc/amportal.conf] custom:[/data/etc/amportal.conf] 2024-09-24 17:06:22 izpbx | ----------> WARN: [/etc/amportal.conf] default file doesn't exist... creating symlink from a not existing source file 2024-09-24 17:06:22 izpbx | ----------> INFO: [/etc/amportal.conf] symlinking '/etc/amportal.conf' to '/data/etc/amportal.conf' 2024-09-24 17:06:22 izpbx | --> [17/17] INFO: [/etc/freepbx.conf] file data override detected: default:[/etc/freepbx.conf] custom:[/data/etc/freepbx.conf] 2024-09-24 17:06:22 izpbx | ----------> WARN: [/etc/freepbx.conf] default file doesn't exist... creating symlink from a not existing source file 2024-09-24 17:06:22 izpbx | ----------> INFO: [/etc/freepbx.conf] symlinking '/etc/freepbx.conf' to '/data/etc/freepbx.conf' 2024-09-24 17:06:22 izpbx | --> verifying files permissions 2024-09-24 17:06:22 izpbx | ---> fixing owner: '/var/lib/tftpboot' 2024-09-24 17:06:22 izpbx | => Setting up MSMTP as (default) sendmail replacement 2024-09-24 17:06:22 izpbx | --> forwarding all emails to: 2024-09-24 17:06:22 izpbx | => Disabling postfix service... because POSTFIX_ENABLED=false 2024-09-24 17:06:22 izpbx | => Enabling cron service... because CRON_ENABLED=true 2024-09-24 17:06:22 izpbx | --> configuring cron service... 2024-09-24 17:06:22 izpbx | ---> fixing permissions: '/var/spool/cron' 2024-09-24 17:06:22 izpbx | => Enabling fail2ban service... because FAIL2BAN_ENABLED=true 2024-09-24 17:06:22 izpbx | --> configuring fail2ban service... 2024-09-24 17:06:22 izpbx | --> reconfiguring Fail2ban settings... 2024-09-24 17:06:24 izpbx | => Enabling httpd service... because HTTPD_ENABLED=true 2024-09-24 17:06:24 izpbx | --> configuring httpd service... 2024-09-24 17:06:24 izpbx | --> setting Apache ServerName to docker-desktop 2024-09-24 17:06:24 izpbx | --> configuring Apache VirtualHosting and creating empty /etc/httpd/conf.d/virtual.conf file 2024-09-24 17:06:24 izpbx | => Disabling asterisk service... because ASTERISK_ENABLED=false 2024-09-24 17:06:24 izpbx | => Enabling izpbx service... because IZPBX_ENABLED=true 2024-09-24 17:06:24 izpbx | --> configuring izpbx service... 2024-09-24 17:06:24 izpbx | ---> verifing FreePBX configurations 2024-09-24 17:06:24 izpbx | ---> using '/data' as basedir for FreePBX install 2024-09-24 17:06:24 izpbx | ---> fixing permissions for: ASTLOGDIR=/var/log/asterisk 2024-09-24 17:06:24 izpbx | ---> fixing permissions for: ASTETCDIR=/etc/asterisk 2024-09-24 17:06:24 izpbx | ---> fixing permissions for: ASTSPOOLDIR=/var/spool/asterisk 2024-09-24 17:06:24 izpbx | ---> fixing permissions for: ASTVARLIBDIR=/var/lib/asterisk 2024-09-24 17:06:24 izpbx | ---> configuring FreePBX ODBC 2024-09-24 17:06:24 izpbx | 2024-09-24 17:06:24 izpbx | ===================================================================== 2024-09-24 17:06:24 izpbx | => !!! NEW INSTALLATION DETECTED :: FreePBX IS NOT INITIALIZED !!! <= 2024-09-24 17:06:24 izpbx | ===================================================================== 2024-09-24 17:06:24 izpbx | --> missing '/data/.initialized' file... initializing FreePBX... try:[1/5] 2024-09-24 17:06:24 izpbx | 2024-09-24 17:06:24 izpbx | 2024-09-24 17:06:24 izpbx | STARTING ASTERISK 2024-09-24 17:06:25 izpbx | /usr/sbin/safe_asterisk: line 171: 535 Illegal instruction (core dumped) nice -n $PRIORITY "${ASTSBINDIR}/asterisk" -f ${CLIARGS} ${ASTARGS} > /dev/${TTY} 2>&1 < /dev/${TTY} 2024-09-24 17:06:30 izpbx | /usr/sbin/safe_asterisk: line 171: 612 Illegal instruction (core dumped) nice -n $PRIORITY "${ASTSBINDIR}/asterisk" -f ${CLIARGS} ${ASTARGS} > /dev/${TTY} 2>&1 < /dev/${TTY} 2024-09-24 17:06:31 izpbx | Asterisk Started 2024-09-24 17:06:35 izpbx | /usr/sbin/safe_asterisk: line 171: 697 Illegal instruction (core dumped) nice -n $PRIORITY "${ASTSBINDIR}/asterisk" -f ${CLIARGS} ${ASTARGS} > /dev/${TTY} 2>&1 < /dev/${TTY} 2024-09-24 17:06:40 izpbx | /usr/sbin/safe_asterisk: line 171: 774 Illegal instruction (core dumped) nice -n $PRIORITY "${ASTSBINDIR}/asterisk" -f ${CLIARGS} ${ASTARGS} > /dev/${TTY} 2>&1 < /dev/${TTY} 2024-09-24 17:06:41 izpbx | --> installing FreePBX in '/data/var/www/html' 2024-09-24 17:06:41 izpbx | ---> START install FreePBX @ Tue Sep 24 14:06:41 UTC 2024 2024-09-24 17:06:41 izpbx | ---> creating and grantig access to FreePBX databases: asterisk, asteriskcdrdb 2024-09-24 17:06:41 izpbx | ++ ./install -n --skip-install --no-ansi --dbhost=127.0.0.1 --dbport=3306 --dbuser=asterisk --dbpass=PleaseCHANGEM3 --dbname=asterisk --cdrdbname=asteriskcdrdb --webroot=/data/var/www/html --astetcdir=/data/etc/asterisk --astvarlibdir=/data/var/lib/asterisk --astagidir=/data/var/lib/asterisk/agi-bin --astspooldir=/data/var/spool/asterisk --astrundir=/var/run/asterisk --astlogdir=/data/var/log/asterisk --ampbin=/data/var/lib/asterisk/bin --ampsbin=/data/var/lib/asterisk/sbin --ampcgibin=/data/var/www/cgi-bin --ampplayback=/data/var/lib/asterisk/playback --astmoddir=/usr/lib64/asterisk/modules 2024-09-24 17:06:41 izpbx | Checking if SELinux is enabled...Its not (good)! 2024-09-24 17:06:41 izpbx | Reading /etc/asterisk/asterisk.conf...Done 2024-09-24 17:06:41 izpbx | Checking if Asterisk is running and we can talk to it as the 'asterisk' user...Error! 2024-09-24 17:06:41 izpbx | Error communicating with Asterisk. Ensure that Asterisk is properly installed and running as the asterisk user 2024-09-24 17:06:41 izpbx | Asterisk appears to be running as asterisk 2024-09-24 17:06:41 izpbx | Try starting Asterisk with the './start_asterisk start' command in this directory 2024-09-24 17:06:41 izpbx | ++ RETVAL=1 2024-09-24 17:06:41 izpbx | ++ set +x 2024-09-24 17:06:41 izpbx | ---> END install FreePBX @ Tue Sep 24 14:06:41 UTC 2024 2024-09-24 17:06:41 izpbx | --> WARNING: unable to install FreePBX 16... restarting in 10 seconds... try:[2/5] 2024-09-24 17:06:44 izpbx | /usr/sbin/safe_asterisk: line 171: 877 Illegal instruction (core dumped) nice -n $PRIORITY "${ASTSBINDIR}/asterisk" -f ${CLIARGS} ${ASTARGS} > /dev/${TTY} 2>&1 < /dev/${TTY} 2024-09-24 17:06:49 izpbx | /usr/sbin/safe_asterisk: line 171: 954 Illegal instruction (core dumped) nice -n $PRIORITY "${ASTSBINDIR}/asterisk" -f ${CLIARGS} ${ASTARGS} > /dev/${TTY} 2>&1 < /dev/${TTY}