maubot / exec

A maubot plugin to execute code.
GNU Affero General Public License v3.0
11 stars 3 forks source link

Missing modules #3

Open BhasherBEL opened 9 months ago

BhasherBEL commented 9 months ago

Some packages seems to be missing and make this package not working on the last maubot version.

Stacktrace:

[23:19:10](file:////opt/maubot/maubot/loader/zip.py:203)ERRORmaubot.loader.zipFailed to load xyz.maubot.exec v0.1.0
[23:19:10](file:////opt/maubot/maubot/loader/zip.py:203)ERRORmaubot.loader.zipTraceback (most recent call last):
  File "/opt/maubot/maubot/loader/zip.py", line 216, in _load
    importer.load_module(module)
  File "/opt/maubot/maubot/lib/zipimport.py", line 280, in load_module
    exec(code, mod.__dict__)
  File "/data/plugins/xyz.maubot.exec-v0.1.0.mbp/exec/__init__.py", line 1, in <module>
    from .bot import ExecBot
  File "/data/plugins/xyz.maubot.exec-v0.1.0.mbp/exec/bot.py", line 29, in <module>
    from .runner import PythonRunner, ShellRunner, OutputType
  File "/data/plugins/xyz.maubot.exec-v0.1.0.mbp/exec/runner/__init__.py", line 3, in <module>
    from .python import PythonRunner
  File "/data/plugins/xyz.maubot.exec-v0.1.0.mbp/exec/runner/python.py", line 25, in <module>
    from mautrix.util.manhole import asyncify
ImportError: cannot import name 'asyncify' from 'mautrix.util.manhole' (/usr/lib/python3.11/site-packages/mautrix/util/manhole.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/maubot/maubot/loader/zip.py", line 201, in load
    return self._load(reset_cache)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/maubot/maubot/loader/zip.py", line 220, in _load
    raise MaubotZipLoadError(f"Failed to load module {module}")
maubot.loader.zip.MaubotZipLoadError: Failed to load module exec
[23:19:10](file:////opt/maubot/maubot/management/api/middleware.py:68)ERRORmaubot.serverError in handler
[23:19:10](file:////opt/maubot/maubot/management/api/middleware.py:68)ERRORmaubot.serverTraceback (most recent call last):
  File "/opt/maubot/maubot/loader/zip.py", line 216, in _load
    importer.load_module(module)
  File "/opt/maubot/maubot/lib/zipimport.py", line 280, in load_module
    exec(code, mod.__dict__)
  File "/data/plugins/xyz.maubot.exec-v0.1.0.mbp/exec/__init__.py", line 1, in <module>
    from .bot import ExecBot
  File "/data/plugins/xyz.maubot.exec-v0.1.0.mbp/exec/bot.py", line 29, in <module>
    from .runner import PythonRunner, ShellRunner, OutputType
  File "/data/plugins/xyz.maubot.exec-v0.1.0.mbp/exec/runner/__init__.py", line 3, in <module>
    from .python import PythonRunner
  File "/data/plugins/xyz.maubot.exec-v0.1.0.mbp/exec/runner/python.py", line 25, in <module>
    from mautrix.util.manhole import asyncify
ImportError: cannot import name 'asyncify' from 'mautrix.util.manhole' (/usr/lib/python3.11/site-packages/mautrix/util/manhole.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/maubot/maubot/management/api/middleware.py", line 49, in error
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/maubot/maubot/management/api/instance.py", line 85, in update_instance
    return await _update_instance(instance, data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/maubot/maubot/management/api/instance.py", line 69, in _update_instance
    await instance.update_started(data.get("started"))
  File "/opt/maubot/maubot/instance.py", line 489, in update_started
    await (self.start() if started else self.stop())
  File "/opt/maubot/maubot/instance.py", line 362, in start
    cls = await self.loader.load()
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/maubot/maubot/loader/zip.py", line 201, in load
    return self._load(reset_cache)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/maubot/maubot/loader/zip.py", line 220, in _load
    raise MaubotZipLoadError(f"Failed to load module {module}")
maubot.loader.zip.MaubotZipLoadError: Failed to load module exec
rda0 commented 6 months ago

I get a similar error when run in standalone mode:

[2024-03-12 10:53:20,263] [DEBUG@maubot.init] Loading plugin metadata from maubot.yaml
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/opt/maubot_exec/env/lib/python3.11/site-packages/maubot/standalone/__main__.py", line 123, in <module>
    bot_module = importlib.import_module(module)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/opt/maubot_exec/exec/__init__.py", line 1, in <module>
    from .bot import ExecBot
  File "/opt/maubot_exec/exec/bot.py", line 29, in <module>
    from .runner import PythonRunner, ShellRunner, OutputType
  File "/opt/maubot_exec/exec/runner/__init__.py", line 3, in <module>
    from .python import PythonRunner
  File "/opt/maubot_exec/exec/runner/python.py", line 25, in <module>
    from mautrix.util.manhole import asyncify
ImportError: cannot import name 'asyncify' from 'mautrix.util.manhole' (/opt/maubot_exec/env/lib/python3.11/site-packages/mautrix/util/manhole.py)

There are now 3 subsequent forks, which appear to fix parts of the problems with the most recent maubot version (currently 0.4.2):

YingzhouLi/exec -> j-nava/exec -> rda0/maubot-exec