Skip to content

Chatops does not seem to be working for cisco spark [webex teams] #198

Closed
@viveksyngh

Description

@viveksyngh

Hi,

I am using chatops with cisco spark ( Webex Team). I am able to get messages from webex teams room to st2chatops but it is failing to handle the messages correctly.

  1. When I run any command inside a webex room, It does not respond and I can see in the logs there are no listeners.
Sat Nov 16 2019 20:03:13 GMT+0000 (Coordinated Universal Time)] DEBUG Matched new message pack get chatops
[Sat Nov 16 2019 20:03:13 GMT+0000 (Coordinated Universal Time)] DEBUG Fired listener callback for <roomId>
[Sat Nov 16 2019 20:03:13 GMT+0000 (Coordinated Universal Time)] DEBUG Received pack get chatops from <username>
[Sat Nov 16 2019 20:03:13 GMT+0000 (Coordinated Universal Time)] DEBUG No listeners executed; falling back to catch-all
  1. I am sending the message using chatops.post_message it not able to send the message to correct room.
st2 run chatops.post_message user="room-id"  message="Hey \n this is a Test message" channel=stackstorm  whisper=true

It is able to get message but not able to identify the roomId correctly as it is using nested object for roomId.

[Sat Nov 16 2019 20:21:58 GMT+0000 (Coordinated Universal Time)] DEBUG Send message to room [object Object] with text Hey \n this is a Test message

This one I fixed by fixing the code in hubot-spark adapter.

  1. When hubot starts it prints this error.
[Sat Nov 16 2019 20:08:58 GMT+0000 (Coordinated Universal Time)] DEBUG Loading adapter spark
[Sat Nov 16 2019 20:08:58 GMT+0000 (Coordinated Universal Time)] INFO Trying connection to https://api.ciscospark.com/v1
one flight: attempted to invoke _getBinding while previous invocation still in flight
one flight: attempted to invoke _getBinding while previous invocation still in flight
[Sat Nov 16 2019 20:09:01 GMT+0000 (Coordinated Universal Time)] DEBUG Connected as a bot? true
[Sat Nov 16 2019 20:09:01 GMT+0000 (Coordinated Universal Time)] INFO Created connection instance to Spark
[Sat Nov 16 2019 20:09:01 GMT+0000 (Coordinated Universal Time)] DEBUG Completed adding rooms to list
[Sat Nov 16 2019 20:09:01 GMT+0000 (Coordinated Universal Time)] DEBUG Created bot, setting up listeners
[Sat Nov 16 2019 20:09:01 GMT+0000 (Coordinated Universal Time)] DEBUG Done with custom bot logic
[Sat Nov 16 2019 20:09:01 GMT+0000 (Coordinated Universal Time)] DEBUG Loading scripts from /opt/stackstorm/chatops/bin/scripts
[Sat Nov 16 2019 20:09:01 GMT+0000 (Coordinated Universal Time)] DEBUG Loading scripts from /opt/stackstorm/chatops/bin/src/scripts
(node:4853) UnhandledPromiseRejectionWarning: Forbidden: permission denied
undefined https://api.ciscospark.com/v1/messages
WEBEX_TRACKING_ID: spark-js-sdk_4db8a287-a006-4468-9e90-6733e9e7d8f6_3

    at Forbidden.ExtendableBuiltin (/opt/stackstorm/chatops/node_modules/@ciscospark/common/dist/exception.js:50:44)
    at Forbidden.Exception (/opt/stackstorm/chatops/node_modules/@ciscospark/common/dist/exception.js:99:142)
    at Forbidden.HttpError (/opt/stackstorm/chatops/node_modules/@ciscospark/http-core/dist/http-error.js:70:125)
    at Forbidden.SparkHttpError (/opt/stackstorm/chatops/node_modules/@ciscospark/spark-core/dist/lib/spark-http-error.js:48:135)
    at Forbidden.BadRequest (/opt/stackstorm/chatops/node_modules/@ciscospark/http-core/dist/http-error-subtypes.js:64:129)
    at new Forbidden (/opt/stackstorm/chatops/node_modules/@ciscospark/http-core/dist/http-error-subtypes.js:109:127)
    at HttpStatusInterceptor.onResponse (/opt/stackstorm/chatops/node_modules/@ciscospark/http-core/dist/interceptors/http-status.js:99:39)
    at /opt/stackstorm/chatops/node_modules/@ciscospark/http-core/dist/request/index.js:72:41
    at process._tickCallback (internal/process/next_tick.js:68:7)

(node:4853) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 14)
(node:4853) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

am I missing something in configuration or this is the correct behavior ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions