View Issue Details

IDProjectCategoryView StatusLast Update
0032042mantisbtupgradepublic2023-04-02 09:39
ReporterTomR Assigned Todregad  
Status closedResolutionno change required 
Product Version2.25.5 
Summary0032042: I am unable to run admin functions 'Upgrade your installation' and 'Check Installation'

Errors is httpd logging:

AH01071: Got error 'Primary script unknown', referer: https://xxx.yyy.zz/admin/index.php
AH01071: Got error 'PHP message: Call to a member function Param() on bool\n/home/qqq/domains/xxx.yyy.zz

TagsNo tags attached.




2023-02-21 08:45

reporter   ~0067409


Linux server CentOS7
Linux [hostname] 3.10.0-1160.76.1.el7.x86_64 0000001 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

MantisBT Version 2.25.5
Schema Version 210
PHP Version 7.4.33
Database Driver mysqli
Database Version, Description 10.4.27, 10.4.27-MariaDB



2023-02-28 05:24

developer   ~0067425

Without a full stack trace I can't really say for sure, but considering that the only Param() method we have in the code base is from the DbQuery class, the error probably means there is a problem with your database.

Can you please check that the DB is up and running ?

I do not get the exact same error as you, but nevertheless I was able to (kind of) replicate the problem, navigating to http://mantis.test/admin/index.php:

  • with PHP 7.4, I get APPLICATION ERROR 400 Database connection failed. Error received from database was 2002: Connection refused (This is with MySQL TCP connection, i.e. $g_hostname = ''; with a socket connection $g_hostname = 'localhost' the error is No such file or directory)
  • with PHP 8.1 the MantisBT error is different: INTERNAL APPLICATION ERROR Connection refused / No such file or directory.

This is because the MySQLi report mode changed in PHP 8.1 [1]: the default setting is MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT. Previously, it was MYSQLI_REPORT_OFF. This causes the error suppression @ operator on mysqli_real_connect() call in ADOdb to behave differently because an exception is thrown.

This error handling issue has been fixed upstream in ADOdb 5.21.3 [2], so should be OK in MantisBT 2.26.0



2023-03-13 12:41

developer   ~0067479


You did not provide any feedback; I am therefore resolving this issue as "no change required".

Feel free to reopen the issue at a later time and provide the requested information.



2023-03-15 05:31

reporter   ~0067494

I still get the error sometimes ( strange not always ).
This because Wwe are in the phase og upgrading from 2.23.0 -> 2.25.6 (earlier 2.25.5).
Meaning copying the database over and over again from productie -> new setup in a script followed by
curl https://[domain]/admin/upgrade_unattended.php

This always fails with output :
<!DOCTYPE html>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>CTS 2.25.6 - CursAd Tracking Systeem</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<link rel="stylesheet" type="text/css" href="https://[domain]/css/default.css&quot; />

When navigating to login_page it shows me that database should be upgraded with link to admin/install.php
Sometimes it shows me the correct page and sometimes a blank page??

Perhaps after copying should i restart MySQL?



2023-03-15 05:38

reporter   ~0067495

Last edited: 2023-03-15 08:22

I tried restarting MySQL before the curl statment.
No success same HTML output ad before.
And admin/install.php still giving me a blank page.

In error.log

