PHP errors after upgrade from Ubuntu 20.04 to 22.04

Discussion in 'Installation/Configuration' started by rsteuer, Dec 27, 2023.

  1. rsteuer

    rsteuer Member

    We have a master/slave config - all were running Ubuntu 20.04. Over the past several days, all slave servers were upgraded to 22.04 following:
    1. How to Upgrade Ubuntu 20.04 to Ubuntu 22.04
    2. Update the ISPConfig Perfect Server from Ubuntu 20.04 to Ubuntu 22.04
    After installation, we updated the master following the same articles. However, after the upgrade, the jobqueue was stuck so I referred to the debugging article referenced in:
    ISPConfig 3 Job Queue gets stuck | Howtoforge - Linux Howtos and Tutorials
    As soon as I ran the server script, it threw this error:
    27.12.2023-13:31 - WARNING - There is already a lockfile set, but no process running with this pid (67694). Continuing.
    PHP Fatal error: Uncaught Error: Call to undefined function mysqli_init() in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php:83
    Stack trace:
    #0 /usr/local/ispconfig/server/lib/app.inc.php(76): db->__construct()
    #1 /usr/local/ispconfig/server/lib/app.inc.php(384): app->__construct()
    #2 /usr/local/ispconfig/server/server.php(51): require('...')
    #3 {main}
    thrown in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 83

    I tried running ispconfig_update.sh --force and had these errors:
    >> Update
    Operating System: Ubuntu 22.04.3 LTS (Jammy Jellyfish)
    PHP Curl Module is missing.
    PHP MySQLi Module is nmissing.
    PHP Multibyte Module (MB) is missing.
    Update the ISPConfig Perfect Server from Ubuntu 20.04 to Ubuntu 22.04
    Operating System: Ubuntu 22.04.3 LTS (Jammy Jellyfish)
    PHP Curl Module is missing.
    PHP MySQLi Module is nmissing.
    PHP Multibyte Module (MB) is missing.
    Update the ISPConfig Perfect Server from Ubuntu 20.04 to Ubuntu 22.04
    I tried re-running the update to 22.04 but it responds with:
    Checking for a new Ubuntu release
    There is no development version of an LTS available.
    To upgrade to the latest non-LTS development release
    set Prompt=normal in /etc/update-manager/release-upgrades.

    I am now way out of my league, as I am a Sys Admin with very little programming experience.
    As additional info, the CP is running and phpMyAdmin is working. I did notice that although the upgrade article refers to setting php8.1 as defaults on the slaves, I have no idea what to do on the master. PHP 8.2 and 8.3 also got installed during the 22.04 upgrade. could it be a conflict?

    I am not seeing any errors on the slave machines if trying to run server.sh script.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The updater mentioned the reason for the error:

    So you must install the php8.1-mysqli, php8.1-curl and php 8.1-mbstring modules:

    apt install php8.1-mysqli php8.1-curl php8.1-mbstring

    and ou must take care that you use the right default PHP version, which is php 8.1 on Ubuntu 22.04, see read before posting thread, chapter about panel not showing up: https://forum.howtoforge.com/threads/please-read-before-posting.58408/
     
    Last edited: Dec 27, 2023
  3. rsteuer

    rsteuer Member

    Thank you, Till,
    As mentioned, I set php8.1 as default on all the slaves, but don't know how to specify it for the master. I'm not sure which version is set as default and the error doesn't mention which versions of the missing modules were needed. I assumed all the required modules were installed after running #3 in the update article (it includes the modules listed.

    Trying to re-run the install you provided, results in:
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    Note, selecting 'php8.1-mysql' instead of 'php8.1-mysqli'
    E: Unable to locate package 8.1-mbstring
    E: Couldn't find any package by glob '8.1-mbstring'
    Also, the panel loads and prompts for credentials- it just would not clear the queue, which is what started the troubleshooting.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    There is no difference in setting a default PHP version for master and slave. Please see the link in my post, and follow the instructions of the chapter I've mentioned. When the installer tells you that these modules are missing, then these are not installed or loaded in the PHP version that is set as default, so either the modules are not installed for the default PHP version or you have set a wrong PHP version as default.
     
  5. rsteuer

    rsteuer Member

    The defaults for 8.1 were set in the panel. but wondering if they are stuck in the queue? I ran the update alternatives and the config.php was set to 8.3, so I changed it. What I did notice is that the update-alternatives --config php returned 8.3 as auto mode while 8.1 was manual mode. The same for update-alternatives --config php-cgi. Could that be contributing?

    I still cannot install the modules mentioned.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Good, so this is fixed now.

    There was a whitespace between php and 8.1, try:

    apt install php8.1-mysqli php8.1-curl php8.1-mbstring
     
  7. rsteuer

    rsteuer Member

    I ran the new command:
    Note, selecting 'php8.1-mysql' instead of 'php8.1-mysqli'
    php8.1-curl is already the newest version (8.1.27-1+ubuntu20.04.1+deb.sury.org+1).
    php8.1-mbstring is already the newest version (8.1.27-1+ubuntu20.04.1+deb.sury.org+1).
    php8.1-mysql is already the newest version (8.1.27-1+ubuntu20.04.1+deb.sury.org+1).
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.​
     
  8. rsteuer

    rsteuer Member

    Till, I looked at the error shown when accessing the server listed under System State and this is what's listed:

    Replication of datalog_id: 78586 failed. Error: (spamfilter_policy) in MySQL server: (localhost) Data truncated for column 'warnvirusrecip' at row 1 # SQL: REPLACE INTO ?? (??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?​

    I don't see anything that references spamfilter in the MySQL log
     
  9. rsteuer

    rsteuer Member

    Code:
    #### SERVER #####
    IP-address (as per hostname): ***.***.***.***
    [WARN] could not determine server's ip address by ifconfig
    [INFO] OS version is Ubuntu 22.04.3 LTS
    
    [INFO] uptime:  13:57:45 up 1 day,  4:28,  2 users,  load average: 0.00, 0.00, 0.00
    
    [INFO] memory:
                   total        used        free      shared  buff/cache   available
    Mem:           7.7Gi       1.9Gi       1.2Gi        34Mi       4.5Gi       5.4Gi
    Swap:          4.0Gi       0.0Ki       4.0Gi
    
    [INFO] systemd failed services status:
      UNIT                      LOAD   ACTIVE SUB    DESCRIPTION
    ● snap.lxd.activate.service loaded failed failed Service for snap application lxd.activate
    
    LOAD   = Reflects whether the unit definition was properly loaded.
    ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
    SUB    = The low-level unit activation state, values depend on unit type.
    1 loaded units listed.
    
    [INFO] ISPConfig is installed.
    
    ##### ISPCONFIG #####
    ISPConfig version is 3.2.11p1
    
    
    ##### VERSION CHECK #####
    
    [INFO] php (cli) version is 8.1.27
    [INFO] php-cgi (used for cgi php in default vhost!) is version 8.1.27
    
    ##### PORT CHECK #####
    
    [WARN] Port 143 (IMAP server) seems NOT to be listening
    [WARN] Port 993 (IMAP server SSL) seems NOT to be listening
    [WARN] Port 110 (POP3 server) seems NOT to be listening
    [WARN] Port 995 (POP3 server SSL) seems NOT to be listening
    [WARN] Port 465 (SMTP server SSL) seems NOT to be listening
    
    ##### MAIL SERVER CHECK #####
    
    [WARN] I found no "submission" entry in your postfix master.cf
    [INFO] this is not critical, but if you want to offer port 587 for smtp connections you have to enable this.
    [WARN] I found no "smtps" entry in your postfix master.cf
    [INFO] this is not critical, but if you want to offer SSL for smtp (not TLS) connections you have to enable this
    .
    
    ##### RUNNING SERVER PROCESSES #####
    
    [INFO] I found the following web server(s):
            Apache 2 (PID 211663)
    [INFO] I found the following mail server(s):
            Postfix (PID 1205)
    [WARN] I could not determine which pop3 server is running.
    [WARN] I could not determine which imap server is running.
    [INFO] I found the following ftp server(s):
            PureFTP (PID 1067)
    
    ##### LISTENING PORTS #####
    (only           ()
    Local           (Address)
    [localhost]:25          (1205/master)
    [anywhere]:10000                (583/beremote)
    [anywhere]:22           (1043/sshd:)
    [anywhere]:21           (1067/pure-ftpd)
    [localhost]:10023               (1112/postgrey)
    [localhost]:10024               (659/amavisd-new)
    [anywhere]:3306         (761/mariadbd)
    [localhost]:11211               (631/memcached)
    ***.***.***.***:53              (581/systemd-resolve)
    [localhost]0000         (583/beremote)
    *:*:*:*::*:80           (211663/apache2)
    *:*:*:*::*:22           (1043/sshd:)
    *:*:*:*::*:21           (1067/pure-ftpd)
    *:*:*:*::*:443          (211663/apache2)
    *:*:*:*::*:10024                (659/amavisd-new)
    *:*:*:*::*:8080         (211663/apache2)
    *:*:*:*::*:8081         (211663/apache2)
    *:*:*:*::*:25           (1205/master)
    
    
    
    
    ##### IPTABLES #####
    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination
    
    Chain FORWARD (policy ACCEPT)
    target     prot opt source               destination
    
    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination
    
    
    
    
    ##### LET'S ENCRYPT #####
    Certbot is installed in /usr/bin/letsencrypt
    
     
  10. rsteuer

    rsteuer Member

    I've narrowed down the slave server throwing the error. running the server.sh script:

    /usr/local/ispconfig/server# sh server.sh
    PHP Warning: Undefined variable $state_out in /usr/local/ispconfig/server/lib/classes/plugins.inc.php on line 173
    27.12.2023-22:32 - ERROR - Replication of datalog_id: 78586 failed. Error: (spamfilter_policy) in MySQL server: (localhost) Data truncated for column 'warnvirusrecip' at row 1 # SQL: REPLACE INTO ?? (??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??,??) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
    27.12.2023-22:32 - ERROR - Error in Replication, changes were not processed.
    finished server.php.​
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

  12. rsteuer

    rsteuer Member

    Thank you, Till. I started going through the article and was opening phpmyadmin on the offending slave server to increment the updated field, but phpmayadmin failed and returned the error "ERR_NAME_NOT_RESOVED", which should not be because I'm accessing internally using the IP, not DNS name. I started digging through log files and didn't find anything helpful, so I went back to the php settings in the control panel and compared against the folders on the server. Although the settings in the control panel are correct, there's isn't a folder for /etc/php/8.1/apache2.

    I tried rerunning the update to phpmayadmin but it indicates it's all up-to-date. Systemctl indicates apache2 and phpmyadmin are both running. php-v returns PHP 8.1.27...

    I also checked the other 6 slave machines, and all are identical.
     
  13. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Which name is it trying to resolve?
    If application gives that error message, I would postulate is is trying to resolve a name, even if it should not.
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    That's fine, recent installations do not use apache mmod_php anymore. Very likely, you currently do not have PHP issues anymore. So now we have to find out why your phpmyadmin fails.

    Please post a screenshot of the complete browser window that you get when accessing phpmyadmin.
     
  15. rsteuer

    rsteuer Member

    Thanks Taleman. And again, apologies for posting in wrong forum. Until you mentioned it yesterday, I wasn't aware you could delete a post after it was posted. Other forums don't allow you to do so. My error.

    Until the upgrade, because we do not publish phpmyadmin to the internet, we always accessed phpMyAdmin via private_ip/phpmyadmin. we could also access via hostname/phpmyadmin. Never failed on any of the 6 slaves or master. After the upgrade, nothing is working. In checking the Apache php.ini path in the control panel (should be /etc/php/8.1/apache2/php.ini) versus the actual path, there isn't an "apache2" listed. I've checked that all the other slaves and master and it's consistently missing. It looks like it was never created. So, my guess is the request from the browser fails because the path isn't there.

    I can easily enough create the folder but no idea how the php.ini file is configured.
     
  16. till

    till Super Moderator Staff Member ISPConfig Developer

  17. rsteuer

    rsteuer Member

    I just submitted a case.

    I still have 1 slave server that has not been upgraded to 22.04 and I checked to see if apache2 was included in its path, and there is. But it's for php7.4. Is the php.ini different for 8.1 or do you think it might work if I added apache2 to the path and copied the php.ini over, then changed prmissions?
     
  18. till

    till Super Moderator Staff Member ISPConfig Developer

    As mentioned in my last post, please post a screenshot of the browser window that shows this error. Also, check the Apache error.log file and post the error that you get there when accessing phpmyadmin.
     
  19. rsteuer

    rsteuer Member

    Sorry, Till. I didn't see your post come in while I was responding to Taleman.
    This is the complete error log:
    Code:
    Thu Dec 28 00:00:01.211412 2023] [:error] [pid 1193] python_init: Python version mismatch, expected '3.10.2', found '3.10.12'.
    [Thu Dec 28 00:00:01.211430 2023] [:error] [pid 1193] python_init: Python executable found '(null)'.
    [Thu Dec 28 00:00:01.211432 2023] [:error] [pid 1193] python_init: Python path being used '(null)'.
    [Thu Dec 28 00:00:01.211435 2023] [:notice] [pid 1193] mod_python: Creating 8 session mutexes based on 150 max processes and 0 max threads.
    [Thu Dec 28 00:00:01.211437 2023] [:notice] [pid 1193] mod_python: using mutex_directory /tmp
    [Thu Dec 28 00:00:01.237265 2023] [mpm_prefork:notice] [pid 1193] AH00163: Apache/2.4.52 (Ubuntu) mod_python/3.5.0+git20211031 Python/3.10.12 configured -- resuming normal operations
    [Thu Dec 28 00:00:01.237275 2023] [core:notice] [pid 1193] AH00094: Command line: '/usr/sbin/apache2'
    
    If I use Opera, I receive the error in the screenshot. I just tried Edge and the result was quite different:
    upload_2023-12-28_11-56-50.png
     

    Attached Files:

Share This Page