Upgrade to version 2.26.0 failed

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
krahe
Posts: 9
Joined: 01 Jun 2019, 16:31

Upgrade to version 2.26.0 failed

Post by krahe »

I installed Mantis on my web site a few years ago using Softaculous and have updated it through that tool several times with no significant issues. However, today I tried to update to the current version (2.26.0) and get the error "POSSIBLE PROBLEM Bad config_inc.php?" for the "Config File Exists but Database does not" item on the Pre-Installation Check, as shown here:
MantisUpdateIssue20240314.PNG
MantisUpdateIssue20240314.PNG (40.34 KiB) Viewed 943 times
If I try to proceed with upgrading the database anyway, I get the following error:
MantisUpdateIssue20240314p2.PNG
MantisUpdateIssue20240314p2.PNG (34.03 KiB) Viewed 943 times
Despite the failure to update the database, however, Softaculous reports that I'm currently on version 2.26.0 (I can't remember which version I upgraded from, but it wasn't very old, 2.25.xx):
MantisUpdateIssue20240314p3.PNG
MantisUpdateIssue20240314p3.PNG (21.5 KiB) Viewed 943 times
However, when I try to access the application in my browser, I get an error:
APPLICATION ERROR #400

Database connection failed. Error received from database was #0: .
Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.
Previous non-fatal errors occurred. Page contents follow.

MySQL Native Driver (msqlnd) required
It looks like perhaps the application code got updated to 2.26.0, but the database did not get updated to match that version. In any case, I have no clue how to proceed from here. I did take a backup of the application using Softaculous' backup function, so I have a .tar.gz file with a lot of stuff in it, though I haven't tried to explore exactly what it contains, nor do I have any idea how I could restore the application and/or database from it. Thank you for any assistance you can offer.
Kevin Rahe
krahe
Posts: 9
Joined: 01 Jun 2019, 16:31

Re: Upgrade to version 2.26.0 failed

Post by krahe »

I was poking around in Mantis' files and found another clue in a file named error_log in the admin folder, which contained the message:
[14-Mar-2024 13:55:40 UTC] PHP Parse error: syntax error, unexpected variable "$g_db_username" in /home2/krahe/public_html/mantis/config/config_inc.php on line 40
Here is what that section of config_inc.php looks like:

Code: Select all

# --- Database Configuration ---
$g_hostname      = 'localhost';
$g_db_username   = 'krahe_mant436';
$g_db_password   = '*****';
$g_database_name = 'krahe_mant436';
$g_db_type       = 'mysqli';
I don't see anything strange about it, so I don't know what Mantis would be complaining about.

The only other thing I came across that I think is worth mentioning is the PHP version I'm using. The "system default" PHP version apparently set by my hosting service is 7.2. But according to https://mantisbt.org/blog/archives/mantisbt/743 the minimum supported PHP version for Mantis 2.26.0 is 7.2.5. Does that mean 7.2 won't work? I have used MultiPHP Manager in cPanel to set the PHP version for my domain and all my sub-domains to 8.1, which I thought had an effect, at least for actually running the application. But I'm wondering if the Mantis install/upgrade script is running with PHP 7.2 instead, and that's part of the issue. ??

Digging a little further, when I use cPanel's MultiPHP INI Editor, I find a PHP INI file for the Home Directory (which the editor shows is using PHP 7.2):
MantisUpdateIssue20240314MultiPHPINI1.PNG
MantisUpdateIssue20240314MultiPHPINI1.PNG (56.16 KiB) Viewed 938 times
but not for the sub-domain in which Mantis operates (which the editor shows is using PHP 8.1 as I intended):
MantisUpdateIssue20240314MultiPHPINI2.PNG
MantisUpdateIssue20240314MultiPHPINI2.PNG (43.76 KiB) Viewed 938 times
The interesting thing about that is that for the PHP.INI file for the Home Directory, there is a reference to a library (mysqlnd.so) that is tantalizingly close to the one that the upgrade script is looking for ("MySQL Native Driver (msqlnd) required"), but not named exactly the same, which to me raises at least a yellow flag.
Kevin Rahe
krahe
Posts: 9
Joined: 01 Jun 2019, 16:31

Re: Upgrade to version 2.26.0 failed

Post by krahe »

I found a Restore function in Softaculous that successfully restored Mantis to the previous version (which was 2.25.7). However, I had to do a couple things to fix up the installation after the restore. For one it left the admin folder named adminBK####, which I had to rename back to admin. I also had to go into config_inc.php and change the database password to the new password I had assigned today (which is understandable, since I did that after the backup was created). However, I would like any information I can get regarding the issues described above, since I will probably want to update Mantis at some point in the future, and unless something changes, I would expect to run into the same issues I ran into this time.
Kevin Rahe
atrol
Site Admin
Posts: 8378
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Upgrade to version 2.26.0 failed

Post by atrol »

You should try latest 2.26.1
E. g. there are better checks and messages for the database driver that is missed on your system, see https://mantisbt.org/bugs/view.php?id=33519
Please use Search before posting and read the Manual
krahe
Posts: 9
Joined: 01 Jun 2019, 16:31

Re: Upgrade to version 2.26.0 failed

Post by krahe »

Yes, that's the error I was getting. I don't know how long it takes before Softaculous will offer a new version of an application once it's been released. Currently it only offers to install 2.26.0. I will wait until it lets me choose 2.26.1 before I try again.
Kevin Rahe
Post Reply