Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mqtt_subscriber signal crashes if used with another signal on the same synapse #573

Open
vinpav opened this issue Sep 18, 2019 · 3 comments

Comments

@vinpav
Copy link

vinpav commented Sep 18, 2019

Hi !
First of all notice that I've been using Kalliope for more than a year now and my version isn't up to date (must be the 5.1 release).

I recently tested the "mqtt_subscriber" signal and it looks like this signal is not working when used with an "order" signal in the same synapse.

For example :

  - name: "hello"
    signals:
      - mqtt_subscriber:
          broker_ip: "192.168.xx.xx"
          topic: "hello-topic"
    neurons:
      - say:
          message: "Hey there !"

Works as intended.

Whereas :

  - name: "hello"
    signals:
      - order: "salut"
      - mqtt_subscriber:
          broker_ip: "192.168.xx.xx"
          topic: "hello-topic"
    neurons:
      - say:
          message: "Hey there !"

Raises a python error (I don't have the stack trace unfortunately) when the mqtt_subscriber signal is triggered.

Did you experienced this error already ? Is this a bug ?

Thanks !

@Sispheor
Copy link
Member

If you can provide the stack trace.
Thanks for the synapse example, it's a good start for us.

@vinpav
Copy link
Author

vinpav commented Sep 28, 2019

Here's the stack trace :

Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/usr/local/lib/python2.7/dist-packages/kalliope-0.5.1-py2.7.egg/kalliope/signals/mqtt_subscriber/mqtt_subscriber.py", line 33, in run list_broker_to_instantiate = self.get_list_broker_to_instantiate(self.list_synapses_with_mqtt) File "/usr/local/lib/python2.7/dist-packages/kalliope-0.5.1-py2.7.egg/kalliope/signals/mqtt_subscriber/mqtt_subscriber.py", line 65, in get_list_broker_to_instantiate if not any(x.broker_ip == signal.parameters["broker_ip"] for x in returned_list_of_broker): File "/usr/local/lib/python2.7/dist-packages/kalliope-0.5.1-py2.7.egg/kalliope/signals/mqtt_subscriber/mqtt_subscriber.py", line 65, in <genexpr> if not any(x.broker_ip == signal.parameters["broker_ip"] for x in returned_list_of_broker): TypeError: string indices must be integers, not str

I'm not sure but it seems that the synapse crashes only when there's an "order" signal after the "mqtt_subscriber" signal. The correct example to reproduce the error might be :

- name: "hello"
    signals:
      - mqtt_subscriber:
          broker_ip: "192.168.xx.xx"
          topic: "hello-topic"
      - order: "hello"
    neurons:
      - say:
          message: "Hey there !"

@Sispheor
Copy link
Member

Thanks. I'll take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants