juju-solutions / charm-mysql

MySQL charm
Other
2 stars 17 forks source link

Connection error with GCP #24

Open ruliezz opened 6 years ago

ruliezz commented 6 years ago

Arther running juju add-relation wordpress mysql or any other webapp e.g. mediawiki the webapp cant connect to mysql db in GCP, it works in AWS. However the same webapps works perfect with mariadb in GCP.

juju debug-log

unit-wordpress-0: 16:02:50 DEBUG unit.wordpress/0.db-relation-changed php5-fpm start/running, process 17527
unit-wordpress-0: 16:02:50 DEBUG unit.wordpress/0.db-relation-changed  * Restarting nginx nginx
unit-wordpress-0: 16:02:51 DEBUG unit.wordpress/0.db-relation-changed    ...done.
unit-wordpress-0: 16:02:47 DEBUG unit.wordpress/0.db-relation-changed <!DOCTYPE html>
unit-wordpress-0: 16:02:47 DEBUG unit.wordpress/0.db-relation-changed <html xmlns="http://www.w3.org/1999/xhtml">
unit-wordpress-0: 16:02:47 DEBUG unit.wordpress/0.db-relation-changed <head>
unit-wordpress-0: 16:02:47 DEBUG unit.wordpress/0.db-relation-changed <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
unit-wordpress-0: 16:02:47 DEBUG unit.wordpress/0.db-relation-changed   <title>Database Error</title>
unit-wordpress-0: 16:02:47 DEBUG unit.wordpress/0.db-relation-changed 
unit-wordpress-0: 16:02:47 DEBUG unit.wordpress/0.db-relation-changed </head>
unit-wordpress-0: 16:02:47 DEBUG unit.wordpress/0.db-relation-changed <body>
unit-wordpress-0: 16:02:47 DEBUG unit.wordpress/0.db-relation-changed   <h1>Error establishing a database connection</h1>
unit-wordpress-0: 16:02:47 DEBUG unit.wordpress/0.db-relation-changed </body>
unit-wordpress-0: 16:02:47 DEBUG unit.wordpress/0.db-relation-changed </html>
unit-mysql-0: 16:18:36 WARNING juju.worker.uniter.operation we should run a leader-deposed hook here, but we can't yet
gmwubs commented 6 years ago

Confirmed.. same issue when following procedures as described at https://jujucharms.com/wordpress/

Once bootstrapped, deploy the MySQL charm then this WordPress charm: juju deploy mysql juju deploy wordpress

Add a relation between the two of them: juju add-relation wordpress mysql Expose the WordPress installation: juju expose wordpress

After this, I only get a "504 - Gateway time out error"

Upon investigating, the wordpress charm seems to work with mysql charm on AWS. Only got this working on GCP 2 out 20 times. To troubleshoot, I've tried deploying mysql first and let it complete. Only then deploy wordpress. Unfortunately, same result.