hydrusnetwork / hydrus

A personal booru-style media tagger that can import files and tags from your hard drive and popular websites. Content can be shared with other users via user-run servers.
http://hydrusnetwork.github.io/hydrus/
Other
2.37k stars 157 forks source link

Error while Shutting down the Client #1219

Closed ivcat closed 2 years ago

ivcat commented 2 years ago

Hydrus version

v497

Operating system

Linux (specify distro and version in comments)

Install method

Extract

Install and OS comments

Debian 11 (Bullseye)

Bug description and reproduction

i get this error everytime i try to shutdown the client. note that when i run database>database maintenance>analyse>full before shutting down the client i don't get the error

Log output

shutdown error
A serious error occurred while trying to exit the program. Its traceback may be shown next. It should have also been written to client.log. You may need to quit the program from task manager.
shutdown error
Traceback (most recent call last):
  File "hydrus/client/ClientController.py", line 1978, in ShutdownView
    self.DoIdleShutdownWork()
  File "hydrus/client/ClientController.py", line 765, in DoIdleShutdownWork
    self.MaintainDB( maintenance_mode = HC.MAINTENANCE_SHUTDOWN, stop_time = stop_time )
  File "hydrus/client/ClientController.py", line 1357, in MaintainDB
    self.WriteSynchronous( 'maintain_similar_files_tree', maintenance_mode = maintenance_mode, stop_time = tree_stop_time )
  File "hydrus/core/HydrusController.py", line 934, in WriteSynchronous
    return self._Write( action, True, *args, **kwargs )
  File "hydrus/core/HydrusController.py", line 241, in _Write
    result = self.db.Write( action, synchronous, *args, **kwargs )
  File "hydrus/core/HydrusDB.py", line 953, in Write
    if synchronous: return job.GetResult()
  File "hydrus/core/HydrusData.py", line 2057, in GetResult
    raise e
hydrus.core.HydrusExceptions.DBException: TypeError: cannot unpack non-iterable NoneType object
Database Traceback (most recent call last):
  File "hydrus/core/HydrusDB.py", line 614, in _ProcessJob
    result = self._Write( action, *args, **kwargs )
  File "hydrus/client/db/ClientDB.py", line 11987, in _Write
    elif action == 'maintain_similar_files_tree': self.modules_similar_files.MaintainTree( *args, **kwargs )
  File "hydrus/client/db/ClientDBSimilarFiles.py", line 531, in MaintainTree
    ( biggest_perceptual_hash_id, ) = self._Execute( 'SELECT phash_id FROM {} CROSS JOIN shape_vptree USING ( phash_id ) ORDER BY inner_population + outer_population DESC;'.format( temp_table_name ) ).fetchone()
TypeError: cannot unpack non-iterable NoneType object
hydrusnetwork commented 2 years ago

Thank you for this report. Please run database->regenerate->similar files search tree, and let me know if that fixed things.

This has happened to several users now. I am not sure if it is due to a hard drive fault wiping out the similar files search tree or a logical problem in that search line. I will have another look at this area, at least I can handle the error better.

hydrusnetwork commented 2 years ago

I had a full look at this and have updated the error handling so it shouldn't cause any more trouble. If it happens again, it should now locate the problem and fix it automatically. This will be out in tomorrow's release. You don't have to regen your search tree for it to work. Please let me know if you have any more trouble!