pymedusa / Medusa

Automatic Video Library Manager for TV Shows. It watches for new episodes of your favorite shows, and when they are posted it does its magic.
https://pymedusa.com
GNU General Public License v3.0
1.8k stars 276 forks source link

[APP SUBMITTED]: dbm.error: need 'c' or 'n' flag to open new db #7266

Closed noodle- closed 5 years ago

noodle- commented 5 years ago

INFO

Python Version: 3.7.4 (default, Aug 13 2019, 23:40:39) [GCC 6.3.0 20170516] Operating System: Linux-3.4.113-bananian-armv7l-with-debian-9.9 Locale: UTF-8 Branch: master Database: 44.14 Commit: pymedusa/Medusa@baad1e5af59d7f29606c1fed1c110af1424bb117 Link to Log: https://gist.github.com/64768892b3c24cb659a7ee3f92714c34

ERROR

2019-10-19 12:14:59 ERROR    Thread_2 :: [baad1e5] Exception generated: need 'c' or 'n' flag to open new db
Traceback (most recent call last):
  File "/opt/medusa/medusa/server/web/core/base.py", line 251, in async_call
    result = function(**kwargs)
  File "/opt/medusa/medusa/server/web/home/handler.py", line 1980, in fetch_releasegroups
    groups = get_release_groups_for_anime(series_name)
  File "", line 2, in get_release_groups_for_anime
  File "/opt/medusa/ext/dogpile/cache/region.py", line 1272, in get_or_create_for_user_func
    should_cache_fn, (arg, kw))
  File "/opt/medusa/ext/dogpile/cache/region.py", line 879, in get_or_create
    async_creator) as value:
  File "/opt/medusa/ext/dogpile/lock.py", line 186, in __enter__
    return self._enter()
  File "/opt/medusa/ext/dogpile/lock.py", line 86, in _enter
    value = value_fn()
  File "/opt/medusa/ext/dogpile/cache/region.py", line 826, in get_value
    value = self.backend.get(key)
  File "/opt/medusa/ext/dogpile/cache/backends/file.py", line 220, in get
    with self._dbm_file(False) as dbm:
  File "/usr/local/lib/python3.7/contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "/opt/medusa/ext/dogpile/cache/backends/file.py", line 215, in _dbm_file
    "w" if write else "r")
  File "/usr/local/lib/python3.7/dbm/__init__.py", line 85, in open
    raise error[0]("need 'c' or 'n' flag to open new db")
dbm.error: need 'c' or 'n' flag to open new db

STAFF NOTIFIED: @pymedusa/support @pymedusa/moderators

noodle- commented 5 years ago

I've had this error for quite a while now. It mostly shows up when trying to add new shows, or when trying to edit existing anime shows.

If you need any additional information let me know!

If I remember correctly it started showing up when switching to Python 3.X which was/is quite a mess on Debian..

medariox commented 5 years ago

Delete the files named anidb.* in your cache folder and restart Medusa.

noodle- commented 5 years ago

This seems to have fixed being able to load anime release groups when adding a new anime show. I'll keep an eye on it occuring again, but I'll mark this issue as fixed for now!

Could you explain how and why this solved the problem?