Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 <Ubuntu@ip-172-31-24-81.us-west-2.compute.internal>
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

share|improve this question
    
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 at 22:59

2 Answers 2

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://juju.ubuntu.com/docs/authors-hook-debug.html

share|improve this answer
    
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 –  Peter Klipfel Mar 5 at 0:40
up vote 0 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.