Blank screen when installing 2.1 RC1 on Linux (Step 2)

Started by Randem, March 06, 2019, 04:49:26 PM

Previous topic - Next topic

Randem

On install.php?step=2 after putting in the database information I get a blank screen. No error message at all.
Has anyone seen this? I have gotten it to work locally but cannot install online.
Scams - How to Protect Yourself
Why Professionals Should Not Use Free Email Accounts

Always ignore those who attempt to tell you what to think and believe those who will allow you think for yourself

Illori


Randem

Nothing in the error logs or the access logs. I will try a different server.
Also in the function updateDbLastError() in the install.php file the last_db_error file entry seems to output 0 all the time... So I am unsure of what that function is for.
Scams - How to Protect Yourself
Why Professionals Should Not Use Free Email Accounts

Always ignore those who attempt to tell you what to think and believe those who will allow you think for yourself

Arantor

Means that the last time you had an actual database error logged by SMF was... never. It's used when a regular DB error occurs so that you can get notified but not notified too often about things.

Randem

No, what I actually mean is that the code will always output 0 as the last db error...


function updateDbLastError()
{
global $cachedir;

// Write out the db_last_error file with the error timestamp
if (!empty($cachedir) && is_writable($cachedir))
file_put_contents($cachedir . '/db_last_error.php', '<' . '?' . "php\n" . '$db_last_error = 0;' . "\n" . '?' . '>');
else
file_put_contents(dirname(__FILE__) . '/cache/db_last_error.php', '<' . '?' . "php\n" . '$db_last_error = 0;' . "\n" . '?' . '>');

return true;
}
Scams - How to Protect Yourself
Why Professionals Should Not Use Free Email Accounts

Always ignore those who attempt to tell you what to think and believe those who will allow you think for yourself

Arantor

-sigh- It used to work but I guess it broke for some reason.

I long since removed it from my own stuff, never saw the point of that feature anyway.

Randem

Yes, unless it kept a log of errors it would be useless. The only way it would be of use is if SMF terminated because of a db error that was caught and written. But even then a log of errors might prove to be better.
Scams - How to Protect Yourself
Why Professionals Should Not Use Free Email Accounts

Always ignore those who attempt to tell you what to think and believe those who will allow you think for yourself

Arantor

Well, back in SMF 1.1, it would email you if you had certain kinds of database error. Unfortunately it would do that regardless of how frequently this occurred, and if you ran into a problem where the MySQL server had to be rebooted, you could easily get 10 or 20 emails in a short space of time telling you that the database couldn't connect.

SMF 2.0 tries to fix this to send you the email no more than once every 3 days but in order to do that, it has to track the last time it encountered an error such that it would notify you (and thus that's when it would update $db_last_error), but where this was placed inside Settings.php it was possible for a race condition to nuke the file entirely.

In 2.1 this value was abstracted out to a new file, where the value is meant to be the relevant timestamp but as you can see, it doesn't work...

Randem

Ok Thanks. As to the blank screen condition; I installed SMF 2.1 RC1 on a different server (still Linux). It installed fine, even if I put in bad database info I got a message telling me so. On the other linux server just a blank screen, More tests...

The only basic condition that was different is that this server used localhost and the other server has to use an IP address...
Scams - How to Protect Yourself
Why Professionals Should Not Use Free Email Accounts

Always ignore those who attempt to tell you what to think and believe those who will allow you think for yourself

Randem

Well, if that routine was going to have a chance at working, it needed to look like this:


function updateDbLastError($error = '0')
{
global $cachedir;

// Write out the db_last_error file with the error timestamp
if (!empty($cachedir) && is_writable($cachedir))
file_put_contents($cachedir . '/db_last_error.php', '<' . '?' . "php\n" . '$db_last_error = ' . $error . ';' . "\n" . '?' . '>');
else
file_put_contents(dirname(__FILE__) . '/cache/db_last_error.php', '<' . '?' . "php\n" . '$db_last_error = ' . $error . ';' . "\n" . '?' . '>');

return true;
}


I still get no error on the other server. I used a database connection name instead of an IP address and still no joy (or error)...
Scams - How to Protect Yourself
Why Professionals Should Not Use Free Email Accounts

Always ignore those who attempt to tell you what to think and believe those who will allow you think for yourself

Randem

Alright, I have found the issue that caused the blank screen. Three files did not upload to the server when copying. After finding which files that were missing by running the index.php (not the install.php). This process notified me of the errors of the missing files. Once found the install worked properly. The install did not check to see if the files existed and thus crashed with no error. Error reporting seems to be turned off on the install (no error_reporting(E_ALL) statement)

The three files were:

Subs.php
Subs-Auth.php
Load.php
Scams - How to Protect Yourself
Why Professionals Should Not Use Free Email Accounts

Always ignore those who attempt to tell you what to think and believe those who will allow you think for yourself

Advertisement: