ChainsAutomation / chains

Chains Automation
GNU General Public License v2.0
7 stars 4 forks source link

Service describe fails sporadically #24

Closed stianstr closed 8 years ago

stianstr commented 8 years ago

This works sometimes, sometimes not: chains service describe tellstick

This always works: chains service action (tellstick-uuid) describe

Observed results: In the first case, it sometimes returns the description from the tellstick service, and sometimes it returns the "basic" description from Service.

Cause: What seems to happen is that the conversion from service name to service uuid in orchestrator fails. Sometimes it resolves to the correct service, and yields the correct description. Other times it resolves to another service. That may be a service without anything custom in description, which seems to be the case in "observed results". But in theory it could be any service with any description. And if the service it resolves to is not running, it would result in a timeout.

Suspects: Not sure, but it may have something to do with the changes introduced in #23. But it's kind of strange that the behaviour is seemingly random.

stianstr commented 8 years ago

Uhm, I think I got this wrong. Seems "chains service describe" does not support non-uuids at all :) Back to the drawing board.

stianstr commented 8 years ago

Reported by chrisq: Added debug print to runAction in a service and described it. The debug kicked in, but the description was still not the one returned from the function.

chrisaq commented 8 years ago
------------------------------------------------------------------------------------------
Service         Online   Manager         Heartbeat       ID
------------------------------------------------------------------------------------------
philipshue      Online   chainsmaster    1 sec ago       30b98476df614c67802f830a1bf16798
timer           Online   chainsmaster    1 sec ago       1c3bdb0ed7fc475fab1c1d4298a0545a
tellstick       Online   chainsmaster    1 sec ago       14ea92d1350b4d969863c962b086ec11
proximitynet    Online   chainsmaster    1 sec ago       d7021fd76322453f8a7212196a38d342
lifx            Online   chainsmaster    1 sec ago       eff6f234a3ed41879392f9474f37a556
system-mediacenter Online   mediacenter     1 sec ago       b7bd68e90d5d44c3a785fc2f10c40ab4
influx          Online   chainsmaster    1 sec ago       3967176ae8a94d7f92a3fe8b646ed0d9
integra                  mediacenter     about 94 hours ago 2002c1d695c34c8c8d560845a6df0da5
rrd             Online   chainsmaster    1 sec ago       269e9479538943a89833d8cbc3d5ff4c
system          Online   chainsmaster    1 sec ago       1d32b7fa2b9144bb8d52e5a434cebf33
usbinfo         Online   chainsmaster    1 sec ago       dde1ef24ef674ec183daad5e578b4127
system-rpi-z    Online   rpi-z           1 sec ago       130345c1a89143ac9b130e8e6bab91ef

root@puppeteer:/srv/chains/lib/chains/services/tellstick# chains service action 14ea92d1350b4
d969863c962b086ec11 describe

  info:
  events:
  actions:
    info: Describe this daemon
    args: []
    name: describe

    info:
    args: [{u'info': None, u'default': None, u'required': True, u'valid': None, u'key': u'val
ue', u'type': None}]
    name: echo

    info:
    args: []
    name: getLogLevel

    info:
    args: []
    name: ping

    info:
    args: [{u'info': None, u'default': None, u'required': True, u'valid': None, u'key': u'lev
el', u'type': None}]
    name: setLogLevel

    info: Shut down daemon
    args: []
    name: shutdow
2016-01-28 22:01:40 - sa.14ea92d1350b4d969863c962b086ec11.describe = []  [853e0a64-c69e-458a-9953-f3e
5f20b7856]
2016-01-28 22:01:40 - sr.3967176ae8a94d7f92a3fe8b646ed0d9.describe = {u'info': u'', u'events': [], u'
actions': [{u'info': u'Describe this daemon', u'args': [], u'name': u'describe'}, {u'info': u'', u'ar
gs': [{u'info': None, u'default': None, u'required': True, u'valid': None, u'key': u'value', u'type':
 None}], u'name': u'echo'}, {u'info': u'', u'args': [], u'name': u'getLogLevel'}, {u'info': u'', u'ar
gs': [], u'name': u'ping'}, {u'info': u'', u'args': [{u'info': None, u'default': None, u'required': T
rue, u'valid': None, u'key': u'level', u'type': None}], u'name': u'setLogLevel'}, {u'info': u'Shut do
wn daemon', u'args': [], u'name': u'shutdown'}]}  [853e0a64-c69e-458a-9953-f3e5f20b7856]
2016-01-28 22:01:40 - sr.14ea92d1350b4d969863c962b086ec11.describe = {u'info': u'', u'events': [], u'
actions': [{u'info': u'Send bell signal for a lamp', u'args': [{u'info': u'ID of device in tellstick.
conf', u'default': None, u'required': True, u'valid': None, u'key': u'id', u'type': u'int'}], u'name'
: u'bell'}, {u'info': u'Describe this daemon', u'args': [], u'name': u'describe'}, {u'info': u'Dim a
lamp to a specific level', u'args': [{u'info': u'ID of device in tellstick.conf', u'default': None, u
'required': True, u'valid': None, u'key': u'id', u'type': u'int'}, {u'info': u'Light level (0-255)',
u'default': None, u'required': True, u'valid': None, u'key': u'level', u'type': u'int'}], u'name': u'
dim'}, {u'info': u'', u'args': [{u'info': None, u'default': None, u'required': True, u'valid': None,
u'key': u'value', u'type': None}], u'name': u'echo'}, {u'info': u'', u'args': [], u'name': u'getLogLe
vel'}, {u'info': u'Send learn signal for a lamp', u'args': [{u'info': u'ID of device in tellstick.con
f', u'default': None, u'required': True, u'valid': None, u'key': u'id', u'type': u'int'}], u'name': u
'learn'}, {u'info': u"List available devices, and return result like this:\n[\n{'id': 1, 'name': 'office_roof',       'value': 250 },\n{'id': 1, 'name': 'livingroom_corner', 'value': 255 },\n]", u'args'
: [], u'name': u'list'}, {u'info': u'Turn a lamp off', u'args': [{u'info': u'ID of device in tellstic
k.conf', u'default': None, u'required': True, u'valid': None, u'key': u'id', u'type': u'int'}], u'nam
e': u'off'}, {u'info': u'Turn a lamp on', u'args': [{u'info': u'ID of device in tellstick.conf', u'de
fault': None, u'required': True, u'valid': None, u'key': u'id', u'type': u'int'}], u'name': u'on'}, {
u'info': u'', u'args': [], u'name': u'ping'}, {u'info': u'', u'args': [{u'info': None, u'default': No
ne, u'required': True, u'valid': None, u'key': u'level', u'type': None}], u'name': u'setLogLevel'}, {
u'info': u'Shut down daemon', u'args': [], u'name': u'shutdown'}, {u'info': u'', u'args': [], u'name'
: u'tdreset'}]}  [853e0a64-c69e-458a-9953-f3e5f20b7856]
stianstr commented 8 years ago

Extra reply from 3967176ae8a94d7f92a3fe8b646ed0d9 in output above, which is Influx service, which now listens to all keys. I think we found it :)

chrisaq commented 8 years ago

Sure did, influx-service was broken!