maubot / rss

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

subsribe rss feed, I get sqlite3.OperationalError #32

Closed ampcpmgp closed 2 years ago

ampcpmgp commented 2 years ago

Send the following chat command to

!rss subscribe http://www.publickey1.jp/atom.xml

Received the following error

Failed to run handler
Traceback (most recent call last):
  File "/home/am/tmp/maubot-py/lib/python3.8/site-packages/mautrix/client/syncer.py", line 229, in _catch_errors
    await handler(data)
  File "/home/am/tmp/maubot-py/lib/python3.8/site-packages/maubot/handlers/command.py", line 141, in __call__
    ok, res = await self.__call_subcommand__(evt, call_args, remaining_val)
  File "/home/am/tmp/maubot-py/lib/python3.8/site-packages/maubot/handlers/command.py", line 162, in __call_subcommand__
    return True, await subcommand(
  File "/home/am/tmp/maubot-py/lib/python3.8/site-packages/maubot/handlers/command.py", line 153, in __call__
    return await self.__mb_func__(self.__bound_instance__, evt, **call_args)
  File "/home/am/tmp/maubot-py/plugins/xyz.maubot.rss-v0.3.0.mbp/rss/bot.py", line 350, in subscribe
    feed = await self.dbm.create_feed(info)
  File "/home/am/tmp/maubot-py/plugins/xyz.maubot.rss-v0.3.0.mbp/rss/db.py", line 185, in create_feed
    info.id = await self.db.fetchval(
  File "/home/am/tmp/maubot-py/lib/python3.8/site-packages/mautrix/util/async_db/database.py", line 150, in fetchval
    return await conn.fetchval(query, *args, column=column, timeout=timeout)
  File "/home/am/tmp/maubot-py/lib/python3.8/site-packages/mautrix/util/async_db/connection.py", line 37, in wrapper
    ret = await func(self, arg, *args, **kwargs)
  File "/home/am/tmp/maubot-py/lib/python3.8/site-packages/mautrix/util/async_db/connection.py", line 89, in fetchval
    return await self.wrapped.fetchval(query, *args, column=column, timeout=timeout)
  File "/home/am/tmp/maubot-py/lib/python3.8/site-packages/mautrix/util/async_db/aiosqlite.py", line 76, in fetchval
    row = await self.fetchrow(query, *args)
  File "/home/am/tmp/maubot-py/lib/python3.8/site-packages/mautrix/util/async_db/aiosqlite.py", line 70, in fetchrow
    async with self.__execute(query, *args) as cursor:
  File "/home/am/tmp/maubot-py/lib/python3.8/site-packages/aiosqlite/context.py", line 41, in __aenter__
    self._obj = await self._coro
  File "/home/am/tmp/maubot-py/lib/python3.8/site-packages/aiosqlite/core.py", line 184, in execute
    cursor = await self._execute(self._conn.execute, sql, parameters)
  File "/home/am/tmp/maubot-py/lib/python3.8/site-packages/aiosqlite/core.py", line 129, in _execute
    return await future
  File "/home/am/tmp/maubot-py/lib/python3.8/site-packages/aiosqlite/core.py", line 102, in run
    result = function()
sqlite3.OperationalError: near "RETURNING": syntax error

How do I resolve this?

tulir commented 2 years ago

Update to the latest version of the plugin (on the master branch) or update sqlite (or use postgres)

ampcpmgp commented 2 years ago

I used the latest plugin and got the following error,

zipimport.ZipImportError: bad local file header: '/home/am/tmp/maubot-py/plugins/xyz.maubot.rss-v0.3.0.mbp'

but it was resolved by issue. https://github.com/maubot/maubot/issues/96