05-11-2011, 02:29 AM | #1 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
os error (2) no such file or directory
posting this in devices subforum , as the symptom appears when using send to device.
but I suspect the root cause is not a device issue had this one time in v7 am seeing it now in v8. - twice in the last few days I connect my sony & then try to send a book via calibre. ( a book that was edited yesterday). Calibre gives me OSError: [Errno 2] No such file or directory log for failure: Traceback (most recent call last): File "site-packages\calibre\gui2\device.py", line 890, in dispatch_sync_event File "site-packages\calibre\gui2\device.py", line 1092, in sync_to_device File "site-packages\calibre\gui2\library\models.py", line 441, in get_preferred_formats_from_ids File "site-packages\calibre\ptempfile.py", line 60, in __init__ File "tempfile.py", line 293, in mkstemp File "tempfile.py", line 228, in _mkstemp_inner OSError: [Errno 2] No such file or directory I then get it again ( see below) if I select view in calibre tool bar for that book ( though the book is there & is fine if I go via open path... log for view failure: Traceback (most recent call last): File "site-packages\calibre\gui2\actions\view.py", line 200, in view_book File "site-packages\calibre\gui2\actions\view.py", line 270, in _view_books File "site-packages\calibre\gui2\actions\view.py", line 238, in _view_calibre_books File "site-packages\calibre\gui2\actions\view.py", line 104, in view_format_by_id File "site-packages\calibre\gui2\actions\view.py", line 134, in _view_file File "site-packages\calibre\gui2\actions\view.py", line 123, in _launch_viewer File "site-packages\calibre\gui2\jobs.py", line 227, in launch_gui_app File "site-packages\calibre\utils\ipc\server.py", line 166, in run_job File "site-packages\calibre\utils\ipc\server.py", line 121, in launch_worker File "tempfile.py", line 293, in mkstemp File "tempfile.py", line 228, in _mkstemp_inner OSError: [Errno 2] No such file or directory a complete exit + restart of calibre fixes it, so it's a calibre bug, not a sony bug. after a restart I can send/ view the problem book(s) OK. so what is happening here. it seems that calibre "forgets" where the book is? my only other clues : calibre is always left running except for updates, so is the PC, I just use sleep / wake. I have worked on that book in sigil sometime in last couple of days so sigil will have written a revised copy back into calibre library. this was the case with the v7 error also - work on book in sigil ( from calibre i.e. my workflow is that open with editor option in calibre launches sigil. sigil save puts revised copy back into library. 99.9% of the times there is no issue. one more clue - maybe between edit/save of book and the attempt to send to device, i have run ccleaner which will wipe temporary files. could be it wipes too aggressively ? Last edited by cybmole; 05-11-2011 at 02:39 AM. |
05-11-2011, 07:32 AM | #2 |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
Calibre makes extensive use of temporary files. It looks like you've deleted the temporary folder calibre creates when it starts. So subsequent writes to this directory fail because it's not present.
|
Advert | |
|
05-11-2011, 08:35 AM | #3 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
i thought it might be something like that. I tried to reproduce it but there's an ageing factor involved. simply trying open in editor save, ccleaner, view works fine. I guess waht has happen is this.
1. calibre runs/sleeps for several days without ever a full shut down. 2. ccleaner runs & applies it's logic to delect "safe-to-delete" + "temporary file" which is probably restricted to files that are > x days old. so to reproduce it ( without messing with PC system date/time) I'd have to run calibre in tray for a week, then run ccleaner, then try to View something. Connecting an e-reader is probably not relevent if this diagnosis is correct. if i remember I'll check this out next week. but a couple of comments. 1. it's a scary & generic error message ( generic because I can google the error text & see it reported for other apps). scary, because 1st thought on seeing it is oh S***T I've accidentally deleted the book! 2. could calibre not trap it, realize it needs a new temp file & simply make one; or if that's not possible then put up a message saying calibre has encountered an error & needs to close, please restart it. { I hate seeing those in games but here, it's what's needed] 3. ccleaner has an exclude function. can I use that to prevent this error , but still have it clean up the calibre .tmp files that get moaned about it other threads ? what is the specific file / folder to exclude ? Last edited by cybmole; 05-11-2011 at 08:46 AM. |
05-16-2011, 02:59 PM | #4 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
well I plug in my sony today & get this damn message again, when I try to send a book!
pretty sure I've NOT run ccleaner recently - yet calibre is still losing essential temp files ??? PC /calibre has been runnng without shutdown ( onlt sleep) for a dew days... how can I diagnose this more ? Traceback (most recent call last): File "site-packages\calibre\gui2\actions\view.py", line 203, in view_triggered File "site-packages\calibre\gui2\actions\view.py", line 270, in _view_books File "site-packages\calibre\gui2\actions\view.py", line 238, in _view_calibre_books File "site-packages\calibre\gui2\actions\view.py", line 104, in view_format_by_id File "site-packages\calibre\gui2\actions\view.py", line 134, in _view_file File "site-packages\calibre\gui2\actions\view.py", line 123, in _launch_viewer File "site-packages\calibre\gui2\jobs.py", line 227, in.... File "tempfile.py", line 293, in mkstemp File "tempfile.py", line 228, in _mkstemp_inner OSError: [Errno 2] No such file or directory |
05-16-2011, 04:33 PM | #5 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
That error means that something has deleted the calibre temp directory. calibre itself only does that at shutdown. If you cannot figure out what is doing the deleting, then a workaround is to have calibre periodically restarted.
|
Advert | |
|
05-16-2011, 11:54 PM | #6 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
ok - can u tell me the name/location of the "no such file or directory ", then I can watch that location while I try to recreate the issue..
PS the culprit software could be auslogic's disc defrag - it has a (ticked) option to remove windows temp files before each defrag; and I ran this program yesterday, I think |
05-17-2011, 12:18 AM | #7 | |
Well trained by Cats
Posts: 29,804
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
It is in you 'temp' folder Code:
C:\Documents and Settings\<username>\Local Settings\Temp |
|
05-17-2011, 04:56 AM | #8 |
Wizard
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
I can live with the explanation & work-arounds - but is there a good reason why calibre could not simply recreate the temp directory as needed, rather than "give up" & report an ( unclear) error.
|
05-17-2011, 07:09 AM | #9 |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
Every time a tmpfile needs to be written there would need to be this check. Hundreds if not thousands of places would needed the code over and over again.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
error no such file or directory | cybmole | Calibre | 1 | 04-25-2011 12:52 AM |
.Kobo\version directory missing - error communicating | bitjockey | Devices | 4 | 02-26-2011 09:38 AM |
IOError - No such file or directory | SkyDream | Calibre | 7 | 11-12-2010 02:44 PM |
File directory corruption in IR1000S | physics@war | iRex | 3 | 02-08-2010 08:56 AM |
Word to HTML no such file or directory | evwool | Reading and Management | 1 | 05-11-2009 01:50 AM |