bitnami / vms

Bitnami VMs
https://bitnami.com
Other
206 stars 43 forks source link

[Wordpress] Error establishing database connection #1004

Closed climberswa closed 1 year ago

climberswa commented 1 year ago

Platform

AWS

bndiagnostic ID know more about bndiagnostic ID

3dbc7d4d-4e7e-cc5f-694e-5cd2826c22a8

bndiagnostic output

? Apache: Found possible issues ? Mariadb: Found possible issues ✓ Connectivity: No issues found ? Wordpress: Found possible issues ✓ Resources: No issues found ✓ Processes: No issues found ? Php: Found possible issues

bndiagnostic was not useful. Could you please tell us why?

it seems like there are too many underlying issues

Describe your issue as much as you can

After Wordpress plugin auto-update (Site Kit by Google) Wordpress crashed and can't connect to the database.

Also, 'Cannot find any running daemon to contact' after 'sudo /opt/bitnami/ctlscript.sh status'

not really sure where to start and how to repair the database. Thank you for any help and advice in advance.

climberswa commented 1 year ago

Apache possible issues:

[Thu Jun 22 21:59:32.756346 2023] [autoindex:error] [pid 5022:tid 
140034078385920] [client **ip_address**:53334] AH01276: Cannot serve directory 
/opt/bitnami/wordpress/wp-admin/css/: No matching DirectoryIndex 
(index.html,index.html,index.htm,index.php) found, and server-generated 
directory index forbidden by Options directive, referer: binance.com

Not really sure what to do with this one. There are only CSS files in the folder.

WordPress & PHP

Since I used bndiagnostic I deleted the google-listings-and-ads plugin with all related tables (they were corrupted) I also have heaps of resources

Filesystem      Size  Used Avail Use% Mounted on
udev            3.9G     0  3.9G   0% /dev
tmpfs           798M  8.4M  790M   2% /run
/dev/xvda1      158G  6.4G  145G   5% /
tmpfs           3.9G     0  3.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/xvda15     124M  278K  124M   1% /boot/efi
tmpfs           798M     0  798M   0% /run/user/1000

When I restart the server, I can't see any services /opt/bitnami/ctlscript.sh status and have to run sudo gonit. Not sure if that means anything or not.

Mariadb

I deleted corrupted tables but the service keeps stopping. When I try to check bitnami_wordpress database with mysqlcheck it stops/loose a connection after one table is checked.

I'm not really sure what to do, mariadb still keeps crashing. I also have to have innodb_force_recovery = 6 to have that running.

Looking forward to hearing from someone soon. Best regard...

gongomgra commented 1 year ago

Hi @climberswa,

Thanks for using Bitnami. I'm afraid I don't know what's the issue with the database, but I see the next errors related to corrupted tables in the logs

2023-06-21 10:05:25 0 [Note] InnoDB: Buffer pool(s) load completed at 230621 10:05:25
2023-06-21 10:05:38 3 [ERROR] mysqld: Table './bitnami_wordpress/wp_options' is marked as crashed and should be repaired
2023-06-21 10:05:38 3 [Warning] Checking table:   './bitnami_wordpress/wp_options'
2023-06-21 10:05:38 3 [ERROR] mysqld: Table './bitnami_wordpress/wp_posts' is marked as crashed and should be repaired
2023-06-21 10:05:38 3 [Warning] Checking table:   './bitnami_wordpress/wp_posts'
2023-06-21 10:05:38 3 [ERROR] mysqld: Table './bitnami_wordpress/wp_postmeta' is marked as crashed and should be repaired
2023-06-21 10:05:38 3 [Warning] Checking table:   './bitnami_wordpress/wp_postmeta'
2023-06-21 10:05:39 3 [ERROR] mysqld: Table './bitnami_wordpress/wp_users' is marked as crashed and should be repaired
2023-06-21 10:05:39 3 [Warning] Checking table:   './bitnami_wordpress/wp_users'
2023-06-21 10:05:39 3 [ERROR] mysqld: Table './bitnami_wordpress/wp_usermeta' is marked as crashed and should be repaired
2023-06-21 10:05:39 3 [Warning] Checking table:   './bitnami_wordpress/wp_usermeta'
2023-06-21 10:05:40 3 [ERROR] mysqld: Table './bitnami_wordpress/wp_terms' is marked as crashed and should be repaired
2023-06-21 10:05:40 3 [Warning] Checking table:   './bitnami_wordpress/wp_terms'
2023-06-21 10:05:40 3 [ERROR] mysqld: Table './bitnami_wordpress/wp_term_taxonomy' is marked as crashed and should be repaired
2023-06-21 10:05:40 3 [Warning] Checking table:   './bitnami_wordpress/wp_term_taxonomy'
2023-06-21 10:05:40 3 [ERROR] mysqld: Table './bitnami_wordpress/wp_term_relationships' is marked as crashed and should be repaired
2023-06-21 10:05:40 3 [Warning] Checking table:   './bitnami_wordpress/wp_term_relationships'
2023-06-21 10:05:44 3 [ERROR] mysqld: Table './bitnami_wordpress/wp_wc_admin_notes' is marked as crashed and should be repaired
2023-06-21 10:05:44 3 [Warning] Checking table:   './bitnami_wordpress/wp_wc_admin_notes'

I understand those are the tables you removed, is that correct? Can you tell us how did you remove them? Apart from that, the most recent error message in the logs is different

2023-06-21 15:04:22 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2023-06-21 15:04:22 0 [ERROR] Aborting

I'm afraid I don't know how to fix that error. We recommend you to ask in a more specialized forum. For example, you may find other users with the same problem in the WordPress official forums

https://wordpress.org/support/forums/

climberswa commented 1 year ago

Hi @gongomgra,

thank you so much for looking at this.

It looks like the database was corrupted even more than I knew. I removed different tables from those listed above, which were all related to one plugin. I could not really use any services (MySQL, MariaDB, ...) so had to delete the tables directly by deleting the files in the Data folder.

After all, I could not get the database up and running for more than a few seconds so have reverted the server to the latest working backup.

Thanks again for getting back to me.