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

"invalid operation on closed shelf" error on every download #27

Closed
rbong opened this issue Oct 1, 2016 · 8 comments
Closed

"invalid operation on closed shelf" error on every download #27

rbong opened this issue Oct 1, 2016 · 8 comments
Labels

Comments

@rbong
Copy link

rbong commented Oct 1, 2016

Every time a download completes, I get the error in this output:

Sat 18:38 Nicotine+ supports a country code blocker. That requires a (GPL'ed) library called GeoIP. You can find it here: C library:       http://www.maxmind.com/app/c Python bindings: http://www.maxmind.com/app/python (the python bindings require the C
          library)
Sat 18:39 adoblivione is making a BrowseShares request
Failed to lookup 4008 in self.transfers
Entering old part FileRequest
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pynicotine/gtkgui/frame.py", line 1482, in OnNetworkEvent
    self.np.events[i.__class__](i)
  File "/usr/lib/python2.7/site-packages/pynicotine/pynicotine.py", line 1372, in FileDownload
    self.transfers.FileDownload(msg)
  File "/usr/lib/python2.7/site-packages/pynicotine/transfers.py", line 1064, in FileDownload
    self.addToShared(newname)
  File "/usr/lib/python2.7/site-packages/pynicotine/transfers.py", line 1102, in addToShared
    self.eventprocessor.shares.addToShared(name)
  File "/usr/lib/python2.7/site-packages/pynicotine/shares.py", line 962, in addToShared
    shared, sharedstreams, wordindex, fileindex, sharedmtimes
  File "/usr/lib/python2.7/site-packages/pynicotine/config.py", line 890, in setShares
    self._storeObjects(storable_objects)
  File "/usr/lib/python2.7/site-packages/pynicotine/config.py", line 900, in _storeObjects
    for (key, value) in source.iteritems():
  File "/usr/lib/python2.7/UserDict.py", line 143, in iteritems
    for k in self:
  File "/usr/lib/python2.7/UserDict.py", line 130, in __iter__
    for k in self.keys():
  File "/usr/lib/python2.7/shelve.py", line 101, in keys
    return self.dict.keys()
  File "/usr/lib/python2.7/shelve.py", line 79, in closed
    raise ValueError('invalid operation on closed shelf')
ValueError: invalid operation on closed shelf

Further information:

  • I am on Arch Linux with the latest packages
  • I have also tried installing from master
  • I have installed the latest packages for Python2.7, GTK+ 2.24, PyGTK 2.24, and mutagen
  • I cleared out my ~/.nicotine folder on every fresh install
  • I get errors on git versions further back than nicotine+ will actually work for me, so it's likely a dependency or user error, but I cannot narrow this down further on my own
@ghost
Copy link

ghost commented Oct 3, 2016

Hi @rbong,

Thx for the bug report.
Just to be sure I've not messed up something could you try to come back to this commit 0756064 and see if it works ? In the commit just after (ece7145) I've clean up some duplicate functions and I might have missed something but I'm not sure since it's working on my tests systems (fedora, ubuntu, debian, windows).
Anyway I need to create a Arch VM and for tests anyway.

@rbong
Copy link
Author

rbong commented Oct 5, 2016

@gfarmerfr, that commit does not have this issue for me.

@ghost
Copy link

ghost commented Oct 6, 2016

@rbong, I've reverted ece7145 on top of master and made a branch: https://github.com/gfarmerfr/nicotine-plus/tree/arch-fix-27. Could you have a look at it and check if it works on arch ?

Strange that the problem is only happening on Arch, but if I remember well when I tested n+ with msys2 on windows (which is based on Arch packages) and I had similar problems so I decided to fallback to using the official python build for windows which works fine.
N+ .db files are created/managed via the 'shelve' python module which in turn use either dbm, gdbm or bsddb as a backend. bsddb is deprecated since python 2.6 so two choices are left: dbm or gdbm.

From what I see on their respective VCS fedora and debian based distros deactivate gdbm in their build scripts for python. Arch and gentoo don't.
So it might be the case where the shelve module choose gdbm on Arch and there's bugs associated with it. That would explain differences in behavior across distros but it's just my wild guess :)

@ghost
Copy link

ghost commented Oct 12, 2016

@rbong ; I've just finished to install a new Arch VM for testing. I will have a further look at this soon.

@rbong
Copy link
Author

rbong commented Oct 12, 2016

Sorry for the delay, I have been on a business trip. I will be able to test this soon.

@ghost
Copy link

ghost commented Oct 12, 2016

No problem I needed to have an Arch testing box anyway :)

@rbong
Copy link
Author

rbong commented Oct 15, 2016

The branch works for me; thank you very much!

@ghost
Copy link

ghost commented Oct 15, 2016

Thx for the testing. I'm merging the fix on master and a further at what was causing it on Arch.

@ghost ghost closed this as completed in 42c48b9 Oct 15, 2016
@ghost ghost added the bug label Oct 15, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant