Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Devices

Notices

Reply
 
Thread Tools Search this Thread
Old 02-13-2020, 03:41 PM   #1
Pigi_102
Junior Member
Pigi_102 began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Feb 2020
Device: Kindle
Calibre keeps disconnecting my kindle.

Hi all,
I'm trying to figure out what's the problem.

I have a Kindle ( super basic edition ) that has started to give me some problems while sending books to it.

What happens is this.
I run calibre, which starts normally. I then connect my kindle to usb port and it get detected from the system ( linux ) and calibre.
I can see what's inside it but if I try to send a new book to it I see the kindle screen as it has been disconnected, and calibre gives me this error :
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-pigi'
[Errno 13] Permission denied: '/mnt/sdb1/documents'

Traceback (most recent call last):
File "site-packages/calibre/gui2/device.py", line 90, in run
File "site-packages/calibre/gui2/device.py", line 594, in _upload_books
File "site-packages/calibre/devices/usbms/driver.py", line 324, in upload_books
File "site-packages/calibre/devices/usbms/device.py", line 998, in create_upload_path
File "os.py", line 150, in makedirs
File "os.py", line 157, in makedirs
OSError: [Errno 13] Permission denied: '/mnt/sdb1/documents'

and in the dmesg I get:
[ 1220.207223] sd 6:0:0:0: [sdb] tag#0 access beyond end of device
[ 1220.207228] blk_update_request: I/O error, dev sdb, sector 17 op 0x1WRITE) flags 0x0 phys_seg 1 prio class 0
[ 1220.207231] Buffer I/O error on dev sdb1, logical block 1, lost async page write
[ 1220.207250] sd 6:0:0:0: [sdb] tag#0 access beyond end of device
[ 1220.207252] blk_update_request: I/O error, dev sdb, sector 8380 op 0x1WRITE) flags 0x0 phys_seg 2 prio class 0
[ 1220.207254] Buffer I/O error on dev sdb1, logical block 8364, lost async page write
[ 1220.207255] Buffer I/O error on dev sdb1, logical block 8365, lost async page write

I've tracked down this one as it happens because the mount point get somehow disconnected.


At this point the only chance I get is to disconnect the usb port and connect again, but as soon as I try to write to the kindle I get the same error.

Initially I thought that the problm could have been on kindle filesystem or flash, thus I did an fsck to it and also tried on an other computer but with the same results.

If, instead, I do close calibre, mount the kindle by hand ( mount /dev/sdb1 /mnt/sdb1 ) I can write to it the books or whatever I want without any problem.
I can the read those book without any problem.
This mean ( to me ) that kindle is perfectly working, and also that the usb side of my linux is working too.

Any hint on how to track down the problem ?

Thanks in advance

Pigi_102
Pigi_102 is offline   Reply With Quote
Old 02-14-2020, 08:08 AM   #2
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,497
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
This thread may be related: [Kindle] calibre losing sight of device after one transfer
jhowell is offline   Reply With Quote
Old 07-18-2020, 11:39 AM   #3
ilvez
Junior Member
ilvez began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2020
Device: Kindle Paperwhite (10th gen)
Quote:
Originally Posted by jhowell View Post
This thread mentions this bug https://bugs.launchpad.net/calibre/+bug/1834641, but I'm currently a bit confused whether it's actually taken care of or not. It seems like fix has been released, but I have the exact same issue as Pigi_102. I don't want to cause noise in that bug report if that's not connected.

I can reproduce this every single time with Calibre (latest) + latest Kindle update (5.13.1) + Linux 5.7.6. And it has been through different version combinations quite some time now.

Should I open new bug report?

dmesg output: https://pastebin.com/8Dx4vJHM

Last edited by ilvez; 07-18-2020 at 11:41 AM.
ilvez is offline   Reply With Quote
Old 07-18-2020, 01:29 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
the linux kernel bug was never fixed. A work around for it was added to calibre a while ago. If you are experiencing disconnects it will be because either you are running a distro calibre and hence not the latest or some other unrelated issue.
kovidgoyal is offline   Reply With Quote
Old 07-18-2020, 02:07 PM   #5
ilvez
Junior Member
ilvez began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2020
Device: Kindle Paperwhite (10th gen)
Thank you for your fast response. I reproduced this with non-distro Calibre, just downloaded latest pre-compiled binary, extracted and run.

