Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB error that breaks riven #904

Open
binGhzal opened this issue Nov 22, 2024 · 2 comments
Open

DB error that breaks riven #904

binGhzal opened this issue Nov 22, 2024 · 2 comments

Comments

@binGhzal
Copy link

binGhzal commented Nov 22, 2024

Issue Description

i keep getting this error. and everytime i need to reset the db to make riven work again.

Docker Image Type

riven:latest 20.0 with riven-frontend:latest 17.0

OS Version and Last Update

Ubuntu 24.0 LT

Error Logs and Timestamps

| ❌ ERROR     | event_manager._process_future - Traceback (most recent call last):

  File "/riven/src/program/managers/event_manager.py", line 74, in _process_future

    result = future.result()

             ^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 449, in result

    return self.__get_result()

           ^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result

    raise self._exception

  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run

    result = self.fn(*self.args, **self.kwargs)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/riven/src/program/db/db_functions.py", line 349, in run_thread_with_db_item

    program.em.add_item(item, service)

  File "/riven/src/program/managers/event_manager.py", line 312, in add_item

    if not db_functions.get_item_by_external_id(imdb_id=item.imdb_id):

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/riven/src/program/db/db_functions.py", line 72, in get_item_by_external_id

    item = _session.execute(query).unique().scalar_one_or_none()

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/app/.venv/lib/python3.11/site-packages/sqlalchemy/engine/result.py", line 1487, in scalar_one_or_none

    return self._only_one_row(

           ^^^^^^^^^^^^^^^^^^^

  File "/app/.venv/lib/python3.11/site-packages/sqlalchemy/engine/result.py", line 805, in _only_one_row

    raise exc.MultipleResultsFound(

sqlalchemy.exc.MultipleResultsFound: Multiple rows were found when one or none was required

@egreenmachine
Copy link

I am seeing this when I add multiple Plex RSS watchlists to riven. If I use only a single Plex watchlist then I am not seeing this happen.

@arao
Copy link

arao commented Dec 9, 2024

temporary solution is to get into psql and clear duplicate episode entry from MediaItem table. In my case, duplicate was on imdb_id .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants