webex_bot icon indicating copy to clipboard operation
webex_bot copied to clipboard

Commands not being received

Open SandroMarques46 opened this issue 2 years ago • 30 comments

  • Webex Bot version: 0.4.1
  • Python version: 3.8.2 / 3.11.7 (tested with both)
  • Operating System: Windows 10 Pro 64 bit (Version 22H2)

Description

I'm trying to do a simple bot following the README.md instructions but I cannot see any commands received

I'm messaging the bot directly (used the bot email to find it on webex)

What I Did

I've tried using the same exact code as it's on the README.md. I've found this issue #12 , maybe it's because i'm messaging the bot from a gmail account? I don't have a cisco account to test it with.

Tried to remove the "approved_..." parameters or add my email to the "approved_users" and the behaviour is always the same.

Log file

image

Steps to reproduce:

  • Install python 3.8.2 or 3.11.7
  • Follow all the steps from README (pip install webex_bot and env variable creation)
  • Messaged the bot with my [email protected] email address = No response

SandroMarques46 avatar Jan 27 '24 16:01 SandroMarques46

Strange. Can you post a screenshot of the page that shows the bot info? Are you behind a proxy?

fbradyirl avatar Jan 27 '24 16:01 fbradyirl

I'm not behind a proxy, i'm using my personal computer with home wifi. I've created two 2 bots (same webex developer account) and both of them had the same problem.

Is this the page you're looking for?

image

SandroMarques46 avatar Jan 27 '24 17:01 SandroMarques46

It probably won't help but i've used this webex bot starter template with Ngrok and it worked fine

SandroMarques46 avatar Jan 27 '24 17:01 SandroMarques46

I tried myself with a new bot I created today and new token and it works fine for me. Hard to know what exactly is going on unless you want to reach out to me with your token and I can try it myself locally.

fbradyirl avatar Jan 31 '24 14:01 fbradyirl

Just tried with my secondary gmail account and also tried with a brand new one. Nothing's happening :( . Where can I reach out to you?

SandroMarques46 avatar Jan 31 '24 20:01 SandroMarques46

Im currently running into the same issue too

Afaz-Dev avatar Feb 01 '24 04:02 Afaz-Dev

It is not working for me either. I have tried the following as well:

  • Enabled debugging on the websocket. I can see PING/PONGs and keep-alive connections but no messages are received.
  • Specified my Webex account email address in approved_users to make sure there are no issues regarding users/rooms approved.
  • Made sure I am not behind a proxy, CG-NAT or similar.

gerivives avatar Feb 01 '24 12:02 gerivives

Please post a bot token and username (bot email) here and I can try. (you can always revoke the token later)

fbradyirl avatar Feb 01 '24 12:02 fbradyirl

Please post a bot token and username (bot email) here and I can try. (you can always revoke the token later)

Sure! Here are the details @fbradyirl: [email protected] and <redacted>

gerivives avatar Feb 01 '24 13:02 gerivives

Thanks Gerard,

It is working totally fine for me with your bot. Perhaps there is something on your network blocking web socket traffic?

image

fbradyirl avatar Feb 01 '24 15:02 fbradyirl

import logging
import os

from webex_bot.webex_bot import WebexBot
from webexteamssdk import WebexTeamsAPI
log = logging.getLogger(__name__)

access_token = os.getenv("WEBEX_TEAMS_ACCESS_TOKEN")

# Create a Bot Object
bot = WebexBot(teams_bot_token=access_token,
               include_demo_commands=True)

webex_api = WebexTeamsAPI(access_token=access_token)

bot.run()

This was the code I ran with.

fbradyirl avatar Feb 01 '24 15:02 fbradyirl

Perhaps open this page: https://websocketstest.com

fbradyirl avatar Feb 01 '24 15:02 fbradyirl

Also if you have a possibility to try your laptop on a different network to see if that helps. E.g. tether over 5G instead of your home wifi for example. That might rule out carrier level blocking of certain types of protocols.

fbradyirl avatar Feb 01 '24 15:02 fbradyirl

Hello, I've tried :

  • Ethernet cable to home router (Desktop PC)
  • Wi-fi to home router (Laptop)
  • Wi-fi on my workplace with/without VPN connection (Laptop)

All of them show this page image

Let's try to debug python version then... 😅 . I've uninstalled everything I've had from python (via control panel + window apps), restarted my PC and installed 3.9.0 as it's suggested on README https://www.python.org/downloads/release/python-390/ image

Ran the command "pip install webex_bot" and then the .py file. Any other suggestion?

SandroMarques46 avatar Feb 02 '24 11:02 SandroMarques46

It is not working for me either.

May you guys confirm if the account you are using in Webex is from a Cisco Domain?

I am wondering if the fact of being "external" has any kind of impact on the resources we are able to work with. (e.g. if just someone logged in Webex with @cisco.com or any kind of "approved" accounts scheme are able to use these bots)

SinonCuriosus avatar Feb 13 '24 18:02 SinonCuriosus

I am wondering if the fact of being "external" has any kind of impact on the resources we are able to work with.

I just tested with a gmail account I have, logged in as that gmail Webex user and was able to send and receive messages to my bot no problem, so seems it is not a Cisco account issue.

fbradyirl avatar Feb 14 '24 16:02 fbradyirl

If you can provide me with the email address used and the time you are attempting the send (UTC) I can see if I can find anything out on this.

fbradyirl avatar Feb 14 '24 16:02 fbradyirl

@fbradyirl I have just met with a colleague who works at Cisco. We set up the bot on my PC with the code example you porivded and we are seeing the messages he sends from his account on the logs, but not mine. I have tried @gmail.com accounts, as well as registering with the account from my University.

In case you want to investigate further I am sharing you some more details:

  • Tested from 14:50 to 15:15 UTC.
  • Bot is [email protected]
  • Messages sent from @cisc.com and @gmail.com accounts

Thanks, Gerard

gerivives avatar Feb 22 '24 15:02 gerivives

Seems to be affecting self signup users only.

fbradyirl avatar Feb 22 '24 15:02 fbradyirl

I managed to get it working through Sandro's suggestion, using Ngrok. It would have saved me some hours having to know that the issue was "affecting self signup users only". Thanks for the troubleshooting.

SinonCuriosus avatar Feb 22 '24 16:02 SinonCuriosus

We are testing it now and it turns out it is not self signup users. Starting to narrow it down but it may be todo with the Python version or dependant module.

fbradyirl avatar Feb 22 '24 16:02 fbradyirl

Still investigating...

fbradyirl avatar Feb 22 '24 16:02 fbradyirl

I was testing with Gerard's GMail account logged into the WebEx web client and was able to send messages fine to my bot running locally with Python 3.11.7. However when he tries the same it is not working.

Here are my module versions:

image

image

It is certainly baffling at this point.

fbradyirl avatar Feb 23 '24 03:02 fbradyirl

There may be something here I can try and push a new release.

https://github.com/fbradyirl/webex_bot/issues/41#issuecomment-1890586876

fbradyirl avatar Feb 23 '24 03:02 fbradyirl

Hi, I'm experiencing the same issue as mentioned above. I've tested with different (personal) developer webex accounts (Registered the bot app and run as bot within that webex account(s)). However, when using my company webex account (Cisco partner) with associated bot it works fine. I can see messages in log from company webex account and personal developer account as well. For both use cases, the same bot app was setup and the same internet/cloud access was established.

Added notification stuff from #41 to DEVICE_DATA. Unfortunately I still cannot see any commands received.

Maybe it's related to the free developer account with some restrictions for associated bots.

doppelmalz avatar Feb 23 '24 14:02 doppelmalz

@doppelmalz Same here. That's a good find.

Hi, I'm experiencing the same issue as mentioned above. I've tested with different (personal) developer webex accounts (Registered the bot app and run as bot within that webex account(s)). However, when using my company webex account (Cisco partner) with associated bot it works fine. I can see messages in log from company webex account and personal developer account as well. For both use cases, the same bot app was setup and the same internet/cloud access was established.

Added notification stuff from #41 to DEVICE_DATA. Unfortunately I still cannot see any commands received.

Maybe it's related to the free developer account with some restrictions for associated bots.

venkatesh-hs avatar Mar 11 '24 16:03 venkatesh-hs

@venkatesh-hs The interesting thing is that the websocket flavor of the webex javascript framework (see https://github.com/WebexCommunity/webex-node-bot-framework/blob/main/docs/example3.md) works great with the free developer account. The implementation of the websocket connection or/and how the server side handles the connection in javascript seems to be different from python with regards to the free developer account.

Nevertheless I would prefer the python way.

doppelmalz avatar Mar 11 '24 21:03 doppelmalz

@venkatesh-hs The interesting thing is that the websocket flavor of the webex javascript framework (see https://github.com/WebexCommunity/webex-node-bot-framework/blob/main/docs/example3.md) works great with the free developer account. The implementation of the websocket connection or/and how the server side handles the connection in javascript seems to be different from python with regards to the free developer account.

Nevertheless I would prefer the python way.

If possible, could you sniff the registration part of the JS library and provide the headers and body of the request to WDM. I can compare.

fbradyirl avatar Mar 12 '24 14:03 fbradyirl

I'm not familiar with javascript. But enabling debug for webex-node-bot-framework and trace for webex-js-sdk provides the following output. Not sure if it helps.

webex-node-bot.log

EDIT: Put some logger statements (Keyword DEBUG) in the proper .js files (device registering and websocket connection) webex-node-bot_2.log

Thanks.

doppelmalz avatar Mar 14 '24 21:03 doppelmalz

I also do not receive anything with my customer account. Ran the bot on corporate and personal devices, seeing identical results. Would love to use this project. Any findings from the logs so far @fbradyirl ?

Edit: With further testing, I have no luck with three different paid users from different orgs. Nevertheless, a consultant from Cisco tested the bot for me and had success right away. That is, same bot, same code and same machine as well.

devil33 avatar Apr 08 '24 15:04 devil33