Can't access the WordPress Server deployed using MAAS-JUJU. Web page access ends up with Error "502 Bad Gateway (nginx/1.2.6 (Ubuntu)"

Bug #1206412 reported by nagabhushan on 2013-07-30
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
pyjuju
Undecided
Unassigned
wordpress (Juju Charms Collection)
Undecided
Unassigned

Bug Description

We refered the " Using MAAS for the Gauss Sled 1.9" guide to set up MAAS on a local SLED. We have sucessfully setup MAAS server and able to bring up 4 SOCs in the SLED and also deploy mysql and wordpress using juju. All the nodes are up and running and the same status is reported by "juju status" command and dns server is also working well.

We are facing an issue when we try to acess the wordpress installation page.Juju status reports that wordpress is deployed on node 19( reported as public-address: node19.maas) When we access "http://node19.maas/wp-admin/install.php" web page we get an Error "502 Bad Gateway (nginx/1.2.6 (Ubuntu). Intially I was under the impression that the issue is related to the network between the MAAS Server/Client machines and Webserver or some problem with the DNS lookup. But MAAS server is able to reolve the host name and reports correct IP.

I have installed apache2 webserver (using apt-get) to rule out any issues with firewalls,network etc.(By default the WordPress charm will install nginx. It is required to stop nginx service before starting apache server on default port). I can access apache default page without any issues. It seems there are no issues related firewall,netwrok etc between the client and servers.

Please have a look at the terminal logs for details on juju status etc...
=========Terminal logs: ================
root@ubuntu:/tmp# juju status
2013-07-25 17:11:15,134 INFO Connecting to environment...
2013-07-25 17:11:16,554 INFO Connected to environment.
machines:
0:
agent-state: running
dns-name: node75.maas
instance-id: /MAAS/api/1.0/nodes/node-a838635c-f459-11e2-b761-0022b0685374/
instance-state: unknown
1:
agent-state: running
dns-name: node76.maas
instance-id: /MAAS/api/1.0/nodes/node-c007f600-f4ef-11e2-b761-0022b0685374/
instance-state: unknown
2:
agent-state: running
dns-name: node19.maas
instance-id: /MAAS/api/1.0/nodes/node-79b697c0-f4ee-11e2-a29a-0022b0685374/
instance-state: unknown
services:
mysql:
charm: cs:precise/mysql-26
relations:
cluster:
- mysql
db:
- wordpress
units:
mysql/1:
agent-state: started
machine: 1
public-address: node76.maas
wordpress:
charm: cs:precise/wordpress-15
exposed: true
relations:
db:
- mysql
loadbalancer:
- wordpress
units:
wordpress/1:
agent-state: started
machine: 2
open-ports:
- 80/tcp
public-address: node19.maas
relation-errors:
db:
- mysql
2013-07-25 17:11:16,783 INFO 'status' command finished successfully
root@ubuntu:/tmp#

root@ubuntu:~# host node19.maas
node19.maas has address 192.168.42.19
root@ubuntu:~# host node19.maas localhost
Using domain server:
Name: localhost
Address: 127.0.0.1#53
Aliases:

node19.maas has address 192.168.42.19
root@ubuntu:~# host 192.168.42.19 localhost
Using domain server:
Name: localhost
Address: 127.0.0.1#53
Aliases:

19.42.168.192.in-addr.arpa domain name pointer node19.maas.

root@ubuntu:~# ping 192.168.42.19
PING 192.168.42.19 (192.168.42.19) 56(84) bytes of data.
64 bytes from 192.168.42.19: icmp_req=1 ttl=64 time=0.451 ms
64 bytes from 192.168.42.19: icmp_req=2 ttl=64 time=0.416 ms
64 bytes from 192.168.42.19: icmp_req=3 ttl=64 time=0.421 ms
64 bytes from 192.168.42.19: icmp_req=4 ttl=64 time=0.433 ms
64 bytes from 192.168.42.19: icmp_req=5 ttl=64 time=0.425 ms
64 bytes from 192.168.42.19: icmp_req=6 ttl=64 time=0.428 ms
64 bytes from 192.168.42.19: icmp_req=7 ttl=64 time=0.419 ms
^C
--- 192.168.42.19 ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 5999ms
rtt min/avg/max/mdev = 0.416/0.427/0.451/0.024 ms
root@ubuntu:~#

ubuntu@node19:~$ tail -f /var/log/nginx/access.log
192.168.42.1 - - [25/Jul/2013:16:47:30 +0530] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:22.0) Gecko/20100101 Firefox/22.0"
192.168.42.1 - - [25/Jul/2013:16:47:51 +0530] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:22.0) Gecko/20100101 Firefox/22.0"
127.0.0.1 - - [25/Jul/2013:16:48:01 +0530] "GET / HTTP/1.0" 200 177 "-" "w3m/0.5.3+cvs-1.1055"
192.168.42.1 - - [25/Jul/2013:16:49:42 +0530] "GET /wp-admin/install.php HTTP/1.1" 502 181 "-" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:22.0) Gecko/20100101 Firefox/22.0"
192.168.42.1 - - [25/Jul/2013:16:49:45 +0530] "GET / HTTP/1.1" 502 181 "-" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:22.0) Gecko/20100101 Firefox/22.0"
192.168.42.1 - - [25/Jul/2013:16:49:48 +0530] "GET / HTTP/1.1" 502 181 "-" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:22.0) Gecko/20100101 Firefox/22.0"
192.168.42.1 - - [25/Jul/2013:16:49:55 +0530] "GET /wp-admin/install.php HTTP/1.1" 502 181 "-" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:22.0) Gecko/20100101 Firefox/22.0"
192.168.42.1 - - [25/Jul/2013:16:50:25 +0530] "-" 400 0 "-" "-"
192.168.42.1 - - [25/Jul/2013:17:20:09 +0530] "GET /wp-admin/install.php HTTP/1.1" 502 181 "-" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:22.0) Gecko/20100101 Firefox/22.0"
192.168.42.1 - - [25/Jul/2013:17:20:26 +0530] "GET /wp-admin/install.php HTTP/1.1" 502 181 "-" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:22.0) Gecko/20100101 Firefox/22.0"
^C
ubuntu@node19:~$ tail -f /var/log/nginx/error.log
=================

Marco Ceppi (marcoceppi) wrote :

If you review the output of juju status you'll find the following:

relation-errors:
db:
- mysql

So it's expected that you'd get a 502, because there's a database relation error and as a result MySQL data isn't being propagated. Can you post the following log from wordpress/1: /var/log/juju/unit-*.log?

Changed in wordpress (Juju Charms Collection):
status: New → Incomplete
Changed in juju:
status: New → Invalid
nagabhushan (nag-angadi) wrote :
Download full text (9.1 KiB)

There is only one log file in "/var/log/juju/machine-agent.log" on wordpress/1 node.

