View Issue Details

IDProjectCategoryView StatusLast Update
0036525mantisbtupgradepublic2025-10-26 11:47
Reportermarc.kraemer Assigned Todregad  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionno change required 
Product Version2.27.1 
Summary0036525: upgrade from 2.26.4 failes
Description

Just upgraded mantis, like everytime.

When I hit the page https://xx/admin/install.php
I get an application error. Besides this error, everything else seems to work, but I don't know if the database needs upgrade or not.

Steps To Reproduce

We use php 8.4.12

Additional Information

Logged error message:
.... deprecated warnings before this error....

PHP message: Class "DbQuery" not found
PATH/core/user_api.php: 983: - - - - db_query()
PATH/core/authentication_api.php: 1103: - - - - user_get_id_by_cookie()
PATH/core/authentication_api.php: 342: - - - - auth_is_cookie_valid()
PATH/core/lang_api.php: 113: - - - - auth_is_user_authenticated()
PATH/core/error_api.php: 169: - - - - lang_get_default()
PATH/core.php: 436: - - - - error_handler()
PATH/core.php: 436: - - - - require_once( <string>'PATH/core/error_api.php' )
PATH/core/database_api.php: 315: - - - - autoload_mantis()
PATH/core/config_api.php: 746: - - - - db_query()
PATH/core/config_api.php: 129: - - - - config_cache_all()
PATH/admin/install.php: 307: - - - - config_get()
', referer: https://xxx/admin/

TagsNo tags attached.

Relationships

related to 0035216 assigneddregad PHP 8.4 compatibility 
related to 0036540 assigneddregad Introduce a maximum PHP version 

Activities

marc.kraemer

marc.kraemer

2025-10-23 03:33

reporter   ~0070592

not everything... for new bugs, you can't select a category, therefore you can't add new bugs.

marc.kraemer

marc.kraemer

2025-10-23 03:47

reporter   ~0070593

adding
include_once('core/classes/DbQuery.class.php');
to
core/database_api.php
solved the problem - but I guess it should be triggered by an autoloader.

atrol

atrol

2025-10-23 14:54

developer   ~0070595

We use php 8.4.12

PHP 8.4 compatibility is planned for next version 2.28.0 see 0035216 and child issues.
Using PHP 8.4 with older versions is not recommended.

To find out if the database upgrade succeeded, check "Database Schema Version" on the "Admin" page.
The right value for 2.27.1 is 213.

not everything... for new bugs, you can't select a category, therefore you can't add new bugs.

Might be caused by a failing database upgrade, the category table is changed during the upgrade

You could try a nightly build of 2.28.0-dev https://mantisbt.org/builds.php to check if the upgrade is running fine.

I will set the status to resolved unless you are telling that you encounter the same issue using PHP 8.3 or using PHP 8.4 and the nightly build.

marc.kraemer

marc.kraemer

2025-10-24 03:49

reporter   ~0070597

Usually newer php versions does not make much impact. Keep in mind php 8.5 is released in 1 month. Most linux distros stick to the latest version available.

As told above, I was able to make the database update - and I am pretty sure the same issue is also present in php 8.3

According to my understanding the errorhandler uses database connections and is set up before the database class is fully available - even this bug might be triggered by some deprecated warnings, this should be rethinked, fixed, as this can happen again on newer releases.

dregad

dregad

2025-10-24 11:36

developer   ~0070600

Using PHP 8.4 with older versions is not recommended.

Not supported, actually.

Usually newer php versions does not make much impact

Well in this case, it did with 8.4 and the changes for compatibility were not so trivial, that's why I decided not to apply it to 2.27 as a hotfix. Also some issues are caused by libraries we use, and have either not been fixed upstream, or the upgrade is very complex.

As for why 2.28.0 has not yet been released yet, well it was planned to go out in April, and to be honest I don't know where the past 6 months have been...

Please note that I maintain MantisBT in my few moments of spare time and that I am not getting paid for my efforts. Remember that this is open source software that you get for free, as-is and without warranty as per the terms of the GPL.

I'm resolving this as no change required. Please downgrade to a supported PHP version (8.3.x).

Thanks for your understanding.