Merge lp:~bcsaller/pyjuju/local-troubleshooting into lp:pyjuju

Proposed by Benjamin Saller
Status: Merged
Approved by: Kapil Thangavelu
Approved revision: 407
Merge reported by: Benjamin Saller
Merged at revision: not available
Proposed branch: lp:~bcsaller/pyjuju/local-troubleshooting
Merge into: lp:pyjuju
Diff against target: 175 lines (+120/-15)
4 files modified
docs/source/provider-configuration-local.rst (+48/-8)
juju/lib/lxc/data/juju-create (+2/-0)
juju/providers/local/__init__.py (+7/-7)
misc/devel-tools/juju-inspect-local-provider (+63/-0)
To merge this branch: bzr merge lp:~bcsaller/pyjuju/local-troubleshooting
Reviewer Review Type Date Requested Status
Kapil Thangavelu (community) Approve
William Reade (community) Approve
Review via email: mp+79193@code.launchpad.net

Description of the change

local provider troubleshooting aid

Includes docs and a small script to collect information about the local machines lxc environment for bug reports.

To post a comment you must log in.
406. By Benjamin Saller

note about container name on troubleshooting script

407. By Benjamin Saller

fixed some typos in the script

Revision history for this message
William Reade (fwereade) wrote :

[0]

+When providing bug reports or including issues the output of the both
+the master-customize.log mentioned above and the result of the
+devel-tools/juju-inspect-local-provider script.

Parse error. Perhaps "When reporting bugs or issues, please include both the master-customize.log (described above) and the output of the devel-tools/juju-inspect-local-provider script."?

Otherwise LGTM

review: Approve
Revision history for this message
Kapil Thangavelu (hazmat) wrote :

[0]
37 +When you first attempt to deploy a unit the time consuming process of
38 +creating a unit will begin

Services are deployed, service units are added/created

[1]

144 +virsh net-list --all

This should probably be delocalized LC_ALL="C"

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'docs/source/provider-configuration-local.rst'
--- docs/source/provider-configuration-local.rst 2011-10-07 20:04:21 +0000
+++ docs/source/provider-configuration-local.rst 2011-10-14 23:44:24 +0000
@@ -41,11 +41,51 @@
41Provider specific options41Provider specific options
42=========================42=========================
4343
44 data-dir: 44 data-dir:
45 Directory for zookeeper state and log files. 45 Directory for zookeeper state and log files.
46 46
4747
4848
49 49Troubleshooting
5050===============
5151
52Local development is still a young and evolving feature and because of
53the many complex system interactions its possible you'll encounter
54some speed bumps along your path. There are a number of log files you
55should be aware of when trying to understand how the system behaves.
56
57Once``juju bootstrap`` has run you'll have a directory in place on
58your filesystem at the location specified in your
59environments.yaml. In here you'll find a number of files related to
60the runtime of the local deployment system. The first step is to
61verify that the machine-agent.log includes a line similar to::
62
63 2011-10-05 14:43:56,327: juju.agents.machine@INFO: Machine agent started id:0 deploy:<class 'juju.machine.unit.UnitContainerDeployment'> provider:'local'
64
65When you first attempt to deploy a unit the time consuming process of
66creating a unit will begin. The first time you run this it can taGke
67quite some time and if your impatient and need to check on the process
68`lxc-ls` will show you which templates are created or being created
69and::
70
71 pgrep lxc| head -1| xargs watch pstree -alU
72
73will give you a refeshing view of the first container as its built.
74
75Once a container is built you should have access to it via ssh through
76the `juju ssh` as normal.
77
78If services are not running properly as exposed by `juju status` the
79log file in *data-dir/units/master-customize.log* should provide insight
80into the nature of the error.
81
82When providing bug reports or including issues the output of the both
83the master-customize.log mentioned above and the result of the
84devel-tools/juju-inspect-local-provider script. If you are not running
85a development checkout this script should be located at
86*/usr/lib/juju/juju/misc/devel-tools/juju-inspect-local-provider*
87
88By passing the name of the container as an argument to that script
89additional information abou the container will be included in the
90output as well. To find the name of the container in question `lxc-ls`
91can be used.
5292
=== modified file 'juju/lib/lxc/data/juju-create'
--- juju/lib/lxc/data/juju-create 2011-10-12 18:08:30 +0000
+++ juju/lib/lxc/data/juju-create 2011-10-14 23:44:24 +0000
@@ -146,3 +146,5 @@
146setup_juju146setup_juju
147# setup_juju ensures sudo is installed which is needed for setup_users147# setup_juju ensures sudo is installed which is needed for setup_users
148setup_users148setup_users
149
150echo "Container Customization Complete"
149\ No newline at end of file151\ No newline at end of file
150152
=== modified file 'juju/providers/local/__init__.py'
--- juju/providers/local/__init__.py 2011-10-12 18:08:30 +0000
+++ juju/providers/local/__init__.py 2011-10-14 23:44:24 +0000
@@ -70,6 +70,13 @@
70 raise ProviderError("Missing packages %s" % (70 raise ProviderError("Missing packages %s" % (
71 ", ".join(sorted(list(missing)))))71 ", ".join(sorted(list(missing)))))
7272
73 # Store user credentials from the running user
74 try:
75 public_key = get_user_authorized_keys(self.config)
76 public_key = public_key.strip()
77 except LookupError, e:
78 raise ProviderError(str(e))
79
73 # Get/create directory for zookeeper and files80 # Get/create directory for zookeeper and files
74 zookeeper_dir = os.path.join(self._directory, "zookeeper")81 zookeeper_dir = os.path.join(self._directory, "zookeeper")
75 if not os.path.exists(zookeeper_dir):82 if not os.path.exists(zookeeper_dir):
@@ -122,13 +129,6 @@
122 hierarchy = StateHierarchy(client, admin_identity, "local", "local")129 hierarchy = StateHierarchy(client, admin_identity, "local", "local")
123 yield hierarchy.initialize()130 yield hierarchy.initialize()
124131
125 # Store user credentials from the running user
126 try:
127 public_key = get_user_authorized_keys(self.config)
128 public_key = public_key.strip()
129 except LookupError, e:
130 raise ProviderError(str(e))
131
132 # Startup the machine agent132 # Startup the machine agent
133 pid_file = os.path.join(self._directory, "machine-agent.pid")133 pid_file = os.path.join(self._directory, "machine-agent.pid")
134 log_file = os.path.join(self._directory, "machine-agent.log")134 log_file = os.path.join(self._directory, "machine-agent.log")
135135
=== added directory 'misc/devel-tools'
=== added file 'misc/devel-tools/juju-inspect-local-provider'
--- misc/devel-tools/juju-inspect-local-provider 1970-01-01 00:00:00 +0000
+++ misc/devel-tools/juju-inspect-local-provider 2011-10-14 23:44:24 +0000
@@ -0,0 +1,63 @@
1#!/bin/bash -x
2
3# Gather a collection of data into an output file to make
4# debugging any possible issues with the local provider simpler
5
6if [ ! `id -u` == '0' ]; then
7 echo "This script should be run as root"
8 exit 1;
9fi
10
11if [ ${#} = 1 ]; then
12 image_name=$1
13fi
14
15# 11.10 (Oneiric) is the first supported release for the local provider due
16# to its improved LXC support
17source /etc/lsb-release
18major_release=`echo $DISTRIB_RELEASE | cut -d . -f 1`
19minor_release=`echo $DISTRIB_RELEASE | cut -d . -f 2`
20
21if [ $major_release -lt 11 -o $minor_release -lt 10 ]; then
22 echo "Oneiric 11.10 is the first supported release of the local provider"
23 exit 1;
24fi
25
26
27# Collect various status information about the system
28echo "#Local provider inspection"
29uname -a
30
31ifconfig
32virsh net-list --all
33
34ls /var/cache/lxc
35ls /var/cache/lxc/*
36
37lxc-ls
38
39# guess about the users data-dir
40if [ -n "${SUDO_USER}" ]; then
41 user=$SUDO_USER
42fi
43
44
45image=/var/lib/lxc/$image_name
46if [ -n "$image_name" -a -e "$image" ]; then
47 cat "$image/config"
48 chroot "$image/rootfs" bash -xc "
49 cat /etc/juju/juju.conf;
50 ls /usr/lib/juju/juju;
51 dpkg-query -s juju;
52 cat /etc/hostname
53 cat /etc/resolv.conf
54 cat /etc/hosts
55 tail -n 100 /var/log/juju/*.log
56 "
57fi
58
59
60
61
62
63

Subscribers

People subscribed via source and target branches

to status/vote changes: