Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WordPress Multisite] RDS database - connection issues #978

Closed
guytz72 opened this issue Jun 9, 2023 · 10 comments
Closed

[WordPress Multisite] RDS database - connection issues #978

guytz72 opened this issue Jun 9, 2023 · 10 comments
Assignees
Labels
solved stale 15 days without activity tech-issues The user has a technical issue about an application triage Triage is needed wordpress

Comments

@guytz72
Copy link

guytz72 commented Jun 9, 2023

Platform

AWS

bndiagnostic ID know more about bndiagnostic ID

6fdbac62-c7be-a793-59e5-bfc389d8398f

bndiagnostic output

===== Begin of bndiagnostic tool output =====

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

[Connectivity]

Server ports 22, 80 and/or 443 are not publicly accessible. Please check the
following guide to open server ports for remote access:

https://docs.bitnami.com/general/faq/administration/use-firewall/

[Wordpress]

Press [Enter] to continue:
Some files don't have the expected permissions Please check the following guide:

https://docs.bitnami.com/general/apps/wordpress/administration/understand-
file-permissions/

[Apache]

Found recent error or warning messages in the Apache error log.

[Thu Jun 08 15:29:30.753874 2023] [proxy:error] [pid 7201:tid 139704624187136] 
(2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain 
socket /opt/bitnami/php/var/run/www.sock (www-fpm:8000) failed
 [Thu Jun 08 15:29:30.753931 2023] [proxy_fcgi:error] [pid 7201:tid 
139704624187136] [client **ip_address**:46388] AH01079: failed to make 
connection to backend: httpd-UDS
 [Thu Jun 08 16:12:53.026635 2023] [core:error] [pid 8818:tid 139885893621504] 
[client **ip_address**:42712] AH00124: Request exceeded the limit of 10 internal 
redirects due to probable configuration error. Use 'LimitInternalRecursion' to 
increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

Please check the following guide to troubleshoot server issues:

Press [Enter] to continue:
https://docs.bitnami.com/general/apps/wordpress/troubleshooting/debug-erro
rs-apache/

===== End of bndiagnostic tool output =====

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

The suggested ports are open, so the tool is incorrect. My specific issue is not listed

Describe your issue as much as you can

I am trying to migrate my Wordpress Multisite from an older Bitnami stack to a new one. I have the below set up:

Existing:
EC2 Server
RDS Database (MySql)
Elastic IP

New:
EC2 Server
RDS Database (MariaDB)

I backed up the old site with Wp-Staging, created the new EC2 server with the new Bitnami stack. I then create a new RDS instance, did a SQL dump from the internal MariaDB on the new server, and ran that on the new RDS instance. I changed the wp-config file and verified connection to the database from the command line in the new EC2 instance (I’d already set up the appropriate rules in the Security Groups.

I then changed the Elastic IP (that all the DNS entries point to) to be associated with the new instance. I also changed the below files/db tables to have the appropriate (existing) domain:

wp-config.php
wp_options
wp_site
wp_blogs

When I access the site I get an "Error establishing a database connection" message. I re-confirmed connection to the db from the EC2 instance command line, and it is fine. As is connecting to the db through my local machine.

What else to I need to change?

I am finding the upgrade process for Bitnami to be incredibly frustrating just to get the latest version of PHP and Wordpress I need to build an entire new environment, with little to no user guides (that google can find anyway.)

I’ve reverted back to my old environment in the meantime.

@guytz72 guytz72 added the tech-issues The user has a technical issue about an application label Jun 9, 2023
@github-actions github-actions bot added the triage Triage is needed label Jun 9, 2023
@guytz72 guytz72 changed the title [<application>] <title> WordPress Multisite on AWS with RDS database - connection issues Jun 9, 2023
@jotamartos
Copy link
Collaborator

When I access the site I get an "Error establishing a database connection" message. I re-confirmed connection to the db from the EC2 instance command line, and it is fine. As is connecting to the db through my local machine.

If you get that error message, please review the database's configuration in the wp-config.php file.

https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-error-establishing-a-database-connection-in-wordpress/

I am finding the upgrade process for Bitnami to be incredibly frustrating just to get the latest version of PHP and Wordpress I need to build an entire new environment, with little to no user guides (that google can find anyway.)

You can just launch a new instance and migrate the data

https://docs.bitnami.com/general/how-to/migrate-wordpress/

You can also move to the Bitnami WordPress Chart solution that solves that problem. You can easily upgrade the solution without the need of launching a new server and migrating the data.

https://docs.bitnami.com/aws/get-started-charts-eks-marketplace/

@jotamartos jotamartos changed the title WordPress Multisite on AWS with RDS database - connection issues [WordPress Multisite] RDS database - connection issues Jun 12, 2023
@guytz72
Copy link
Author

guytz72 commented Jun 12, 2023

Hi,

"If you get that error message, please review the database's configuration in the wp-config.php file."

As I said in the issue I can connect from the command line when SSH'd into the Bitnami instance to the database using the same details in the wp-config.php file, so the issue is not there. I have looked at the link you sent but can't see anything that applies.

@guytz72
Copy link
Author

guytz72 commented Jun 12, 2023

Decided to try the other suggested solution:

"You can also move to the Bitnami WordPress Chart solution that solves that problem. You can easily upgrade the solution without the need of launching a new server and migrating the data.

https://docs.bitnami.com/aws/get-started-charts-eks-marketplace/"

Followed all the instructions, got to the end of step 5 in the prerequisites https://docs.bitnami.com/aws/get-started-eks/, prompted for username when I shouldn't be (or at least no mention of it, so now trawling around the internet trying to find a fix for that

@jotamartos
Copy link
Collaborator

Followed all the instructions, got to the end of step 5 in the prerequisites https://docs.bitnami.com/aws/get-started-eks/, prompted for username when I shouldn't be (or at least no mention of it, so now trawling around the internet trying to find a fix for that

Hi, I just took a quick look at the cluster creation form in AWS and it didn't ask for a username. You can contact the AWS support team if you have any issues during the cluster creation.

Apart from that, you can use the eksctl CLI tool to create the cluster

https://eksctl.io/

As an alternative, I also suggest you use minikube or any similar alternative to deploy the solution locally and confirm that it meets your needs.

@guytz72
Copy link
Author

guytz72 commented Jun 13, 2023

It is not a problem creating the cluster, it has been created and is active:

https://capture.dropbox.com/CCfTibKYLu9meBgA

It is running the command below to verify the creation (the end of Step 5):
kubectl get svc

I get prompted for a username and a password, so I enter something random (as I never created a username or password as part of the instructions). I get this error:

https://capture.dropbox.com/Aep0IN6T3LZeWhMu

No idea where to go from there,

And what about the db connection for the original issues, any suggestions on that?

So far neither solution is any good for me and I'm stuck with a product I can't upgrade to a supported version.

@jotamartos
Copy link
Collaborator

Do not know why you are being asked for a username/password when running the command. Will need to review the guide to know if we need to update it.

And what about the db connection for the original issues, any suggestions on that?

You can try to connect to the database with a custom PHP script and confirm that the credentials are valid

https://www.w3schools.com/php/php_mysql_connect.asp

If you continue running into issues with WordPress and the db connection, I suggest you contact them to know more about the issue and how to troubleshoot it.

@guytz72
Copy link
Author

guytz72 commented Jun 14, 2023

Do not know why you are being asked for a username/password when running the command. Will need to review the guide to know if we need to update it.

Your guides are out of date. I managed to get past the original issue of being prompted for a username, but then could not run kubectl as the due to permissions issues. These were resolved by creating the cluster via the cli.

However now falling this https://docs.bitnami.com/aws/get-started-charts-eks-marketplace/ on step 2. I get the error "Error: INSTALLATION FAILED: create: failed to create: namespaces "kubeapps" not found". That was after multiple steps in the AWS marketplace being different from the ones in the guide.

I just want a working up to date wordpress environment and am getting increasingly frustrated.

@jotamartos
Copy link
Collaborator

Instead of fighting with the EKS cluster, you can deploy it locally with minikube or the docker solution and test the solution first.

You can try to connect to the database with a custom PHP script and confirm that the credentials are valid

https://www.w3schools.com/php/php_mysql_connect.asp

If you continue running into issues with WordPress and the db connection, I suggest you contact them to know more about the issue and how to troubleshoot it.

Did you try this?

@github-actions
Copy link

github-actions bot commented Jul 1, 2023

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

@github-actions github-actions bot added the stale 15 days without activity label Jul 1, 2023
@github-actions
Copy link

github-actions bot commented Jul 7, 2023

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.

@github-actions github-actions bot added the solved label Jul 7, 2023
@bitnami-bot bitnami-bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved stale 15 days without activity tech-issues The user has a technical issue about an application triage Triage is needed wordpress
Projects
None yet
Development

No branches or pull requests

3 participants