View Single Post
Old 07-02-2023, 02:12 PM   #58
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,039
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
I'm a bit late to this party, but I think I have another data point that may be relevant.

It looks very much like Window File Explorer search that happens to include Calibre library can cause lock issues long after the search was done.

I was recently using Windows File Explorer search--something I do very rarely--on my c:/users/USER dir, which also includes my Calibre libraries. I did my search and moved on, leaving file explorer open (I use that a lot), but not on the search anymore.

Afterwards--several hours afterwards--I was blocked from changing a book title in Calibre until rebooting.

Later, I duplicated and saw that it was explorer.exe locking the book dir in the library.

And I've again duplicated it just now:
  1. Use Windows File Explorer search that happens to include Calibre library but wasn't for anything in the library.
  2. Go on to something else, leaving search results, but keeping File Explorer open.
  3. Calibre fails trying to rename a book.
  4. Wait close to 2 hours while using computer for other tasks.
  5. Calibre still fails trying to rename a book.
  6. Close File Explorer
  7. Calibre can successfully rename book.

This, IMO, is a lot more problematic than 'user had file explorer open in library' because it's not obviously related. Users with their libraries under Documents could bump into this easily and frequently without having any idea why it's happening.

If it weren't for the fact I use file explorer search so fairly, I doubt I'd have spotted it either.

Error message:
Spoiler:
Code:
calibre, version 6.22.0
ERROR: Cannot open file or folder as it is in use: Could not change on-disk location of this book's files. The folder "C:\Users\USER\Documents\Library\Andrew Joshua Talon\Paint and Powder (10896)" is opened in another program, so calibre cannot access it.This is usually caused by leaving Windows explorer or a similar file manager open to a folder in the calibre library. Close Windows explorer and retry.

calibre 6.22  embedded-python: True
Windows-10-10.0.19045-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19045')
Python 3.10.1
Windows: ('10', '10.0.19045', 'SP0', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: DeDRM (10, 0, 3) && ColumnSum (2, 2, 0) && Count Pages (1, 13, 0) && EpubMerge (2, 15, 1) && EpubSplit (3, 6, 0) && FanFicFare (4, 24, 9) && Favourites Menu (1, 3, 0) && Find Duplicates (1, 10, 8) && Generate Cover (2, 3, 2) && Jimms Editor Addons (0, 0, 1) && Manage Series (1, 5, 1) && Modify ePub (1, 8, 1) && Quality Check (1, 13, 4) && Reading List (1, 15, 1) && ScrambleEbook (0, 6, 0) && SmartEject (2, 5, 0) && SpacerName (0, 0, 2) && SplitMergeNew (0, 3, 0) && View Manager (1, 10, 2)
Traceback (most recent call last):
  File "calibre\utils\copy_files.py", line 112, in _open_file
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\USER\\Documents\\Library\\Andrew Joshua Talon\\Paint and Powder (10896)'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "calibre\gui2\metadata\single.py", line 625, in accept
  File "calibre\gui2\metadata\single.py", line 608, in apply_changes
  File "calibre\gui2\metadata\basic_widgets.py", line 231, in commit
  File "calibre\db\legacy.py", line 934, in func
  File "calibre\db\cache.py", line 85, in call_func_with_lock
  File "calibre\db\cache.py", line 1481, in set_field
  File "calibre\db\backend.py", line 1726, in windows_check_if_files_in_use
  File "calibre\utils\copy_files.py", line 250, in windows_check_if_files_in_use
  File "calibre\utils\copy_files.py", line 136, in __enter__
  File "calibre\utils\copy_files.py", line 132, in open_all_handles
  File "calibre\utils\copy_files.py", line 123, in _open_file
  File "calibre\utils\copy_files.py", line 112, in _open_file
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\USER\\Documents\\Library\\Andrew Joshua Talon\\Paint and Powder (10896)'
JimmXinu is offline   Reply With Quote