marksull / err-backend-cisco-spark

Errbot Backend for Cisco Spark
GNU General Public License v3.0
6 stars 3 forks source link

AttributeError: 'Person' object has no attribute '_json' #3

Closed derchrisuk closed 6 years ago

derchrisuk commented 6 years ago

Hi,

I'm currently trying to setup a bot for Cisco Spark using Errbot. Got it working so far that the webhook has been created, i can see the correct Spark Signature. It joins the channel (only when adding the bot manually to the room). When I try to talk to the bot, like issue any errbot commands, I get the following:

Traceback (most recent call last):
  File "/usr/local/bin/bottle.py", line 862, in _handle
    return route.call(**args)
  File "/usr/local/bin/bottle.py", line 1740, in wrapper
    rv = callback(*a, **ka)
  File "/usr/local/lib/python3.6/site-packages/errbot/core_plugins/wsview.py", line 82, in __call__
    response = self.func(request, **kwargs)
  File "/Users/cgerbran/akatec-bot/plugins/err-webhook-cisco-spark/ciscosparkwebhook.py", line 40, in errbot_spark
    person = self._bot.create_person_using_id(webhook_event.data.personId)
  File "/Users/cgerbran/akatec-bot/data/plugins/err-backend-cisco-spark/CiscoSpark.py", line 443, in create_person_using_id
    person.id = id
  File "/Users/cgerbran/akatec-bot/data/plugins/err-backend-cisco-spark/CiscoSpark.py", line 51, in id
    self._spark_person._json['id'] = val
  File "/usr/local/lib/python3.6/site-packages/ciscosparkapi/models/sparkdata.py", line 103, in __getattr__
    "".format(self.__class__.__name__, item)
AttributeError: 'Person' object has no attribute '_json'
14:06:31 DEBUG    Rocket.Errors.Thread-28   Sending Headers: 'HTTP/1.1 500 Internal Server Error\r\nContent-Length: 756\r\nContent-Type: text/html; charset=UTF-8\r\nDate: Wed, 16 May 2018 12:06:31 GMT\r\nServer: Rocket 1.2.5 Python/3.6.5\r\nConnection: keep-alive\r\n\r\n'
14:06:31 DEBUG    Rocket.Errors.Thread-28   Finally closing output and sock_file
14:06:31 INFO     Rocket.Requests           127.0.0.1 - "POST /errbot/spark HTTP/1.1" - 500 756

This can be reproduced by just saying @bot hi

Any idea what could be wrong here?

jamiereid commented 6 years ago

I am having this same issue.

component version
python 3.6.5
errbot-backend-cisco-spark ref 69cc215
errbot 5.2.0
jamiereid commented 6 years ago

Digging into it, it appears the problem could be either the way the code uses the ciscosparkapi package, or in that package itself. Digging further.