Can't connect to database

SYSTEM INFORMATION
**OS type and version: Ubuntu
**Webmin version: latest
**Virtualmin version: latest
Related products version: RECOMMENDED

Dear Sirs:

We updated virtualmin on a pro license server yesterday and it blew up the server. We did the same thing on a second machine right after which nocked out that machine as well. Never have I ever lost a server on an update. The panels don’t work right or don’t work at all and the sites are all down.

Needless to say, this is a very bad situation. I built a new machine during the night, Ubuntu 2.04, installed the GPL version of the panel (perhaps just about the first time but was in a hurry), and now the accounts I have restored to the machine all say “Unable to connect to the database” These are all WordPress sites. Any suggestions on how to debug this issue. All services are running - but the WP sites can’t connect. I am so use to the pro version the free version is cramping my style. It might have been a mistake to use the GPL.

Which version of Ubuntu are the original servers on?

They too are 20.x . I installed a new WordPress site on this new machine it it works, but I still can’t get the old sites to work. They installed from backup files that are not all that old and did not give me any indication of problems. I have played with the permission on one of the site trying make sure the user had full permissions. I sort of figured a permission problem but no joy yet. I just can’t figure this one out. I am OK at Linux and Ubuntu but far from an expert - which is why I like the control panel and the fact that it installs everything. I am not sure what to do at this point. To have destroyed the two largest machines by just updating the control panel is a nightmare. I was cautious on the second updates not yet realizing what was going to happen. I only allowed it to update the control panel and the 7.4 PHP version. And I actually wiped out a third machine in the night, though not a production machine yet. That makes three servers with screwed up control panels and no working sites. We are running out of machines. And if I can’t figure it out we will be running out of customers too pretty soon. We have 4 pro licensed servers at this time and I was about to add a fifth. Now I am not sure what to do.

What sort of error are you getting precisely? Does the site work at all in preview mode? Do you get any error code when visiting the site?

With Wordpress if you have a database issue it’s almost always because something is wrong in WP_Config. Either you have the wrong database name or password in it or something of that nature.

It doesn’t make any sense that a Virtulamin update would interfere with any of that.

Here is an example of the Apache logfiles. Not sure if you will be able to read it.

[Sun Jul 11 17:28:02.025249 2021] [fcgid:warn] [pid 818219:tid 140715708032768] [client 103.16.222.193:49610] mod_fcgid: stderr: thrown in /home/mapmet/public_html/wp-content/themes/twentynineteen/404.php on line 12
[Sun Jul 11 17:28:02.578879 2021] [fcgid:warn] [pid 818219:tid 140714939774720] [client 103.16.222.193:49591] mod_fcgid: stderr: PHP Fatal error: Uncaught Error: Call to undefined function get_header() in /home/mapmet/public_html/wp-content/themes/twentynineteen/404.php:12
[Sun Jul 11 17:28:02.578917 2021] [fcgid:warn] [pid 818219:tid 140714939774720] [client 103.16.222.193:49591] mod_fcgid: stderr: Stack trace:
[Sun Jul 11 17:28:02.578930 2021] [fcgid:warn] [pid 818219:tid 140714939774720] [client 103.16.222.193:49591] mod_fcgid: stderr: #0 {main}
[Sun Jul 11 17:28:02.578942 2021] [fcgid:warn] [pid 818219:tid 140714939774720] [client 103.16.222.193:49591] mod_fcgid: stderr: thrown in /home/mapmet/public_html/wp-content/themes/twentynineteen/404.php on line 12
[Mon Jul 12 02:03:42.510875 2021] [authz_core:error] [pid 1526974:tid 140715708032768] [client 5.8.10.202:49644] AH01630: client denied by server configuration: /home/mapmet/public_html/server-status
[Mon Jul 12 11:47:41.907063 2021] [fcgid:warn] [pid 1526974:tid 140715716425472] (70007)The timeout specified has expired: [client 171.125.231.4:51497] mod_fcgid: can’t get data from http client
[Thu Jul 15 10:48:07.877563 2021] [authz_core:error] [pid 3440127:tid 140714243507968] [client 143.198.136.88:50694] AH01630: client denied by server configuration: /home/mapmet/public_html/server-status
[Fri Jul 16 00:42:30.609309 2021] [ssl:error] [pid 38516:tid 140714730055424] [client 34.207.133.125:46926] AH02042: rejecting client initiated renegotiation
[Fri Jul 16 01:01:44.323053 2021] [fcgid:warn] [pid 38516:tid 140715724818176] (70007)The timeout specified has expired: [client 101.204.214.45:41678] mod_fcgid: can’t get data from http client
[Sat Jul 17 07:13:00.451036 2021] [fcgid:warn] [pid 652452:tid 139852590872320] (70007)The timeout specified has expired: [client 124.131.22.105:41984] mod_fcgid: can’t get data from http client
[Sat Jul 17 13:02:22.693142 2021] [core:error] [pid 652415:tid 139852632803072] (36)File name too long: [client 161.35.155.60:58056] AH00036: access to /3000D00E0000FFFF3F0031313744373731343634304537353046007A7A7A7A7A7A7A7A7A7A7A7A7A7A7A0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000008047A7A7A7A7A7A7A7A7A0000000000000000000000000000000000000000000000000000000000000000 failed (filesystem path ‘/home/mapmet/public_html/3000D00E0000FFFF3F0031313744373731343634304537353046007A7A7A7A7A7A7A7A7A7A7A7A7A7A7A0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000008047A7A7A7A7A7A7A7A7A0000000000000000000000000000000000000000000000000000000000000000’)
[Sun Jul 18 07:42:59.398235 2021] [fcgid:warn] [pid 1318427:tid 139852423083776] (70007)The timeout specified has expired: [client 103.104.46.14:64642] mod_fcgid: can’t get data from http client
[Tue Jul 20 01:17:21.151079 2021] [fcgid:warn] [pid 2529369:tid 139852280473344] (70008)Partial results are valid but processing is incomplete: [client 1.26.156.89:50140] mod_fcgid: can’t get data from http client
[Wed Jul 21 01:04:54.147816 2021] [fcgid:warn] [pid 3384950:tid 139852716697344] (104)Connection reset by peer: [client 167.71.13.196:41954] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Wed Jul 21 01:26:02.438351 2021] [cgi:error] [pid 3384950:tid 139852674733824] [client 195.133.40.227:35694] AH02811: script not found or unable to stat: /home/mapmet/cgi-bin/jarrewrite.sh
[Wed Jul 21 07:46:02.999131 2021] [fcgid:warn] [pid 3384949:tid 139852523763456] (104)Connection reset by peer: [client 116.209.165.218:35377] mod_fcgid: can’t get data from http client
[Wed Jul 21 14:08:22.297503 2021] [fcgid:warn] [pid 3925584:tid 139853323233024] (104)Connection reset by peer: [client 123.58.211.142:58398] mod_fcgid: can’t get data from http client
[Wed Jul 21 14:09:33.130920 2021] [fcgid:warn] [pid 3925584:tid 139852624410368] (104)Connection reset by peer: [client 123.58.211.142:54228] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Wed Jul 21 20:15:56.358043 2021] [fcgid:warn] [pid 3925346:tid 139852767020800] (70007)The timeout specified has expired: [client 223.150.247.174:18628] mod_fcgid: can’t get data from http client
[Thu Jul 22 05:06:57.579938 2021] [fcgid:warn] [pid 59735:tid 139853018670848] (104)Connection reset by peer: [client 183.136.225.12:33650] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Fri Jul 23 07:37:56.047066 2021] [fcgid:warn] [pid 912678:tid 139852381153024] (70007)The timeout specified has expired: [client 39.67.75.68:57313] mod_fcgid: can’t get data from http client
[Fri Jul 23 08:59:43.151780 2021] [fcgid:warn] [pid 912678:tid 139852775413504] (104)Connection reset by peer: [client 143.198.136.88:45428] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Sun Jul 25 13:25:23.657647 2021] [cgi:error] [pid 901352:tid 139686362216192] [client 13.90.76.209:50948] AH02811: script not found or unable to stat: /home/mapmet/cgi-bin/.env
[Wed Jul 28 17:50:09.224513 2021] [fcgid:warn] [pid 2775225:tid 139685372335872] (32)Broken pipe: [client 103.72.146.62:45736] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Wed Jul 28 17:50:52.500141 2021] [fcgid:warn] [pid 3222968:tid 139686362216192] (32)Broken pipe: [client 103.72.146.62:33882] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Wed Jul 28 17:52:12.039647 2021] [fcgid:warn] [pid 2980905:tid 139686353823488] (32)Broken pipe: [client 103.72.146.62:50884] mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
[Fri Jul 30 17:36:08.639128 2021] [fcgid:warn] [pid 3899859:tid 139685741451008] (70007)The timeout specified has expired: [client 113.182.78.243:37351] mod_fcgid: can’t get data from http client
[Sat Jul 31 07:18:47.624317 2021] [fcgid:warn] [pid 296398:tid 139685875668736] (70007)The timeout specified has expired: [client 115.61.115.245:37270] mod_fcgid: can’t get data from http client

That is all from two months ago. You said you just updated yesterday. Those logs have absolutely nothing to do with any of your problems.

Sorry about that. You are right of course. There does not appear to be any new Apache events. Not sure why. I have been at this for too many hours and I guess I can’t see straight anymore. I just took if for granted those last lines would be fresh because they almost always are. So now I have another problem, not getting current Apache error log events.

Of course, if the sites are not working there is nothing to report right? Nothing being written to the Apache logfiles.

Well, you still haven’t said anything about that so how would anybody know?

Pick one virtual server (site) that doesn’t work. Visit it in a browser. What error do you get? Use the preview website tool. What error do you get?

You’re saying you have a database problem. Now you’re saying you have an Apache problem. But you’re not giving any codes, screen shots, real information of any kind. It’s sort of impossible to just guess when somebody says “It’s not working”.

I am just saying there are no logfile entries because the sites are not working. Apache is fine. I installed a new WordPress site to test the server and it is fine. HTML only sites work fine. But any WordPress sites that need mySQL are not working. “Error establishing a database connection”. That is what you get in a browser. mySQL and Apache are running. As far as I can tell all of the restored WordPress sites are not working.

Then you more than likely have a problem with your wp_config as I said before. You’ve either moved something, changed something or modified something so the config file doesn’t have the right information in it.

One last time before I give up:

Pick ONE site. Go to the wp_config file. See what it lists as the database name, user, password, etc.

Then go find that database. Make sure it’s there. Make sure you have the right password, name, etc.

Start there.

For example, http://echohosting.net was a small WordPress site that I have spent the most time on. I figure if I can get it working I can get them all working. But so far I can’t figure out why these sites can’t connect. This is the new machine built during the night.

The machines that were updated yesterday are running but sites are down and control panel is down. It has never happened before. That is why I am not sure what to do. I can work the command line a little bit, but I not great. I am not trying to fix the servers that were working yesterday before updates. Just trying to figure out why a brand-new servers would not be working. Again, the restores seem to go well and the servers are pretty much the same. I just thought if the database are there, it must be some permission thing. Just a wild guess as I don’t have a clue so far.

And yes, the wp_config files seem OK so far.

So you’re not using the Virtualmin interface at all?

On the new server I just built, I used GPL for the first time and that control panel is working fine. It is the servers there were basically destroyed yesterday doing updates. Something that has never happened before. There is no functioning control panel on those machines. I am trying to restore to a new machine with server backup files. I have done it a thousand times before, but this time the sites are not working because of the database connection - and yet… I can’t see what is the issue.

So the site you just linked is on the new server, right? If so, go to that Virtual Server and install phpmyadmin. Then when that is done go to phpmyadmin for that site and find out for sure if the database for that site is actually there where it should be and that nothing has changed. If for some reason you can’t access that database, then you have a password/permissions issue that you can fix.

If that database isn’t there at all, then you know what your problem is.

Usermin version 1.823 Operating system Ubuntu Linux 20.04.3 PHP 7.4.3

Usermin isn’t Virtualmin. Usermin has nothing to do with your site other than users and email.

You should be accessing port 10000 for Virtualmin, not 20000.

I confess the first site I always installed was phpmyadmin - but I have not been able to get it to work to see all databases on Ubuntu so I have not tried to install it. Been getting use to the control panel for managing database. Yes, the databases are there, the tables are there with the data in it. The expected user is there, etc. But for some odd reason the sites cannot connect to the database. The install of the OS and control panel seemed flawless, so this is a puzzle to me. In a word, I can’t find anything wrong. - And of course, a newly installed WP site works fine too.

Hi:

I just tried to upgrade a WP version and for what it is worth, there are some errors. Not sure how important it is.

E: Unable to locate package php-pecl-imagick
E: Unable to locate package php7.4-pecl-imagick
E: Couldn’t find any package by glob ‘php7.4-pecl-imagick’
E: Couldn’t find any package by regex ‘php7.4-pecl-imagick’