Normal mount + copy works without disconnects.

So I guess this is a new bug then? Should I open new bug ticket?
ilvez is offline   Reply With Quote
Old 07-18-2020, 02:23 PM   #6
ilvez
Junior Member
ilvez began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2020
Device: Kindle Paperwhite (10th gen)
Hm. Actually I was bit hasty with my response. I had Debian calibre installed. I remove it completely and follow installation instructions and see the result. I was suspecting that system libraries are actually being read or something like this.

EDIT: I followed official installer and confirmed. It behaves the same.

Last edited by ilvez; 07-18-2020 at 02:28 PM.
ilvez is offline   Reply With Quote
Old 07-19-2020, 12:13 AM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Opening a new bug is not going to help. I cannot reproduce this behavior with my kindle, as such there is nothing I can do to help you. I am fairly certain you are still using an outdated calibre, since no one else has reported this.
kovidgoyal is offline   Reply With Quote
Old 07-19-2020, 02:35 AM   #8
ilvez
Junior Member
ilvez began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2020
Device: Kindle Paperwhite (10th gen)
So I took these steps to do clean install yesterday:


Code:
sudo apt purge calibre
sudo apt autoremove
sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin


ilvez@merkuur ~ % ls -l `which calibre`
lrwxrwxrwx 1 root root 20 Jul 19 09:23 /usr/bin/calibre -> /opt/calibre/calibre
Then I just ran calibre.

To be extra sure, I then ran:

Code:
sudo /usr/bin/calibre-uninstall
sudo rm -rf /opt/calibre
sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin
Then I ran calibre again (version 4.21) and reproduced it.

If you have any ideas what do debug here, I'm willing to do any extra step. I can recompile kernel or try some older Linux. I'm just don't know how to provide more useful information at this point.

I have been years Calibre user and really appriciate your job done on the software. This error is currently major headache for me to use the software. Do throw you bone here, I'm actually thinking of becoming patreon as well, since I really am grateful for Calibre. But I understand if this kind of errors are just party-poopers and stopping you for doing some fun development work.
ilvez is offline   Reply With Quote
Old 07-19-2020, 03:24 AM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Without being able to reproduce, I'm afraid there is not anything I can do to fix it, since this can only be a kernel bug, I need to be able to experiment to find a workaround. My kindle paperwhite works perfectly with up-to-date firmware, calibre 4.21 and Linux kernel 5.7.9-arch1-1

If you want to try older kernels. go back to the version referenced in the bug report, before they broke the VFAT driver. If it is indeed the same bug then that should confirm it.
kovidgoyal is offline   Reply With Quote
Old 07-19-2020, 01:49 PM   #10
ilvez
Junior Member
ilvez began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2020
Device: Kindle Paperwhite (10th gen)
Thank you.

I skipped currently running older kernels. Instead I went and read about the lengthy discussion about underlying kernel bug https://bugzilla.kernel.org/show_bug.cgi?id=203973

The last comment I found workaround. I don't know the implications for changing write_cache to "write through" with:

Code:
   echo "write through" > /sys/block/<dev>/queue/write_cache
... but it seems to work.

I'm currently trying to figure out how to make this into a udev rule.
ilvez is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle Dx keeps connecting, disconnecting, and reconnecting. MarjaE Amazon Kindle 0 06-04-2016 11:57 AM
CC & Fire 8.9 HDX disconnecting itself from Calibre Skydog Calibre Companion 4 12-28-2014 01:51 AM
Calibre Companion Keeps Disconnecting TGPB Calibre Companion 1 02-04-2014 05:04 AM
Kobo Touch loses UNREAD/FINISHED status after disconnecting from Calibre DragonflyKing Library Management 4 03-15-2012 03:47 AM
disconnecting Sony PRS-650 from Calibre Arroll Calibre 8 01-18-2011 02:40 AM


All times are GMT -4. The time now is 03:43 PM.


MobileRead.com is a privately owned, operated and funded community.