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

No module named _bsddb #4971

Closed
eximo84 opened this issue Aug 26, 2018 · 21 comments · Fixed by #5163
Closed

No module named _bsddb #4971

eximo84 opened this issue Aug 26, 2018 · 21 comments · Fixed by #5163
Assignees
Labels

Comments

@eximo84
Copy link

eximo84 commented Aug 26, 2018

Describe the bug
Adding recommended shows using Trakt or IMDB list i get an exception No module named _bsddb

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Shows"
  2. Click on '.Add Recommended Shows'
  3. Click on 'Add from Trakt List'
  4. See error

Expected behavior
Trakt or IMDB list to show a list of shows

Screenshots
If applicable, add screenshots to help explain your problem.

Medusa (please complete the following information):

  • OS: Docker
  • Branch: Master
  • Commit: f5973b2

Logs:

<-- Please replace this whole line with your logs -->

Additional context
Add any other context about the problem here.

@triage-new-issues triage-new-issues bot added the triage Untriaged issue label Aug 26, 2018
@medariox
Copy link
Contributor

Which Docker image are you using?

@eximo84
Copy link
Author

eximo84 commented Aug 26, 2018

@p0psicles
Copy link
Contributor

p0psicles commented Sep 7, 2018

#5131
#3976

@medariox
Copy link
Contributor

medariox commented Sep 7, 2018

I'd like to see a full debug with the error if possible.

@sharkykh
Copy link
Contributor

sharkykh commented Sep 7, 2018

@medariox Take a look at either of the issues @p0psicles linked as duplicates, they all share the same error.


Python issue report:
https://bugs.python.org/issue2329
(Yes, Python 2.4, I know)

I think what this means is,
the availability of bsddb (which is, by-the-way, removed in Python 3) is directly affected by the availability of the Berkeley DB linux library when Python is compiled from source (when installing Python)...

@sharkykh
Copy link
Contributor

sharkykh commented Sep 7, 2018

More relevant info in this file:
https://github.com/python/cpython/blob/2.7/setup.py
Keywords to look for: Berkeley & bsddb.
From what I could gather, looks like some linux distributions simply don't have it installed.
It makes sense alpine excluded that (which affects the dockers), and I wouldn't be surprised if Synology left it out of their distribution.

@p0psicles
Copy link
Contributor

@sharkykh where did you see it's removed in python 3?
Also it's used by dogpile. So that would mean that dogpile would not work with python 3?

@sharkykh
Copy link
Contributor

sharkykh commented Sep 7, 2018

  1. https://docs.python.org/2/library/bsddb.html
  2. Might have to remove cache when upgrading existing installations to py3, but it should still work.

@p0psicles
Copy link
Contributor

p0psicles commented Sep 7, 2018

https://www.jcea.es/programacion/pybsddb.htm

Python 3.x doesn't include native Berkeley DB support, you need to install this library by your own.

@sharkykh
Copy link
Contributor

sharkykh commented Sep 7, 2018

Correct. That refers to https://pypi.org/project/bsddb3/. I haven't tested that though.

@medariox It's possible you're right about that then, because bsddb3 includes the C files.

image

@p0psicles
Copy link
Contributor

p0psicles commented Sep 7, 2018

hmm, I don't get this. It's allot of work to add bsddb3 your self. You'll have to add all kinds of whl links, for the compiled libraries.

I also think we even are not using bsddb. It's just imported.

@p0psicles
Copy link
Contributor

p0psicles commented Sep 7, 2018

Python3 uses: https://pymotw.com/3/dbm/
As apposed to python2: anydbm

        # TODO: make this configurable
        if compat.py3k:
            import dbm
        else:
            import anydbm as dbm

@sharkykh
Copy link
Contributor

sharkykh commented Sep 7, 2018

I also think we even are not using bsddb. It's just imported.

Dogpile does. We're using the file backend which is where you took the code in the comment above from.
So we are:

C:\Medusa\Data\cache>  python -c "import whichdb; print whichdb.whichdb('application.dbm')"
dbhash

dbhash imports and uses bsddb

I'm not an expert on this, but this does seem to be a missing dependency on Docker images..

@p0psicles
Copy link
Contributor

dogpile uses dumbdbm on python3. As on python3 dbm falls back to dumbdbm. I read there are allot of issues whith that.

@sharkykh
Copy link
Contributor

sharkykh commented Sep 7, 2018

@eximo84
Can you please try shutting down Medusa and simply removing the files in /config/cache?
(Then start Medusa and try to list recommended shows)

@udochrist
Copy link

Tested that. Seems to do the trick.

@sharkykh
Copy link
Contributor

sharkykh commented Sep 7, 2018

@udochrist Thank you.
Please do let us know if the error pops back up.

But hopefully it was just what I thought,
which is that the database was using a DB library that was no longer available for one reason or another (system package update? docker update? who knows, really), and it just needed a cache reset to start a new database using a different DB library.

@triage-new-issues triage-new-issues bot removed the triage Untriaged issue label Sep 7, 2018
@udochrist
Copy link

udochrist commented Sep 7, 2018

Dont know if its related:

when i now click on a show to see the eps medusa freezes. theres nothing in the application log. The docker log however shows

2018-09-07 18:16:29 | stderr | UnicodeDecodeError: 'utf8' codec can't decode byte 0x9c in position 3: invalid start byte
2018-09-07 18:16:29 | stderr | return codecs.utf_8_decode(input, errors, True)
2018-09-07 18:16:29 | stderr | File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
2018-09-07 18:16:29 | stderr | data = self.sock.recv(8192).decode('UTF-8')
2018-09-07 18:16:29 | stderr | File "/app/medusa/ext/adba/aniDBlink.py", line 95, in run
2018-09-07 18:16:29 | stderr | Traceback (most recent call last):
2018-09-07 18:16:29 | stderr | ERROR:root:Bad response from server: 'utf8' codec can't decode byte 0x9c in position 3: invalid start byte
2018-09-07 18:16:20 | stderr | 2018-09-07 20:16:20 DEBUG    Thread_6 :: [db3d9d7] No XEM data for show ID 305719 on tvdb
2018-09-07 18:16:20 | stderr | 2018-09-07 20:16:20 DEBUG    Thread_6 :: [db3d9d7] User-Agent: Medusa/0.2.9 (Linux; 3.10.105; 4fbdf640-b2c9-11e8-9863-0242ac130004)

ideas greatly appreciated as i need to shutdown and restart

EDT: the show i clicked on is not at all linked with anidb FWIW

@sharkykh
Copy link
Contributor

sharkykh commented Sep 7, 2018

I think @p0psicles is working on a fix for that in #5125
(It's unrelated to this bug)

@udochrist
Copy link

i can reproduce that each time i open the show. i'll check if #5125 fixes this once i can get my hands on it. Thanks for the fast response!!

@sharkykh sharkykh mentioned this issue Sep 8, 2018
8 tasks
@sharkykh sharkykh reopened this Sep 9, 2018
@eximo84
Copy link
Author

eximo84 commented Sep 12, 2018

Can confirm deleting cache has fixed my issue. I’ve also updated for good measure. Thanks for the help.

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

Successfully merging a pull request may close this issue.

6 participants