Problem with upgrade

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
sse450
Posts: 5
Joined: 14 Oct 2016, 07:45

Problem with upgrade

Post by sse450 »

Hello,

I used MantisBT without any problem in the past. After some idle time (~1 year) wanted to check and saw that home page is not coming up. No matter what I do, It is completely blank.

To solve the problem, tried to upgrade as per the instructions on the Admin Guide. Copied the old installation to somewhere else. Unzipped the new version. Copied old config files to the new. Run admin/install.php script. All checks but one is OK.
Checking URL to installation BAD
Can't retrieve web page at 'https://mantis.xxx.com/'.
When I call the URL directly (without admin/install.php), the page comes up with some warmings:
Warning: "admin" directory should be removed, or access to it restricted.
Warning: "path" was not defined in config_inc.php. Leaving it empty is a security risk, as the path will be set based on headers from the HTTP request, exposing your system to Host Header Injection attacks.
Warning: The database structure may be out of date. Please upgrade here before logging in.
What is wrong with my setup? Appreciate any help.
Thank you.

Info on my setup:
AlmaLinux release 8.9
PHP 8.2.15
Apache 2.4.37
MariaDB 10.3.39
Mantis: 2.26.1
PHP: 8.2.16
SQL: Distrib 10.3.39-MariaDB
OS: AlmaLinux 8.9
atrol
Site Admin
Posts: 8378
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Problem with upgrade

Post by atrol »

It seems you did not run admin/install.php to upgrade the database, or this step failed.
Please use Search before posting and read the Manual
sse450
Posts: 5
Joined: 14 Oct 2016, 07:45

Re: Problem with upgrade

Post by sse450 »

I can't run admin/install.php. Because, I get
Checking URL to installation BAD
Can't retrieve web page at 'https://mantis.xxx.com/'.
Mantis: 2.26.1
PHP: 8.2.16
SQL: Distrib 10.3.39-MariaDB
OS: AlmaLinux 8.9
atrol
Site Admin
Posts: 8378
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Problem with upgrade

Post by atrol »

Looks like a bug.
What's your PHP setting of allow-url-fopen? Is it changed from default 1 to another value?
https://www.php.net/manual/en/filesyste ... -url-fopen

As a temporary workaround you could also change line 504 in install.php to

Code: Select all

			$t_hard_fail = false;
Please use Search before posting and read the Manual
sse450
Posts: 5
Joined: 14 Oct 2016, 07:45

Re: Problem with upgrade

Post by sse450 »

Dear atrol,

Checked php settings. It is "On".

Code: Select all

allow_url_fopen = On
Then, updated t_hard_fail in install.php as you advised.

This time It still presented a warning something like "Cannot open https://mantis.xxx.com". However, install.php finished all and I can now access https://mantis.xxx.com without any problem.

By the way, which path is MantisBT referring to in Warning:"path" was not defined in config_inc.php?

Thank you for your help.
Mantis: 2.26.1
PHP: 8.2.16
SQL: Distrib 10.3.39-MariaDB
OS: AlmaLinux 8.9
atrol
Site Admin
Posts: 8378
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Problem with upgrade

Post by atrol »

Concerning "path" see https://www.mantisbt.org/docs/master/en ... onfig.path
$g_path is set automatically since many years, but to fix an old security related bug, it's now recommened to set the option in config_inc.php.
The warning for this (and the changed installer) was introduced in version 2.26.1.
For more details see https://www.mantisbt.org/bugs/view.php?id=19381
Please use Search before posting and read the Manual
sse450
Posts: 5
Joined: 14 Oct 2016, 07:45

Re: Problem with upgrade

Post by sse450 »

Thank you very much.
Mantis: 2.26.1
PHP: 8.2.16
SQL: Distrib 10.3.39-MariaDB
OS: AlmaLinux 8.9
Post Reply