=====cat of /var/log/juju/machine-agent.log ==============
root@node19:~# cat /var/log/juju/machine-agent.log
2013-07-25 13:49:11,655: juju.agents.machine@INFO: Machine agent started id:2
2013-07-25 13:49:11,659: juju.agents.machine@DEBUG: Units changed old:set([]) n)
2013-07-25 13:49:11,659: juju.agents.machine@DEBUG: Starting service unit: word.
2013-07-25 13:49:11,682: unit.deploy@DEBUG: Downloading charm cs:precise/wordprs
2013-07-25 13:49:11,751: unit.deploy@DEBUG: Using <juju.machine.unit.UnitMachinu
2013-07-25 13:49:11,752: unit.deploy@DEBUG: Starting service unit wordpress/0...
2013-07-25 13:49:12,481: unit.deploy@INFO: Started service unit wordpress/0
2013-07-25 14:11:03,702: juju.agents.machine@INFO: Machine agent started id:2
2013-07-25 14:11:03,708: juju.agents.machine@DEBUG: Units changed old:set([]) n)
2013-07-25 14:11:03,709: juju.agents.machine@DEBUG: Starting service unit: word.
2013-07-25 14:11:03,739: unit.deploy@DEBUG: Downloading charm cs:precise/wordprs
2013-07-25 14:11:03,810: unit.deploy@DEBUG: Using <juju.machine.unit.UnitMachinu
2013-07-25 14:52:18,511: juju.agents.machine@DEBUG: Units changed old:set(['wor)
2013-07-25 14:52:18,512: juju.agents.machine@DEBUG: Stopping service unit: word.
2013-07-25 14:52:18,512: unit.deploy@INFO: Stopping service unit wordpress/0...
2013-07-25 14:52:18,796: unit.deploy@INFO: Stopped service unit wordpress/0
2013-07-25 14:56:34,593: juju.agents.machine@DEBUG: Units changed old:set([]) n)
2013-07-25 14:56:34,594: juju.agents.machine@DEBUG: Starting service unit: word.
2013-07-25 14:56:34,630: unit.deploy@DEBUG: Downloading charm cs:precise/wordprs
2013-07-25 14:56:34,706: unit.deploy@DEBUG: Using <juju.machine.unit.UnitMachinu
2013-07-25 14:56:34,707: unit.deploy@DEBUG: Starting service unit wordpress/1...
2013-07-25 14:56:35,450: unit.deploy@INFO: Started service unit wordpress/1
2013-07-25 16:49:22,043: juju.agents.machine@INFO: Machine agent started id:2
2013-07-25 16:49:22,048: juju.agents.machine@DEBUG: Units changed old:set([]) n)
2013-07-25 16:49:22,049: juju.agents.machine@DEBUG: Starting service unit: word.
2013-07-25 16:49:22,077: unit.deploy@DEBUG: Downloading charm cs:precise/wordprs
2013-07-25 16:49:22,147: unit.deploy@DEBUG: Using <juju.machine.unit.UnitMachinu
2013-07-25 17:19:22,328: juju.agents.machine@INFO: Machine agent started id:2
2013-07-25 17:19:22,334: juju.agents.machine@DEBUG: Units changed old:set([]) n)
2013-07-25 17:19:22,334: juju.agents.machine@DEBUG: Starting service unit: word.
2013-07-25 17:19:22,366: unit.deploy@DEBUG: Downloading charm cs:precise/wordprs
2013-07-25 17:19:22,445: unit.deploy@DEBUG: Using <juju.machine.unit.UnitMachinu
2013-07-26 11:47:18,567: twisted@ERROR: Unhandled error in Deferred:
2013-07-26 11:47:18,568: twisted@ERROR: Unhandled Error
Traceback (most recent call last):
Failure: zookeeper.NodeExistsException: node exists
                                                          ...

Read more...

Marco Ceppi (marcoceppi) wrote :

My apologies, didn't realize this was the Python Juju. The log file will be in /var/lib/juju/units/charm.log - after you have the log contents destroy and try deploying again to see if you can replicate the relation error or if it was a one-time issue.

nagabhushan (nag-angadi) wrote :
Download full text (93.4 KiB)

No issues...
Contents of log file "charm.log "
========================

root@node19:/var/lib/juju/units/wordpress-1#
root@node19:/var/lib/juju/units/wordpress-1# cat charm.log
2013-07-25 14:56:35,647: hook.executor@DEBUG: started
2013-07-25 14:56:35,659: statemachine@DEBUG: unitworkflowstate: transition install (None -> installed) {}
2013-07-25 14:56:35,659: statemachine@DEBUG: unitworkflowstate: execute action do_install
2013-07-25 14:56:35,686: juju.state.hook@DEBUG: Ignoring partially constructed relation: loadbalancer:4
2013-07-25 14:56:35,686: hook.output@DEBUG: Cached relation hook contexts: []
2013-07-25 14:56:35,699: hook.executor@DEBUG: Running hook: /var/lib/juju/units/wordpress-1/charm/hooks/install
2013-07-25 14:56:43,798: hook.output@INFO: You are about to add the following PPA to your system:
 Tools for use in juju charms.
 More info: https://launchpad.net/~charmers/+archive/charm-helpers

2013-07-25 14:56:45,938: hook.output@INFO: gpg: keyring `/tmp/tmpxjq483/secring.gpg' created

2013-07-25 14:56:45,939: hook.output@INFO: gpg: keyring `/tmp/tmpxjq483/pubring.gpg' created

2013-07-25 14:56:45,940: hook.output@INFO: gpg: requesting key 4796664E from hkp server keyserver.ubuntu.com

2013-07-25 14:56:46,600: hook.output@INFO: gpg: /tmp/tmpxjq483/trustdb.gpg: trustdb created

2013-07-25 14:56:46,601: hook.output@INFO: gpg: key 4796664E: public key "Launchpad PPA for charmers" imported

2013-07-25 14:56:46,602: hook.output@INFO: gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)

2013-07-25 14:56:46,762: hook.output@INFO: OK

2013-07-25 14:56:47,329: hook.output@INFO: Ign http://ppa.launchpad.net raring Release.gpg

2013-07-25 14:56:47,330: hook.output@INFO: Hit http://ports.ubuntu.com raring Release.gpg

2013-07-25 14:56:47,569: hook.output@INFO: Hit http://archive.ubuntu.com raring Release.gpg

2013-07-25 14:56:47,709: hook.output@INFO: Ign http://ppa.launchpad.net raring Release

2013-07-25 14:56:47,709: hook.output@INFO: Hit http://ports.ubuntu.com raring-updates Release.gpg

2013-07-25 14:56:47,887: hook.output@INFO: Get:1 http://archive.ubuntu.com raring-updates Release.gpg [933 B]

2013-07-25 14:56:48,088: hook.output@INFO: Hit http://ports.ubuntu.com raring-backports Release.gpg

2013-07-25 14:56:48,218: hook.output@INFO: Hit http://archive.ubuntu.com raring-backports Release.gpg

2013-07-25 14:56:48,469: hook.output@INFO: Hit http://ports.ubuntu.com raring-security Release.gpg

2013-07-25 14:56:48,545: hook.output@INFO: Hit http://archive.ubuntu.com raring Release

2013-07-25 14:56:48,834: hook.output@INFO: Get:2 http://archive.ubuntu.com raring-updates Release [40.8 kB]

2013-07-25 14:56:48,847: hook.output@INFO: Hit http://ports.ubuntu.com raring Release

2013-07-25 14:56:49,166: hook.output@INFO: Hit http://archive.ubuntu.com raring-backports Release

2013-07-25 14:56:49,226: hook.output@INFO: Hit http://ports.ubuntu.com raring-updates Release

2013-07-25 14:56:49,476: hook.output@INFO: Hit http://archive.ubuntu.com raring/main Sources

2013-07-25 14:56:49,489: hook.output@INFO: Hit https://private-ppa.launchpad.net raring Release.gpg

2013-07-25 14:56:49,604: hook.output@INFO: Hit http://ports....

nagabhushan (nag-angadi) wrote :

BTW I need info on redployin the wordpress. Do I need to bring mysql and wordpress nodes to ready state before proceeding to juju deploy? or just destroying mysql and wordpress services will suffice?

nagabhushan (nag-angadi) on 2013-08-07
Changed in wordpress (Juju Charms Collection):
status: Incomplete → New
status: New → Incomplete
Launchpad Janitor (janitor) wrote :

[Expired for wordpress (Juju Charms Collection) because there has been no activity for 60 days.]

Changed in wordpress (Juju Charms Collection):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers