maubot / rss

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

IntegrityError when subscribing to new feed #19

Open kumitterer opened 3 years ago

kumitterer commented 3 years ago

Hi all,

I have set up the latest v0.2.3 release on my homeserver. Now, when I try subscribing to a new feed (!rss subscribe URL), I get the following error in my log:

Traceback (most recent call last):
  File "/opt/maubot/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
    self.dialect.do_execute(
  File "/opt/maubot/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 609, in do_execute
    cursor.execute(statement, parameters)
sqlite3.IntegrityError: NOT NULL constraint failed: entry.feed_id

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/maubot/lib/python3.8/site-packages/mautrix/client/syncer.py", line 200, in _catch_errors
    await handler(data)
  File "/opt/maubot/lib/python3.8/site-packages/maubot/handlers/command.py", line 106, in __call__
    ok, res = await self.__call_subcommand__(evt, call_args, remaining_val)
  File "/opt/maubot/lib/python3.8/site-packages/maubot/handlers/command.py", line 122, in __call_subcommand__
    return True, await subcommand(evt, _existing_args=call_args,
  File "/opt/maubot/lib/python3.8/site-packages/maubot/handlers/command.py", line 114, in __call__
    return await self.__mb_func__(self.__bound_instance__, evt, **call_args)
  File "/opt/maubot/plugins/xyz.maubot.rss-v0.2.3.mbp/rss/bot.py", line 280, in subscribe
    self.db.add_entries(entries, override_feed_id=feed.id)
  File "/opt/maubot/plugins/xyz.maubot.rss-v0.2.3.mbp/rss/db.py", line 151, in add_entries
    self.db.execute(self.entry.insert(), entries)
  File "/opt/maubot/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2235, in execute
    return connection.execute(statement, *multiparams, **params)
  File "/opt/maubot/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
    return meth(self, multiparams, params)
  File "/opt/maubot/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/opt/maubot/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1124, in _execute_clauseelement
    ret = self._execute_context(
  File "/opt/maubot/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
    self._handle_dbapi_exception(
  File "/opt/maubot/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1510, in _handle_dbapi_exception
    util.raise_(
  File "/opt/maubot/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/opt/maubot/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
    self.dialect.do_execute(
  File "/opt/maubot/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 609, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) NOT NULL constraint failed: entry.feed_id
[SQL: INSERT INTO entry DEFAULT VALUES]
(Background on this error at: http://sqlalche.me/e/13/gkpj)

I can't seem to figure out why this is happening. The feed is displayed in the database's "feed" table, but the "subscription" and "entry" tables both remain empty. Any ideas?