maubot / rss

A RSS plugin for maubot
GNU Affero General Public License v3.0
69 stars 21 forks source link

After a fresh install of maubot xyz.maubot.rss no longer works #50

Closed ctsde-markus closed 1 year ago

ctsde-markus commented 1 year ago

I just installed maubot from scratch as i upgraded my env from python-3.8 to python-3.9 via pip install --upgrade maubot and got no errors there.

After firing up the fresh maubot it runs, but my one and only plugin xyz.maubot.rss no longer works.

When i try to upload the version 0.3.2 of the maubot plugin (i had 0.3.1 before) i get the following errors:

12:15:33    ERROR   maubot.loader.zip   Failed to load xyz.maubot.rss v0.3.2

Traceback (most recent call last):
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/loader/zip.py", line 216, in _load
    importer.load_module(module)
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/lib/zipimport.py", line 280, in load_module
    exec(code, mod.__dict__)
  File "/var/db/maubot/plugins/xyz.maubot.rss-v0.3.2.mbp/rss/__init__.py", line 1, in <module>
    from .bot import RSSBot
  File "<frozen zipimport>", line 259, in load_module
  File "/var/db/maubot/plugins/xyz.maubot.rss-v0.3.2.mbp/rss/bot.py", line 27, in <module>
    import feedparser
ModuleNotFoundError: No module named 'feedparser'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/loader/zip.py", line 201, in load
    return self._load(reset_cache)
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/loader/zip.py", line 220, in _load
    raise MaubotZipLoadError(f"Failed to load module {module}")
maubot.loader.zip.MaubotZipLoadError: Failed to load module rss

Error loading updated version of xyz.maubot.rss, rolling back

Traceback (most recent call last):
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/loader/zip.py", line 216, in _load
    importer.load_module(module)
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/lib/zipimport.py", line 280, in load_module
    exec(code, mod.__dict__)
  File "/var/db/maubot/plugins/xyz.maubot.rss-v0.3.2.mbp/rss/__init__.py", line 1, in <module>
    from .bot import RSSBot
  File "<frozen zipimport>", line 259, in load_module
  File "/var/db/maubot/plugins/xyz.maubot.rss-v0.3.2.mbp/rss/bot.py", line 27, in <module>
    import feedparser
ModuleNotFoundError: No module named 'feedparser'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/management/api/plugin_upload.py", line 107, in upload_replacement_plugin
    await plugin.reload(new_path=path)
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/loader/zip.py", line 244, in reload
    return await self.load(reset_cache=True)
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/loader/zip.py", line 201, in load
    return self._load(reset_cache)
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/loader/zip.py", line 220, in _load
    raise MaubotZipLoadError(f"Failed to load module {module}")
maubot.loader.zip.MaubotZipLoadError: Failed to load module rss

Failed to load xyz.maubot.rss v0.3.1

Traceback (most recent call last):
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/loader/zip.py", line 216, in _load
    importer.load_module(module)
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/lib/zipimport.py", line 280, in load_module
    exec(code, mod.__dict__)
  File "/var/db/maubot/plugins/xyz.maubot.rss-v0.3.2.mbp/rss/__init__.py", line 1, in <module>
    from .bot import RSSBot
  File "<frozen zipimport>", line 259, in load_module
  File "/var/db/maubot/plugins/xyz.maubot.rss-v0.3.2.mbp/rss/bot.py", line 27, in <module>
    import feedparser
ModuleNotFoundError: No module named 'feedparser'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/management/api/plugin_upload.py", line 107, in upload_replacement_plugin
    await plugin.reload(new_path=path)
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/loader/zip.py", line 244, in reload
    return await self.load(reset_cache=True)
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/loader/zip.py", line 201, in load
    return self._load(reset_cache)
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/loader/zip.py", line 220, in _load
    raise MaubotZipLoadError(f"Failed to load module {module}")
maubot.loader.zip.MaubotZipLoadError: Failed to load module rss

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/loader/zip.py", line 216, in _load
    importer.load_module(module)
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/lib/zipimport.py", line 280, in load_module
    exec(code, mod.__dict__)
  File "/var/db/maubot/plugins/xyz.maubot.rss-v0.3.1.mbp/rss/__init__.py", line 1, in <module>
    from .bot import RSSBot
  File "<frozen zipimport>", line 259, in load_module
  File "/var/db/maubot/plugins/xyz.maubot.rss-v0.3.1.mbp/rss/bot.py", line 27, in <module>
    import feedparser
ModuleNotFoundError: No module named 'feedparser'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/loader/zip.py", line 201, in load
    return self._load(reset_cache)
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/loader/zip.py", line 220, in _load
    raise MaubotZipLoadError(f"Failed to load module {module}")
maubot.loader.zip.MaubotZipLoadError: Failed to load module rss

Failed to roll back update of xyz.maubot.rss

Traceback (most recent call last):
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/loader/zip.py", line 216, in _load
    importer.load_module(module)
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/lib/zipimport.py", line 280, in load_module
    exec(code, mod.__dict__)
  File "/var/db/maubot/plugins/xyz.maubot.rss-v0.3.2.mbp/rss/__init__.py", line 1, in <module>
    from .bot import RSSBot
  File "<frozen zipimport>", line 259, in load_module
  File "/var/db/maubot/plugins/xyz.maubot.rss-v0.3.2.mbp/rss/bot.py", line 27, in <module>
    import feedparser
ModuleNotFoundError: No module named 'feedparser'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/management/api/plugin_upload.py", line 107, in upload_replacement_plugin
    await plugin.reload(new_path=path)
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/loader/zip.py", line 244, in reload
    return await self.load(reset_cache=True)
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/loader/zip.py", line 201, in load
    return self._load(reset_cache)
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/loader/zip.py", line 220, in _load
    raise MaubotZipLoadError(f"Failed to load module {module}")
maubot.loader.zip.MaubotZipLoadError: Failed to load module rss

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/loader/zip.py", line 216, in _load
    importer.load_module(module)
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/lib/zipimport.py", line 280, in load_module
    exec(code, mod.__dict__)
  File "/var/db/maubot/plugins/xyz.maubot.rss-v0.3.1.mbp/rss/__init__.py", line 1, in <module>
    from .bot import RSSBot
  File "<frozen zipimport>", line 259, in load_module
  File "/var/db/maubot/plugins/xyz.maubot.rss-v0.3.1.mbp/rss/bot.py", line 27, in <module>
    import feedparser
ModuleNotFoundError: No module named 'feedparser'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/management/api/plugin_upload.py", line 111, in upload_replacement_plugin
    await plugin.reload(new_path=old_path)
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/loader/zip.py", line 244, in reload
    return await self.load(reset_cache=True)
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/loader/zip.py", line 201, in load
    return self._load(reset_cache)
  File "/home/maubot/maubot-env/lib/python3.9/site-packages/maubot/loader/zip.py", line 220, in _load
    raise MaubotZipLoadError(f"Failed to load module {module}")
maubot.loader.zip.MaubotZipLoadError: Failed to load module rss

Any chance i can recover from this?

Thanks Max

tulir commented 1 year ago

Remember to install dependencies for the plugin, that doesn't happen automatically yet

ctsde-markus commented 1 year ago

Then i would like to file a documentation bug ;-)

I assume it is pip install feedparser in my env? (I'm not a python dev, you know)

Edit: It still lacks olm but i can't install that because:

Collecting jsmin==2.2.2 (from olm)
  Downloading jsmin-2.2.2.tar.gz (12 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  ? Getting requirements to build wheel did not run successfully.
  ? exit code: 1
  ??> [1 lines of output]
      error in jsmin setup command: use_2to3 is invalid.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

? Getting requirements to build wheel did not run successfully.
? exit code: 1
??> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Very frustrating experience overall...

Re-Edit:

Even after trying "workarounds" i found somewhere, stating that i only have to use an older version of setuptools, this error keeps popping up. Since olm insists on jsmin-2.2.2 i can't use this anymore. I don't know how you managed to install it, but it would be nice if there were some hints on how to install this plugin for admins without python dev experience like me.