Advertisement:

Author Topic: Database Error! and blank settings.php  (Read 1014 times)

Offline brabont

  • Newbie
  • *
  • Posts: 6
Database Error! and blank settings.php
« on: March 18, 2019, 07:02:37 AM »
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?

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,500
  • Gender: Male
    • Kindred-999 on GitHub
Re: Database Error! and blank settings.php
« Reply #1 on: March 18, 2019, 07:08:59 AM »

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
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,614
    • StoryBB/StoryBB on GitHub
Re: Database Error! and blank settings.php
« Reply #2 on: March 18, 2019, 08:33:14 AM »
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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,500
  • Gender: Male
    • Kindred-999 on GitHub
Re: Database Error! and blank settings.php
« Reply #3 on: March 18, 2019, 09:48:52 AM »
oops... my mistake. I thought both had been addressed at one point in the 2.0 branch
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.