Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 417  / 2 Years ago, thu, january 20, 2022, 5:23:16

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


More From » 12.04

 Answers
7

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.


[#26683] Friday, January 21, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
needstar

Total Points: 268
Total Questions: 108
Total Answers: 117

Location: Seychelles
Member since Mon, Jun 28, 2021
3 Years ago
;