1

I'm trying to create a charm that can connect to rabbitmq. I've written an amqp-relation-joined, and an amqp-relation-changed. Neither of these scripts executes when I run juju add-relation $mycharm rabbitmq-server. In the logs, I'm seeing

...
==> <$HOME>/.juju/local/log/unit-rabbitmq-server-0.log <==
2014-03-04 20:43:48 DEBUG juju.worker.uniter.filter filter.go:523 no new charm event
2014-03-04 20:43:48 DEBUG juju.worker.uniter.filter filter.go:338 got relations change

==> <$HOME>/.juju/local/log/unit-flask-0.log <==
2014-03-04 20:43:48 DEBUG juju.worker.uniter.filter filter.go:523 no new charm event
2014-03-04 20:43:48 DEBUG juju.worker.uniter.filter filter.go:338 got relations 
...

I expect to see some sort of output from my hooks because I'm logging stuff.

In amqp-relation-joined:

echo "DOING AMQP STUFF"
juju-log "$JUJU_REMOTE_UNIT modified its settings"
juju-log "Relation settings:"
relation-get
juju-log "Relation members:"
relation-list
touch /var/i_was_here

In amqp-relation-changed:

echo "DOING AMQP STUFF"
juju-log "$JUJU_REMOTE_UNIT modified its settings"
juju-log "Relation settings:"
relation-get
juju-log "Relation members:"
relation-list
touch /var/i_was_also_here

When I ssh into the machine, I am not seeing either /var/i_was_here or /var/i_was_also_here

I am running juju on Ubuntu 12.04 in local mode.

EDIT:

The metadata.yml is

name: flask
summary: Flask is a lightweight "microframework" that is often used for simple apis
maintainer: Ubuntu <[email protected]>
description: |
  ...
categories:
  - misc
subordinate: false
provides:
  api:
    interface: http
requires:
  amqp:
    interface: rabbitmq

The charms that I'm using are rolled into a single repository at https://github.com/peterklipfel/firesuit/tree/master/charms

1
  • Can you add your charm metadata.yaml file to the post please. Or if you have it hosted on a public repository that would even be better.
    – hatch
    Mar 4, 2014 at 22:59

2 Answers 2

0

Ok, so the problem that I was having was that I was not backgrounding a process in the start hook. As such, the hook never completed and essentially froze the state of that service. I thought it was working because the api that I was setting up would respond. The process that froze it was a foreground uwsgi process.

However, debug-hooks was not running because the node was frozen. What I didn't realize is that the tmux session opens a new session for each hook. So the initial session will not have the capabilities shown in the documentation... Of course, the documentation says this, but my brain didn't pick it up.

Thanks to all the juju folks for helping me through that one.

0

I don't see anything wrong with what you've posted. You should check to make sure your hooks are executable and also take a look at the debug hooks command:

https://jujucharms.com/docs/stable/developer-debugging

1
  • I have been trying to make juju debug-hooks work for 2 days, and it seems to be almost completely broken. The tmux session opens, but none of the documentation works Mar 5, 2014 at 0:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .