Trouble with $g_crypto_master_salt

Get help from other users here.

Moderators: Contributor, Developer

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

Trouble with $g_crypto_master_salt

Post by rowan_bradley » May 19, 2017 7:04 am

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: 7218
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: Trouble with $g_crypto_master_salt

Post by atrol » May 19, 2017 1:52 pm

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: May 19, 2017 6:52 am

Re: Trouble with $g_crypto_master_salt

Post by rowan_bradley » May 23, 2017 8:18 am

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: 7218
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: Trouble with $g_crypto_master_salt

Post by atrol » May 23, 2017 9:15 am

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: Jun 06, 2013 2:14 am

Re: Trouble with $g_crypto_master_salt

Post by Louisvdw » May 17, 2018 5:57 am

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: May 19, 2017 6:52 am

Re: Trouble with $g_crypto_master_salt

Post by rowan_bradley » May 17, 2018 8:49 am

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