Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: salamihawk on June 16, 2021, 12:27:10 PM

Title: Sporadic DB errors after migrating from old server to new
Post by: salamihawk on June 16, 2021, 12:27:10 PM
Hello,

My hoster has forced me to migrate from an old Debian 8 server to a new server based on Debian 10.

With that came a whole host of other upgrades, namely php7 (7.3.27).

not anticipating any problems (I've been doing this long enough to know better!), I simply copied my old forum and DB over (scp'd the old forum directory, ensured proper owner rights with chown, dumped the old DB in it's entirety and read it into the new MySQL server), made sure apache was running and configured and everything looked OK.

I've noticed, however, that I get sporadic DB errors. I get emails from the system saying:

QuoteThere has been a problem with the database!

This is a notice email to let you know that SMF could not connect to the database, contact your host if this continues.

I tried upgrading the forum from 2.0.17 to 2.0.18, but that didn't seem to fully solve the issue. Sometimes if I'm using the forum it seems to work, but then just breaks down in the middle of working fine. Sometimes it just throws an error "database error, try again" or it gives me some error pointing to a specific line in Subs.php. The exact line number kept changing and I don't have an example anymore as my forum appears to be working right at this very moment.

It's not a very high traffic forum. I don't know what the issue is anymore. Does anyone have any ideas?

I've ran the upgrade.php script and it executed successfully and was even able to delete itself, so I'm at a loss.
Title: Re: Sporadic DB errors after migrating from old server to new
Post by: Sir Osis of Liver on June 16, 2021, 12:42:21 PM
If database connect errors are intermittent, that's usually a server issue.  Contact host support, or move to a better host.
Title: Re: Sporadic DB errors after migrating from old server to new
Post by: salamihawk on June 16, 2021, 02:20:08 PM
Unfortunately the MySQL DB is locally installed, and I've got root access to the system, so I'm responsible for whatever this issue is
Title: Re: Sporadic DB errors after migrating from old server to new
Post by: SpacePhoenix on June 16, 2021, 02:46:16 PM
What errors are you actually getting?
Title: Re: Sporadic DB errors after migrating from old server to new
Post by: salamihawk on June 16, 2021, 03:54:48 PM
Quote from: SpacePhoenix on June 16, 2021, 02:46:16 PM
What errors are you actually getting?

I'm actually trying my best to recreate the problem but I'm just not seeing it right now. I guess I'll have to keep an eye on it.
Title: Re: Sporadic DB errors after migrating from old server to new
Post by: shadav on June 16, 2021, 04:17:11 PM
usually when this happens to me on my hosts its because some resource has gone over its limit
so check your server and database resources/usage

recently it was because the database user is only allowed so many connections so I had to make a new user for each database

any errors in your logs, not smf logs but server logs, hosting account logs