informatics-isi-edu / deriva-qt

Graphical User Interface tools for DERIVA using PyQt
GNU General Public License v3.0
0 stars 1 forks source link

Regression in deriva-auth IO operation on closed file #11

Closed karlcz closed 4 years ago

karlcz commented 4 years ago

Using recent master code for deriva-py and deriva-qt, I am seeing a regression on Linux in deriva-auth. I can do a successful login via Globus, but as soon as it shows "Authentication successful" I also get an unhandled exception dialog, showing "I/O operation on closed file".

Traceback (most recent call last):

  File "/usr/local/lib/python3.7/site-packages/deriva/qt/auth_agent/ui/auth_widget.py", line 247, in _onCookieAdded
    write_credential(self.credential_file, creds)

  File "/usr/local/lib/python3.7/site-packages/deriva/core/utils/core_utils.py", line 227, in write_credential
    cf.close()

  File "/usr/local/lib/python3.7/site-packages/portalocker/utils.py", line 201, in __exit__
    self.release()

  File "/usr/local/lib/python3.7/site-packages/portalocker/utils.py", line 168, in release
    portalocker.unlock(self.fh)

  File "/usr/local/lib/python3.7/site-packages/portalocker/portalocker.py", line 144, in unlock
    fcntl.flock(file_.fileno(), constants.LOCK_UN)

ValueError: I/O operation on closed file

At this moment, I do see a ~/.deriva/credential.json file that looks normal enough, with a session cookie for the host I just logged into.

I will try to update this description if I also can see further error information after the periodic session refresh attempt.

karlcz commented 4 years ago

The error in the issue description is with portalocker 1.6.0.

Rolling back to 1.5.2 I do not see the error dialog window nor the exception in the console output.

mikedarcy commented 4 years ago

Pushed a fix to deriva-py master that hopefully takes care of this.

karlcz commented 4 years ago

confirmed that this update (still) works for portalocker 1.5.2

karlcz commented 4 years ago

confirmed that this also gets rid of the error with portalocker 1.6.0