Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Backend import broken with #1669 #1732

@zaughon

Description

@zaughon

Describe the bug
Since #1669 starting errbot with e.g. Slackv3 backend causes it to crash because the backend is not found.

To Reproduce
requirements-working.txt:

# https://github.com/errbotio/errbot/commit/db0973e5e0ccb48b1e88eca70c3d742ef1f5bfa2
errbot @ git+https://github.com/errbotio/errbot.git@db0973e5e0ccb48b1e88eca70c3d742ef1f5bfa2
errbot-backend-slackv3

Modify config.py to connect Slack, then run:

$ mktmpenv
# CD to where you want/have the config and requirements file
$ pip3 install -r requirements-working.txt
$ errbot
11:46:28 INFO     errbot.bootstrap          Found Storage plugin: Shelf.
11:46:28 INFO     errbot.bootstrap          Found Backend plugin: SlackV3
11:46:28 INFO     errbot                    webhooks: Flag to bind /echo to echo
11:46:28 INFO     errbot.backends.slackv3   Verifying authentication token
11:46:28 INFO     errbot.backends.slackv3   Token accepted
11:46:29 INFO     errbot.backends.slackv3   Using Events API - Socket mode client.
11:46:29 INFO     slack_sdk.socket_mode.bui A new session has been established (session id: 3bc4ad49-0c0f-445f-875a-42c4f788a4cc)
11:46:29 INFO     slack_sdk.socket_mode.bui Starting to receive messages from a new connection (session id: 3bc4ad49-0c0f-445f-875a-42c4f788a4cc)
11:46:29 INFO     errbot.core               Activate internal commands
11:46:29 INFO     errbot.plugin_manager     Activate bot plugins...

Bot mostly starts. Currently mine is failing with
Error: Utils failed to activate: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 134341799967680 and this is thread id 134340098901696.. but that might be a slight misconfiguration in my setup. I seem to remember getting it before, fixed it, and i don't remember how..

Anyway, the point is, it finds the SlackV3 plugin and continues startup, unlike:

requirements-broken.txt:

# https://github.com/errbotio/errbot/commit/363f01f8ad96f2930c2032bfd9c967ece20d0e99
errbot @ git+https://github.com/errbotio/errbot.git@363f01f8ad96f2930c2032bfd9c967ece20d0e99
errbot-backend-slackv3
$ mktmpenv
# CD to where you want/have the config and requirements file
$ pip3 install -r requirements-broken.txt
$ errbot
11:49:13 INFO     errbot.bootstrap          Found Storage plugin: Shelf.
Traceback (most recent call last):
  File "/home/maf/dev/python/.envs/tmp-2be91a2dcec67c3/bin/errbot", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/home/maf/dev/python/.envs/tmp-2be91a2dcec67c3/lib/python3.13/site-packages/errbot/cli.py", line 398, in main
    bootstrap(backend, root_logger, config, restore)
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/maf/dev/python/.envs/tmp-2be91a2dcec67c3/lib/python3.13/site-packages/errbot/bootstrap.py", line 270, in bootstrap
    bot = setup_bot(bot_class, logger, config, restore)
  File "/home/maf/dev/python/.envs/tmp-2be91a2dcec67c3/lib/python3.13/site-packages/errbot/bootstrap.py", line 177, in setup_bot
    backendpm = BackendPluginManager(
        config, "errbot.backends", backend_name, ErrBot, CORE_BACKENDS, extra_backend
    )
  File "/home/maf/dev/python/.envs/tmp-2be91a2dcec67c3/lib/python3.13/site-packages/errbot/backend_plugin_manager.py", line 54, in __init__
    raise PluginNotFoundException(
        f"Could not find the plugin named {plugin_name} in {all_plugins_paths}."
    )
errbot.backend_plugin_manager.PluginNotFoundException: Could not find the plugin named SlackV3 in ['/home/maf/dev/python/.envs/tmp-2be91a2dcec67c3/lib/python3.13/site-packages/errbot/backends'].

config.py:

import logging

BACKEND = "SlackV3"

BOT_DATA_DIR = r"/home/maf/dev/python/errbot-1669-bug/data"
BOT_EXTRA_PLUGIN_DIR = r"/home/maf/dev/python/errbot-1669-bug/plugins"
BOT_EXTRA_BACKEND_DIR = r"/home/maf/dev/python/errbot-1669-bug/backend-plugins"

BOT_LOG_FILE = r"/home/maf/dev/python/errbot-1669-bug/errbot.log"
BOT_LOG_LEVEL = logging.INFO

BOT_ADMINS = (
    "<@U....>",
)

BOT_IDENTITY = {
    'token': "xoxb-...",
    'app_token': "xapp-1-...",
}

STORAGE = "Shelf"

Expected behavior
Bot starts

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • Errbot version: Master branch (specific commits listed above)
  • OS version: Arch
  • Python version: 3.13.3
  • Using a virtual environment: yes
  • Using Docker: no

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions