simplebot-org / simplebot

Extensible Delta Chat bot written in Python3
Mozilla Public License 2.0
34 stars 9 forks source link

simplebot init fails with "AssertionError: plugin is not registered" #144

Closed sysfu closed 5 months ago

sysfu commented 9 months ago

I'm following the guide posted in the Delta Chat support forum here.

After attempting to initialize the bot it fails with the "AssertionError: plugin is not registered" traceback.

I have reproduced this issue on gentoo, guix and ubuntu systems which have the latest updates.

$ simplebot --stdlog debug init $ADDR "$PASSWORD"
2023-11-27 13:57:56,965 - simplebot - DEBUG - registering plugin 'commands'
2023-11-27 13:57:56,965 - simplebot - DEBUG - registering plugin 'filters'
2023-11-27 13:57:56,982 - simplebot - DEBUG - registering plugin 'db'
2023-11-27 13:57:56,982 - simplebot - DEBUG - registered new command '/sub'
2023-11-27 13:57:56,982 - simplebot - DEBUG - registered new command '/unsub'
2023-11-27 13:57:56,983 - simplebot - DEBUG - registered new command '/help'
2023-11-27 13:57:56,983 - simplebot - DEBUG - registered new command '/unban'
2023-11-27 13:57:56,983 - simplebot - DEBUG - registered new command '/ban'
2023-11-27 13:57:56,983 - simplebot - DEBUG - registered new command '/set'
2023-11-27 13:57:56,983 - simplebot - DEBUG - registered new command '/echo'
2023-11-27 13:57:56,983 - simplebot - DEBUG - registered new filter 'simplebot_echo.echo_filter'
2023-11-27 13:58:58,034 - simplebot - INFO - Successfully configured bot@domain.tld
Traceback (most recent call last):
  File "/home/user/.local/bin/simplebot", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/user/.local/lib/python3.11/site-packages/simplebot/main.py", line 24, in main
    parser.main_run(bot=bot, args=args)
  File "/home/user/.local/lib/python3.11/site-packages/simplebot/parser.py", line 111, in main_run
    res = args.subcommand_instance.run(**kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/lib/python3.11/site-packages/simplebot/builtin/cmdline.py", line 152, in run
    success = bot.perform_configure_address(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/lib/python3.11/site-packages/simplebot/bot.py", line 383, in perform_configure_address
    with self.account.temp_plugin(tracker) as configtracker:
  File "/usr/lib/python3.11/contextlib.py", line 144, in __exit__
    next(self.gen)
  File "/home/user/.local/lib/python3.11/site-packages/deltachat/account.py", line 671, in temp_plugin
    self._pm.unregister(plugin)
  File "/usr/lib/python3.11/site-packages/pluggy/_manager.py", line 206, in unregister
    assert name is not None, "plugin is not registered"
           ^^^^^^^^^^^^^^^^
AssertionError: plugin is not registered
ghost commented 5 months ago

Me too.

Traceback (most recent call last): File "/root/sendbot/venv/bin/simplebot", line 8, in sys.exit(main()) ^^^^^^ File "/root/sendbot/venv/lib/python3.11/site-packages/simplebot/main.py", line 24, in main parser.main_run(bot=bot, args=args) File "/root/sendbot/venv/lib/python3.11/site-packages/simplebot/parser.py", line 111, in main_run res = args.subcommand_instance.run(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/sendbot/venv/lib/python3.11/site-packages/simplebot/builtin/cmdline.py", line 152, in run success = bot.perform_configure_address( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/sendbot/venv/lib/python3.11/site-packages/simplebot/bot.py", line 383, in perform_configure_address with self.account.temp_plugin(tracker) as configtracker: File "/usr/lib/python3.11/contextlib.py", line 144, in exit next(self.gen) File "/root/sendbot/venv/lib/python3.11/site-packages/deltachat/account.py", line 671, in temp_plugin self._pm.unregister(plugin) File "/root/sendbot/venv/lib/python3.11/site-packages/pluggy/_manager.py", line 206, in unregister assert name is not None, "plugin is not registered" ^^^^^^^^^^^^^^^^ AssertionError: plugin is not registered

dillfrescott commented 5 months ago

Same

adbenitez commented 5 months ago

hello, (sorry the late reply @sysfu, @nudeldudel) I fixed the issue and released v4.1.2 to upgrade:

pip install -U simplebot

then try again and the simplebot init step will work now

note: if you are looking into creating new bots, don't use simplebot library, use this library instead: https://github.com/deltachat-bot/deltabot-cli-py, only use simplebot if your intention is to host some bot with a simplebot plugin that already exist