News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Database Error! and blank settings.php

Started by brabont, March 18, 2019, 07:02:37 AM

Previous topic - Next topic

brabont

Hi!

I kept getting notification from my up-to-date SMF server that connection to database was lost for a few days, but I couldn't find any issue except of that error. Forum worked perfectly, but the error popped up again a few times. Then suddenly error + settings.php and the backup-file were blank. I've tried to use repair_settings.phd without success. Is that error and blankness somehow related?

Kindred


it's a bug in the system - sometimes a RACE condition can try to write to the Settings.php file at the exact same time that another write is occurring, resulting in a blank file save.

this was fixed, but apparently, the fix got undone in one of the further updates.
This is officially fixed in 2.1.


if you have a backup of your site files, you can restore the settings.php and settings_bak.php from there....
if not, then take a settings.php from the install archive, put it into your forum directory and use repair_settings.php to set the correct values after that....    repair_settings.php depends on the file being present and having contents... it won't work to repair a blank file
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

This was never fixed in 2.0 (the bug that was fixed in 2.0 and later undone is the settings on installation problem)

Once fixed, I'd make your Settings.php file read only.

Kindred

oops... my mistake. I thought both had been addressed at one point in the 2.0 branch
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: