ISPconfig3 update failure

Discussion in 'Installation/Configuration' started by Redwarp, Mar 29, 2020.

  1. Redwarp

    Redwarp New Member

    Hi
    I ran a full package update on my ubuntu 18 server, then I went to run ispconfig update and get this:
    Operating System: Ubuntu 18.04.4 LTS (Bionic Beaver)

    PHP Deprecated: Function get_magic_quotes_runtime() is deprecated in /usr/local/ispconfig/server/lib/config.inc.php on line 48
    This application will update ISPConfig 3 on your server.

    Shall the script create a ISPConfig backup in /var/backup/ now? (yes,no) [yes]:

    Creating backup of "/usr/local/ispconfig" directory...
    Creating backup of "/etc" directory...
    PHP Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in /tmp/update_stable.sh.6qUurAT1eu/ispconfig3_install/install/update.php:240
    Stack trace:
    #0 {main}
    thrown in /tmp/update_stable.sh.6qUurAT1eu/ispconfig3_install/install/update.php on line 240

    I am trying to run the update, mainly to start to get rid of a stuck job queue, ever since I did the server updates, I then went to remove letsencrypt ssl from one site and that job got stuck, now I have a large queue of others :(
    (I already had done the letsencrypt force update on certbot etc)
    Cheers
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Was that server Ubuntu 16.04 prior to the update?
    Looks like the PHP module or package that provides mysql_connect is not installed for the PHP version that ISPConfig uses. Did you by mistake change the default PHP version of operating system?
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    The reason for the stuck queue and the update failure is that your commandline PHP has no MySQL support. Probably you exchanged the PHP version or installed additional PHP version without installing the MySQL package for the new PHP version.
     
  4. Redwarp

    Redwarp New Member

    Thanks for prompt response guys.
    Ubuntu has not changed versions, I just ran a package update from cli
    It does seem to be the php version, default on server now appears to be 7.4 so I now also installed php7.4-mysql
    Now goes farther through the update script and fails with this:
    PHP Fatal error: Uncaught Error: Call to undefined function mb_detect_encoding() in /tmp/update_stable.sh.245HG3NLk3/ispconfig3_install/install/lib/mysql.lib.php:448
    Stack trace:
    #0 /tmp/update_stable.sh.245HG3NLk3/ispconfig3_install/install/lib/mysql.lib.php(166): db->escape()
    #1 /tmp/update_stable.sh.245HG3NLk3/ispconfig3_install/install/lib/mysql.lib.php(231): db->_build_query_string()
    #2 /tmp/update_stable.sh.245HG3NLk3/ispconfig3_install/install/lib/mysql.lib.php(270): db->_query()
    #3 /tmp/update_stable.sh.245HG3NLk3/ispconfig3_install/install/lib/mysql.lib.php(319): db->query()
    #4 /tmp/update_stable.sh.245HG3NLk3/ispconfig3_install/install/lib/update.lib.php(139): db->queryAllRecords()
    #5 /tmp/update_stable.sh.245HG3NLk3/ispconfig3_install/install/update.php(315): updateDbAndIni()
    #6 {main}
    thrown in /tmp/update_stable.sh.245HG3NLk3/ispconfig3_install/install/lib/mysql.lib.php on line 448
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    You installed PHP from a third-party repository and this messed up your default PHP version. PHP 7.4 is not the default version of Ubuntu 18.04, Ubuntu 18.04 uses PHP 7.2. To fix that, run these two commands:

    update-alternatives --config php
    update-alternatives --config php-cgi

    and select the original PHP version which ships with that Ubuntu version as default PHP.
     
    Last edited: Mar 29, 2020
  6. Redwarp

    Redwarp New Member

    Oh thats odd
    I thought I had installed 5.4 alongside the existing 7.2 but maybe my memory fails me
    Anyway, php default system version:
    php -i | grep php.ini gives 7.4
     
  7. Redwarp

    Redwarp New Member

    So I ran thos two. selected 7.2 for both, installed php-mysql and retried the ispconfig3 update script and it fell over EARLIER which is odd:
    >> Update

    Operating System: Ubuntu 18.04.4 LTS (Bionic Beaver)

    This application will update ISPConfig 3 on your server.

    Shall the script create a ISPConfig backup in /var/backup/ now? (yes,no) [yes]:

    Creating backup of "/usr/local/ispconfig" directory...
    Creating backup of "/etc" directory...
    Backup failed. We stop here...
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Check that your hard disk is not full. Or choose to not backup if you run the backup step successfully with an earlier update attempt.
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    It might be that you installed just 5.4, the problem with the PHP packages form that external repo is that it tends to install newer PHP versions on its own sometimes.
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Code:
    cd /tmp
    wget https://www.ispconfig.org/downloads/ISPConfig-3.1.15p3.tar.gz
    tar xvfz ISPConfig-3.1.15p3.tar.gz
    cd ispconfig3_install/install
    php -q update.php
     
  11. Redwarp

    Redwarp New Member

    looks like rather than an entire rollback my quickest options are:
    replace the ssl certificate from the backups
    or
    the necessary direct cli command to re-do the ssl cert creation that I messed up
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Definately, no rollback. Recreate the missing cert or unpack the backup that the installer made, it's in /var/backup, and restore just the missing SSL cert and key file.
     
  13. Redwarp

    Redwarp New Member

    sorry to be a pain Im a tad in a panic her.
    So...I DONT o as your previous post suggested ?
    cd /tmp
    wget https://www.ispconfig.org/downloads/ISPConfig-3.1.15p3.tar.gz
    tar xvfz ISPConfig-3.1.15p3.tar.gz
    cd ispconfig3_install/install
    php -q update.php

    And instead I go to my backup ? But where specifically is the cert for the ispconfig installation please ?
     
  14. Redwarp

    Redwarp New Member

    OK thanks for your invaluable assistance guys.
    It was the ssl screwup, originally the ispconfig3 setup was all going great setup with letsencrypt on all the sites and on the root server itself, so the install script asked me to regenerate ssl cert and I elected yes....mistake !!! should have left it alone !, you live and learn :) So:
    From the original backup in /var/backup
    I unpacked the etc/letsencrypt directory and put it back to original also the /usr/local/ispconfig/interface/ssl directory and apache fired up fine

    Thanks again
     
    Last edited: Mar 29, 2020
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, the script defaults to no and there are good reasons why :) There are only some rare cases where one need to use yes there to replace the existing SSL setup.

    No, this would disable let's encrypt again. Leave it as it is now.
     

Share This Page