Calibre getting disconnected while sending an ebook to Kindle Paperwhite 2

Bug #1834305 reported by rajesh rajendran
30
This bug affects 7 people
Affects Status Importance Assigned to Milestone
calibre
Invalid
Undecided
Unassigned

Bug Description

calibre --version
calibre (calibre 3.44)

uname -a
Linux work 5.1.15-arch1-1-ARCH #1 SMP PREEMPT Tue Jun 25 04:49:39 UTC 2019 x86_64 GNU/Linux

calibre -v
~ calibre -v <<<
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
[Errno 2] No such file or directory: '/run/media/rajeshr/Kindle/'

Traceback (most recent call last):
  File "/usr/lib/calibre/calibre/gui2/device.py", line 89, in run
    self.result = self.func(*self.args, **self.kwargs)
  File "/usr/lib/calibre/calibre/gui2/device.py", line 593, in _upload_books
    metadata=metadata, end_session=False)
  File "/usr/lib/calibre/calibre/devices/usbms/driver.py", line 314, in upload_books
    path = self._sanity_check(on_card, files)
  File "/usr/lib/calibre/calibre/devices/usbms/device.py", line 924, in _sanity_check
    sanity_check(on_card, files, self.card_prefix(), self.free_space())
  File "/usr/lib/calibre/calibre/devices/usbms/device.py", line 187, in free_space
    stats = os.statvfs(self._main_prefix)
OSError: [Errno 2] No such file or directory: '/run/media/rajeshr/Kindle/'

Note: kindle paperwhite2 will be in USB mode till calibre launched. After that kindle will get disconnected occasionally.

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

calibre uses standard filesystem operations to interact with the kindle.
If it is getting disconnected then it indicates there is either a bug on
the kindle or the filesystem drivers in the kernel. Most liekly the
Kindle is failing. You can try reformatting it, that might buy you some
more time.

 status invalid

Changed in calibre:
status: New → Invalid
Revision history for this message
Fabian Kraemer (fabian-kraemer) wrote :

I have the same problem with my Kindle Paperwhite. I can mount it fine, write to it via Nautilus and connect to a folder on it via Calibre.

When I try to send a book over via Send to device -> Send specific format to -> Main Memory and choose mobi, the conversion happens and the book gets transferred (i.e. not corrupt, Kindle can read it) but the device is immediately disconnected afterwards.

I get the following dmesg output on that operation:

[ 2009.032468] VFS: busy inodes on changed media or resized disk sda
[ 2009.040166] sd 2:0:0:0: [sda] tag#0 access beyond end of device
[ 2009.040170] print_req_error: I/O error, dev sda, sector 1 flags 1
[ 2009.040172] Buffer I/O error on dev sda, logical block 1, lost async page write
[ 2009.040201] sd 2:0:0:0: [sda] tag#0 access beyond end of device
[ 2009.040204] print_req_error: I/O error, dev sda, sector 0 flags 801
[ 2009.040206] Buffer I/O error on dev sda, logical block 0, lost sync page write

If I convert the book (epub -> mobi) locally and copy it over from my Calibre folder to Kindle at the same location (documents) via Nautilus I get no such error and the device stays mounted.

Revision history for this message
Dries Kimpe (p-dries) wrote :

I have the same problem. Calibre 4.8, kernel 5.4.7 (vanilla).

Using calibre causes the errors posted above every single time.

Accessing the kindle (paperwhite) without calibre (either reading all flash using dd or using mounted filesystem) works fine.

With calibre, the workaround listed in https://bugs.launchpad.net/calibre/+bug/1843328 (sync loop) solved the issue for me.

Revision history for this message
Alexander Adam (7ql6) wrote :

Also this is definitely a duplicate of https://bugs.launchpad.net/calibre/+bug/1843328, right?

Furthermore this seems to be the same as the problem described here:
https://www.mobileread.com/forums/showthread.php?t=322725

The kindle is unmounted every time something is sent through the Calibre "Send to device" functionality.

As Dries Kimpe pointed out everything works fine when Calibre is closed.
I can copy and delete files.
So this *definitely* seems to be related to Calibre.

At the moment I'm copying files when Calibre isn't running but I will give the mentioned workaround a try.

PS: This bug broke my Kindle vat partition because Calibre was unmounting the Kindle while I was copying a file outside of Calibre. Leading to the dirty bit set. Thus I had to unmount the kindle and do a sudo fsck.vfat -r /dev/sda1 as suggested in the forum ( https://www.mobileread.com/forums/showthread.php?t=243813 ). The repair was working in my case.

Revision history for this message
Greg Bell (gbell-spamless) wrote :

Calibre 5.18.0, linux kernel 5.8.0.
Not willing to re-format the device without more evidence.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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