[Wed Mar 15 10:35:22.210339 2023] [proxy_fcgi:error] [pid 4270:tid 140343047563008] [remote] AH01071: Got error 'PHP message: Call to a member function Param() on bool
/home/[user]/domains/[domain]/public_html/core/database_api.php: 327: MantisDbParam - -> - assign()
/home/[user]/domains/[domain]/public_html/core/user_api.php: 826: - - - - db_param()
/home/[user]/domains/[domain]/public_html/core/authentication_api.php: 1128: - - - - user_get_id_by_cookie()
/home/[user]/domains/[domain]/public_html/core/helper_api.php: 329: - - - - auth_get_current_user_id()
/home/[user]/domains/[domain]/public_html/config/custom_strings_inc.php: 92: - - - - helper_get_current_project()
/home/[user]/domains/[domain]/public_html/core/lang_api.php: 83: - - - - include( &lt;string>'/home/[user]/domains/[domain]/public_html/config/custom_strings_inc.php' )
/home/[user]/domains/[domain]/public_html/core/lang_api.php: 183: - - - - lang_load()
/home/[user]/domains/[domain]/public_html/core/lang_api.php: 237: - - - - lang_ensure_loaded()
/home/[user]/domains/ctsnew...PHP message: PHP Fatal error: Uncaught Error: Call to a member function Param() on bool in /home/[user]/domains/[domain]/public_html/core/database_api.php:90
Stack trace:
#0 /home/[user]/domains/[domain]/public_html/core/database_api.php(327): MantisDbParam->assign()
0000001 /home/[user]/domains/[domain]/public_html/core/user_api.php(826): db_param()
0000002 /home/[user]/domains/[domain]/public_html/core/authentication_api.php(1128): user_get_id_by_cookie()
0000003 /home/[user]/domains/[domain]/public_html/core/helper_api.php(329): auth_get_current_user_id()
0000004 /home/[user]/domains/[domain]/public_html/config/custom_strings_inc.php(92): helper_get_current_project()
0000005 /home/[user]/domains/[domain]/public_html/core/lang_api.php(83): include('...')
#6 /home/[user]/domains/[domain]/public_html/core/lang_api.php(183): lang_load()
0000007 /home/[user]/domains/[domain]/public_html/core/lang_api.php(291): lang_ensure_loaded()
#8 /home/[user]/domains/ct...', referer: https://[domain]/login_page.php

EDIT (dregad): formatted error log for a readable stack trace



2023-03-15 09:53

developer   ~0067498

Last edited: 2023-03-15 09:53

Hi Tom,

I can see from the provided trace that you have a custom_strings_inc.php file, which is calling helper_get_current_project().

/home/[user]/domains/[domain]/public_html/config/custom_strings_inc.php: 92: - - - - helper_get_current_project()
/home/[user]/domains/[domain]/public_html/core/lang_api.php: 83: - - - - include( <string>'/home/[user]/domains/[domain]/public_html/config/custom_strings_inc.php' )

I have no idea why you are doing this, but it is guaranteed to cause issues in a context where the database is not connected, which in fact is the case of an install/upgrade scenario, as well as running the admin checks.

In fact, I can reproduce the Call to a member function Param() on bool error by simply creating a custom_strings_inc.php file like so:

  • admin/unattended_upgrade.php crashes with an uncaught exception
  • admin/install.php and admin/check/index.php crash with fatal error

It is not recommended to call MantisBT core functions in custom_strings_inc.php. This file should only contain variable assignments and basic PHP control structures. If you must use API calls, then anything that expects an active DB connection needs to be protected, e.g.

if (db_is_connected()) {

This is not clearly stated in the Admin Guide, I'll update that to add a warning.

Please disable or modify your custom_strings_inc.php file.



2023-03-15 10:42

reporter   ~0067501

Thanks dregad, that seems to solve the problem.

Let me explain why I use the function helper_get_curretn_project() in custom_strings_inc.php

I want to have some translations different enum_status for a few projects.
I am able in Configuration Report tio set that up, however I can onlys choees users or projects there, no language.
How else can I translate the different enum_status strings in custom_strings_inc.php?
Clearly it seems this can be achived differetn from my solution. I will look into that.



2023-03-15 11:43

developer   ~0067502

For details on customizing and translating enums, please read

I believe everything is properly explained there with some examples. Basically you need to

  • define the enum in your config_inc.php, including all possible values from all projects
  • define your custom translations for all the enum values as appropriate for your target languages in custom_strings_inc.php
  • customize which enum values are available for each project in config report

The only case where that may not work, is if you have the same enum value needing a different translation in different projects.

I never actually tested this, but you may be able to use the $g_cache_current_project global variable within custom_strings_inc.php. However, you need to be careful to have a proper fallback, as its value could be null.



2023-03-15 12:09

developer   ~0067504

This is not clearly stated in the Admin Guide, I'll update that to add a warning.

I have just committed an update to the Admin Guide, the revised manual should be available at tomorrow.

Related Changesets

MantisBT: master 334b5178

2023-03-15 12:03


Details Diff
Improve documentation for custom_strings_inc.php

- New section for file format (admin.customize.strings.format)
- Add warning not to use core functions (see issue 0032042)
- General review of admin.customize.strings section: minor text and
formatting changes
Affected Issues
mod - docbook/Admin_Guide/en-US/Customizing.xml Diff File