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

Microsoft teams connector looking for endpoints that exists in MongoDB #1868

Open
bparbhu opened this issue Nov 18, 2021 · 4 comments
Open

Comments

@bparbhu
Copy link

bparbhu commented Nov 18, 2021

Hi all,

So I'm getting an error when using MongoDB in conjunction with the Microsoft Teams connector and trying to deploy
to docker swarm.
It errors out because when looking for teams service endpoints it can't find any in my MongoDB.

The message is

2021-11-17 21:10:26,016 INFO opsdroid.logging.configure_logging(): ========================================
2021-11-17 21:10:26,016 INFO opsdroid.logging.configure_logging(): Started opsdroid v0.24.1+7.g79e1469.
2021-11-17 21:10:26,016 INFO opsdroid.welcome_message(): ========================================
2021-11-17 21:10:26,016 INFO opsdroid.welcome_message(): You can customise your opsdroid by modifying your configuration.yaml.
2021-11-17 21:10:26,016 INFO opsdroid.welcome_message(): Read more at: http://opsdroid.readthedocs.io/#configuration
2021-11-17 21:10:26,016 INFO opsdroid.welcome_message(): Watch the Get Started Videos at: http://bit.ly/2fnC0Fh
2021-11-17 21:10:26,016 INFO opsdroid.welcome_message(): Install Opsdroid Desktop at:
https://github.com/opsdroid/opsdroid-desktop/releases
2021-11-17 21:10:26,016 INFO opsdroid.welcome_message(): ========================================
2021-11-17 21:10:26,017 DEBUG asyncio.__init__(): Using selector: EpollSelector
2021-11-17 21:10:26,018 DEBUG opsdroid.loader.__init__(): Loaded loader.
2021-11-17 21:10:26,018 DEBUG opsdroid.loader.load_modules_from_config(): Loading modules from config...
2021-11-17 21:10:26,018 DEBUG opsdroid.loader._load_modules(): Loading database modules...
2021-11-17 21:10:26,102 DEBUG opsdroid.loader.import_module(): Loaded database: opsdroid.database.mongo.
2021-11-17 21:10:26,102 DEBUG opsdroid.loader._load_modules(): Loading parsers modules...
2021-11-17 21:10:26,103 DEBUG opsdroid.loader.import_module(): Loaded parsers: opsdroid.parsers.rasanlu.
2021-11-17 21:10:26,104 DEBUG opsdroid.loader.import_module(): Loaded parsers: opsdroid.parsers.regex.
2021-11-17 21:10:26,104 DEBUG opsdroid.loader._load_modules(): Loading skill modules...
2021-11-17 21:10:26,104 DEBUG opsdroid.loader.check_cache(): 'no-cache' set, removing /home/opsdroid/opsdroid_modules/skill/MySkill.
2021-11-17 21:10:26,104 DEBUG opsdroid.loader._install_module(): Installing MySkill...
2021-11-17 21:10:26,105 DEBUG opsdroid.loader._install_module(): Installed MySkill to /home/opsdroid/opsdroid_modules/skill/MySkill.
2021-11-17 21:10:26,105 DEBUG opsdroid.loader._install_module_dependencies(): Couldn't find the file requirements.txt, skipping.
2021-11-17 21:10:26,114 DEBUG opsdroid.loader.import_module(): Loaded skill: opsdroid_modules.skill.MySkill.
2021-11-17 21:10:26,114 DEBUG opsdroid.loader._load_modules(): Loading connector modules...
2021-11-17 21:10:26,241 DEBUG opsdroid.loader.import_module(): Loaded connector: opsdroid.connector.teams.
2021-11-17 21:10:26,241 DEBUG opsdroid.core.load(): Loaded 1 skills.
2021-11-17 21:10:26,243 DEBUG opsdroid.core.setup_databases(): Adding database: DatabaseMongo.
2021-11-17 21:10:26,243 DEBUG opsdroid.database.mongo.__init__(): Loaded mongo database connector.
2021-11-17 21:10:26,243 INFO opsdroid.core.run(): Opsdroid is now running, press ctrl+c to exit.
2021-11-17 21:10:26,271 INFO opsdroid.database.mongo.connect(): Connected to MongoDB.
2021-11-17 21:10:26,271 DEBUG opsdroid.memory.get(): Getting teams_service_endpoints from memory.
2021-11-17 21:10:26,271 DEBUG opsdroid.database.mongo.get(): Getting teams_service_endpoints from MongoDB collection opsdroid
2021-11-17 21:10:26,324 DEBUG asyncio.__init__(): Using selector: EpollSelector
Traceback (most recent call last):
  File "/usr/local/bin/opsdroid", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/opsdroid/cli/start.py", line 43, in start
    opsdroid.run()
  File "/usr/local/lib/python3.9/site-packages/opsdroid/core.py", line 172, in run
    self.eventloop.run_until_complete(self.start())
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.9/site-packages/opsdroid/core.py", line 188, in start
    await self.start_connectors()
  File "/usr/local/lib/python3.9/site-packages/opsdroid/core.py", line 384, in start_connectors
    await asyncio.gather(*[connector.connect() for connector in self.connectors])
  File "/usr/local/lib/python3.9/site-packages/opsdroid/connector/teams/teams.py", line 47, in connect
    await self.opsdroid.memory.get("teams_service_endpoints") or {}
  File "/usr/local/lib/python3.9/site-packages/opsdroid/memory.py", line 37, in get
    result = await self._get_from_database(key)
  File "/usr/local/lib/python3.9/site-packages/opsdroid/memory.py", line 86, in _get_from_database
    results.append(await database.get(key))
  File "/usr/local/lib/python3.9/site-packages/opsdroid/database/mongo/__init__.py", line 93, in get
    if response.keys() == {"_id", "key", "value"}:
AttributeError: 'NoneType' object has no attribute 'keys'

I'm not sure what teams is expecting to find there as it's a database setup for the chatbot and is only used for persisting chats.

Thanks again and much appreciated,

-Brian

@bparbhu
Copy link
Author

bparbhu commented Dec 17, 2021

Hey All,

Just wanted to follow up and see if you guys need anything more from me on my end to look at this.
Also, I'd be willing to help out as well.

Thanks,

-Brian

@FabioRosado
Copy link
Member

Hello @bparbhu can you do me a favor and test running Teams with a different database? Perhaps the sqlite and confirm if you see the same error?

I'm trying to diagnose this and that would help 👍

@bparbhu
Copy link
Author

bparbhu commented Jan 5, 2022

I'll try again with the teams connector but we have moved on to using the WebEx teams connector. It works well with MongoDB Atlas databases and I haven't run into database issues with that setup yet. I'll retry using teams with SQLite once we get our opsdroid rasa swarm up and running.

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 16, 2022
@cognifloyd cognifloyd removed the stale label Apr 17, 2022
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

3 participants