Trouble with $g_crypto_master_salt

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
rowan_bradley
Posts: 3
Joined: 19 May 2017, 11:52

Trouble with $g_crypto_master_salt

Post by rowan_bradley »

Yesterday I tried to update my installation of Mantis BT using the Softaculous installer. It said that it had upgraded successfully, but now when I go to my URL I get:

# --- Security --- $g_crypto_master_salt = 'OXMxbGh3dmczbHlqNmFuaTV3Y2c0d2kwcXdzeG9iaWM='; Possible Whitespace/Error in Configuration File - Aborting. Output so far follows:
string(92) " # --- Security --- $g_crypto_master_salt = 'OXMxbGh3dmczbHlqNmFuaTV3Y2c0d2kwcXdzeG9iaWM='; "

I see several bug reports about this type of issue, but nothing that tells me how to recover, so that my installation works. What do I have to do now? Can I manually add a line to the config file (which currently doesn't seem to refer to $g_crypto_master_salt at all)? If so, how do I create a value for $g_crypto_master_salt?

Thanks - Rowan
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Trouble with $g_crypto_master_salt

Post by atrol »

I can't tell anything about Softaculous installer.

It seems this installer added some lines after the PHP closing tag ?>.
Removing the tag might fix the issue.
Please use Search before posting and read the Manual
rowan_bradley
Posts: 3
Joined: 19 May 2017, 11:52

Re: Trouble with $g_crypto_master_salt

Post by rowan_bradley »

Which is th aactive config file, that it is complaining about?

I have a file config_inc.php. Is that the one?

That did contain:

====beginning of file=====
<?php
$g_hostname = 'localhost';
$g_db_type = 'mysql';
$g_database_name = 'sylvest_mantisbt';
$g_db_username = 'sylvest_mantadm';
$g_db_password = '8r2fa@8WRTfP';
?>

# --- Security ---
$g_crypto_master_salt = 'OXMxbGh3dmczbHlqNmFuaTV3Y2c0d2kwcXdzeG9iaWM=';
=====end of file=====

I changed it to:

====beginning of file=====
<?php
$g_hostname = 'localhost';
$g_db_type = 'mysql';
$g_database_name = 'sylvest_mantisbt';
$g_db_username = 'sylvest_mantadm';
$g_db_password = '8r2fa@8WRTfP';
# --- Security ---
$g_crypto_master_salt = 'OXMxbGh3dmczbHlqNmFuaTV3Y2c0d2kwcXdzeG9iaWM=';
?>
=====end of file=====

It still gives the error:

# --- Security --- $g_crypto_master_salt = 'OXMxbGh3dmczbHlqNmFuaTV3Y2c0d2kwcXdzeG9iaWM='; Possible Whitespace/Error in Configuration File - Aborting. Output so far follows:
string(92) " # --- Security --- $g_crypto_master_salt = 'OXMxbGh3dmczbHlqNmFuaTV3Y2c0d2kwcXdzeG9iaWM='; "

Which whitespace is it complaining about?

Do I need this $g_crypto_master_salt value?

Thanks - Rowan
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Trouble with $g_crypto_master_salt

Post by atrol »

rowan_bradley wrote: I have a file config_inc.php. Is that the one?
It's the right one if it's stored in folder config. Maybe there is one more config_inc.php from older versions in root folder of your installation.
rowan_bradley wrote: Do I need this $g_crypto_master_salt value?
You need it.

BTW, $g_crypto_master_salt and $g_db_password should be kept secret.
Please use Search before posting and read the Manual
Louisvdw
Posts: 2
Joined: 06 Jun 2013, 07:14

Re: Trouble with $g_crypto_master_salt

Post by Louisvdw »

The problem you have is that the salt was added to the config after the closing of the PHP code.
Move
?>
to the edit of the file after the
$g_crypto_master_salt
line to solve the problem.
rowan_bradley
Posts: 3
Joined: 19 May 2017, 11:52

Re: Trouble with $g_crypto_master_salt

Post by rowan_bradley »

I mentioned previously in the thread, I have already done this.

My public_html/mantisbt/config/config_inc.php file now looks like this:

Code: Select all

?php
$g_hostname               = 'localhost';
$g_db_type                = 'mysqli';
$g_database_name          = 'sylvest_mantisbt';
$g_db_username            = 'sylvest_mantisbt';
$g_db_password            = 'secret_password';
$g_default_timezone       = 'Europe/London';
$g_crypto_master_salt     = 'secret_value';
?>
Mantis now seems to be working correctly, at least as far as the actions I have done recently.

Thanks for your help with this issue.

Rowan
Post Reply