Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Woke up this morning, Vanilla asking me to install

edited July 2007 in Vanilla 1.0 Help
I've just reinstalled vanilla on a new host (yesterday). Woke up this morning and my settings.php was blank/corrupted, and the forum was showing the install page. Can anyone suggest what could cause it? I want to try make sure it doesn't happen again.
«13

Comments

  • There are a ton of threads on here like this with various different thoughts in. Your host could have had issues and had to revert to a backup, your server could have been hacked and messed with, or (most likely) someone took advantage of the 777 permissions on your conf directory and wiped the files out. I suggest you complete the install then swap the conf directory permissions down to 755 or such (it should probably install with those permissions anyway) and also remove or rename the setup directory.
  • ...remove or rename the setup directory... AFTERWARDS of course :)
  • hm, my conf directory is already 755. i've renamed the setup folder though, so nobody can do any damage if it happens again. thanks.
  • edited May 2007
    a-ha! just happened again. site slowed to a crawl... i got on brefly and got an error which mentioned the word framework (i think)... then settings.php was wiped.
    this never happened on my old host. twice in one day on a new host is alarming.
  • Have you spoken to your host about any possible causes?
  • Did you happen to notice if it was an error opening or an error writing?

    This smells like a fopen() race condition... and appears to be possible:
       function SaveSettingsToFile($File) {
    // Open for writing only.
    // Place the file pointer at the beginning of the file and truncate the file to zero length.
    // If the file does not exist, attempt to create it.
    $FileContents = $this->UpdateConfigurationFileContents($File);
    if ($this->Context->WarningCollector->Iif()) {
    $FileHandle = @fopen($File, "wb");
    if (!$FileHandle) {
    $this->Context->WarningCollector->Add(str_replace("//1", $File, $this->Context->GetDefinition("ErrOpenFile")));
    } else {
    if (!@fwrite($FileHandle, $FileContents)) $this->Context->WarningCollector->Add($this->Context->GetDefinition("ErrWriteFile"));
    }
    @fclose($FileHandle);
    }
    return $this->Context->WarningCollector->Iif();
    }
  • edited May 2007
    If the race condition is the cause, a workaround would be to save settings to a temporary file first, then copy the temp file over the existing settings file: function SaveSettingsToFile($File) { // Open for writing only. // Place the file pointer at the beginning of the file and truncate the file to zero length. // If the file does not exist, attempt to create it. $FileContents = $this->UpdateConfigurationFileContents($File); if ($this->Context->WarningCollector->Iif()) { // write the contents to a temporary file $rand = DefineVerificationKey(); $temp = @fopen($rand . '.tmp', 'wb') if (!$temp) { $this->Context->WarningCollector->Add(str_replace("//1", $File, $this->Context->GetDefinition("ErrOpenFile"))); } else { if (!@fwrite($temp, $FileContents)) $this->Context->WarningCollector->Add($this->Context->GetDefinition("ErrWriteFile")); } fclose($temp); // If no errors, overwrite the existing settings file if ($this->Context->WarningCollector->Iif()) @rename($rand . '.tmp', $File); } return $this->Context->WarningCollector->Iif(); }
  • it happened a third time just now, i think. seems this is going to be a big problem.
    i'm sorry, i can't remember what the error said. i think it was an error opening.
    i've emailed dreamhost to see what they say. the load on my site is never heavy (maximum 10 users or so, according to 'Who's Online'), but the overall load on dreamhost could be causing the slow speed.
  • I would suggest disabling extensions, particularly any that change the configuration file or use the configuration manager.

    Don't go replacing code just yet... I have no way to test what I posted and just fixed 3-4 bugs after re-reading it.
  • ok. well, i have to go out now but i'll keep an eye on it tonight. i'm not sure which extensions use the configuration manager, i'll probably have to go through that in more detail later. hopefully when i get home i'll have an answer from dreamhost as well.
  • edited May 2007
    another bit of info that may help; while the wordpress section of the site loads reasonably quickly at sluggish times (~5 sec), the vanilla section can take around 20 seconds to load, when opened at the exact same time. i feel this might be something to do with it, since the site runs very slowly before the settings.php file vanishes.

    the error i got definitely related to a file in /library/Framework/ although i can't remember which one. i'm sure it referenced a specific line in whichever file it was.
  • just happened again. didn't see the error, but pages on my site were taking more than 30 seconds to load when it happened.
  • was it working fine before?
    Did you enable an extension recently?
  • edited May 2007
    it was fine before - i moved hosts (to dreamhost) and that's when the problem started. happened again this afternoon - i'm gonna have to create an error page i think.
  • Interesting - I've had this problem (once) with my test forum on DreamHost. Perhaps it's a DH problem? But, considering that it has happened to others NOT on DH previously, perhaps there needs to be a change in the Vanilla code in order to minimise this happening with problematic hosts?
  • edited May 2007
    this is dreamhosts' response:

    "This
    seems to be a problem with the script that is causing it to remove that
    file as I did not notice anything in our logs that indicated otherwise."

    interestingly, the rest of my site (wordpress based) is now slow/down with a 500 error. (edit: fixed... wp-cache plugin at fault, it seems)
  • the wp-cache plugin was eating the settings file all along? Interesting.
  • no, the wp-cache file caused the rest of the site to fall over when it ate all the memory allowance. the settings.php problem is unresolved.
  • Have you implemented wallphones code?
  • no, as he said not to try it.

    down again at about 9am UK time this morning, when nobody was likely to have been online at all - it's a bank holiday! i'm seriously thinking of just moving to another host.
This discussion has been closed.