'No such file or directory' when trying to open book

Bug #1104706 reported by Richard P
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Invalid
Undecided
Unassigned

Bug Description

Running verison 0.9.15 on Linux. After adding a book, trying to double click on record to open, or trying to open from 'Path: click to open' menu on right-side results in "No such file or directory" message. The directory is present, the book files are present. Other books in the library also have the same problem.

I first noticed problem after running a Calibre upgrade while trying to open a newly imported PDF. I checked other book records and they too have the problem.

The Run Welcome Wizard path reports the Calibre Library at: /media/sdc1/mm/Calibre Library (this is the correct location).
I also tried escaping the space in .config/calibre/global.py for path... Calibre\ Library. No effect.

If I hover over the 'click to open' hyperlink, it shows the fully qualified path to the directory that contains the PDF.

I tried launching in debug mode, but no errors were reported.

Additional information: I moved the Calibre library from sda1 to sdc1 for space reasons. But all books were accessible at the new location after the move until after I upgraded Calibre.

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1104706

If the path is correct and you are getting path not found errors, then
your filesystem is screwed up. Since you appear to have put the calibre
library on some kind of external storage (flash?) move it to an internal
disk using a file manager/terminal. THen point calibre to the new
location by right clicking the calibre icon on the toolbar in the
calibre window.

 status invalid

Changed in calibre:
status: New → Invalid
Revision history for this message
Richard P (blackletter) wrote :

Thanks for the quick response. My storage devices sda and sdc are both internal SATA drives mounted at boot time by UUID and an entry in /etc/fstab. I don't think the filesystem itself is screwed up. Data rights are 755. My system has 3 local drives sda sdb and sdc. It dual boots two Linux distros. sda contains one distro, sdb contains the second. sdc contains the calibre library. Calibre is installed on both Linux distros and both point to the same library on the third drive, but only one can possibly be active at any time, since only one OS at a time can be running. I keep both versions of Calibre at the same (current) level. I read on the forums about trouble with network drives and external storage, so I purposefully kept everything on local drives. Is it possible there is another issue? I appreciate your response and Calibre is a very cool program by the way.

Revision history for this message
Kovid Goyal (kovid) wrote :

The calibre database stores relative paths to the books files, you can look at those paths by opening metadata.db in a sqlite browser and looking at the data table. Verify that the paths are correct. If they are, then the problem is somewhere on your system, since when opening files all calibre does is call the ebook viewer passing it the full path to the file being viewed.

Revision history for this message
Richard P (blackletter) wrote :

Thanks for that info. I checked the database and the relative paths are good. Just to do I changed the mount point of the drive and re-ran the wizard to force calibre to look at a new path. After that all books EXCEPT PDFs open by double clicking on either the title, or the cover browser. However all of them have the same trouble '"No such file or directory' if I try clicking on the " Path 'Click to open' " hyperlink on the right, and PDFs refuse to open at all. I verified that my system settings for PDFs launch /usr/bin/evince. At this point, I can still work with calibre, and it imports correctly and displays metadata correctly, so this is more of a nuisance than anything. Still not clear about the root cause, but I do appreciate your suggestions.

Revision history for this message
zarnaik (zarnaik) wrote :

I ran into the same problem. If you are running LXDE chances are that not calibre but the open_lxde() subroutine is at fault.
This is what fixed my problem:

"I found a solution for Ubuntu 13.04.

Open /usr/bin/xdg-open as root
go to the sub routine open_lxde()
After the line

local file="$(echo "$1" | sed 's%^file://%%')"

add the following two lines:

local printf=/usr/bin/printf
file="$($printf "$(echo "$file" | sed -e 's@%\([a-f0-9A-F]\{2\}\)@\\x\1@g')")"

The problem is, that the lxde_open() is quite of buggy. This sub tries to convert an URI that starts with "file://" to an absolute path, but I fails to deal with special chars like %20. So

file:///home/lib/Isaac%20Asimov.pdf
becomes
/home/lib/Isaac%20Asimov.pdf

This is not a valid file name. So the known "file or directory not found"-window appears.
I c&p the above two lines from the "open_generic" subroutine where this is done right.
Thanks to Kovod for the hint with xdg-open."

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.