Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
calibre-1.48 fails to communicate with device, sets readonly
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
ExecutorElassus
Veteran
Veteran


Joined: 11 Mar 2004
Posts: 1435
Location: Berlin, Germany

PostPosted: Thu Oct 02, 2014 5:54 am    Post subject: calibre-1.48 fails to communicate with device, sets readonly Reply with quote

So, after a recent emerge update, every time I plug in my kindle, I see 1) that it detects the device, and then 2) that it errors out of comunicating with it. After this point, the usb storage on the device is set read-only. This is calibre's traceback:

Code:
calibre, version 1.48.0
ERROR: Error: Error communicating with device

[Errno 30] Read-only file system: u'/mnt/usb/metadata.calibre'

Traceback (most recent call last):
  File "/usr/lib64/calibre/calibre/gui2/device.py", line 86, in run
    self.result = self.func(*self.args, **self.kwargs)
  File "/usr/lib64/calibre/calibre/gui2/device.py", line 490, in _books
    mainlist = self.device.books(oncard=None, end_session=False)
  File "/usr/lib64/calibre/calibre/devices/kindle/driver.py", line 354, in books
    bl = USBMS.books(self, oncard=oncard, end_session=end_session)
  File "/usr/lib64/calibre/calibre/devices/usbms/driver.py", line 249, in books
    self.sync_booklists((bl, None, None))
  File "/usr/lib64/calibre/calibre/devices/usbms/driver.py", line 395, in sync_booklists
    write_prefix(self._main_prefix, 0)
  File "/usr/lib64/calibre/calibre/devices/usbms/driver.py", line 392, in write_prefix
    with open(self.normalize_path(os.path.join(prefix, self.METADATA_CACHE)), 'wb') as f:
IOError: [Errno 30] Read-only file system: u'/mnt/usb/metadata.calibre'

The device was NOT read-only before calibre tried to communicate with it: I can add and remove files just fine. But as soon as I run calibre and it attempts to use it, I get this error, and the filesystem is read-only until I unmount/remount it.

Any advice?

Incidentally, python-updater also says this when I first run it:

Code:
Traceback (most recent call last):
  File "<string>", line 7, in <module>
ImportError: No module named 'portage'

so maybe there are some issues with python?

Cheers,

EE
Back to top
View user's profile Send private message
ExecutorElassus
Veteran
Veteran


Joined: 11 Mar 2004
Posts: 1435
Location: Berlin, Germany

PostPosted: Sat Oct 04, 2014 9:14 am    Post subject: Reply with quote

ugh, so it turns out it was just corrupted data on the kindle's storage.

PROTIP: fsck.vfat is a part of the dosfstools package, and does not repair fs errors unless explicitly instructed to do so (see the man page). Took me a while to figure both of these things out :(
Back to top
View user's profile Send private message
ExecutorElassus
Veteran
Veteran


Joined: 11 Mar 2004
Posts: 1435
Location: Berlin, Germany

PostPosted: Mon Jul 10, 2017 5:02 pm    Post subject: Reply with quote

UPDATE: welp, here we are again. This time, fsck.vfat does not return any filesystem errors at all, and calibre isn't involved. Nevertheless, the moment I mount the Kindle (even manually) it mounts it read-only and sets the dirty bit. Calibre's own debugging returns the following:

Code:
Devices possibly connected: Kindle 2/3/4/Touch/PaperWhite/Voyage Device Interface, User Defined USB driver, 
Trying to open Kindle 2/3/4/Touch/PaperWhite/Voyage Device Interface ... failed
Trying to open User Defined USB driver ... failed
Opening of the following devices failed
<calibre.devices.kindle.driver.KINDLE2 object at 0x7f53e222f510>
Traceback (most recent call last):
  File "/usr/lib64/calibre/calibre/devices/__init__.py", line 158, in debug
    dev.open(det, None)
  File "/usr/lib64/calibre/calibre/devices/usbms/device.py", line 825, in open
    self.open_linux()
  File "/usr/lib64/calibre/calibre/devices/usbms/device.py", line 599, in open_linux
    self.filter_read_only_mount_points()
  File "/usr/lib64/calibre/calibre/devices/usbms/device.py", line 637, in filter_read_only_mount_points
    %self.__class__.__name__)
DeviceError: The main memory of KINDLE2 is read only. This usually happens because of file system errors.


So, if "fsck.vfat -a -r /dev/sdg1" does nothing, how do I figure out what the problem is with the filesystem and repair it?

Cheers,

EE
Back to top
View user's profile Send private message
Section_8
l33t
l33t


Joined: 22 May 2004
Posts: 627

PostPosted: Tue Jul 11, 2017 12:59 am    Post subject: Reply with quote

Have you check dmesg after plugging it in?
Back to top
View user's profile Send private message
ExecutorElassus
Veteran
Veteran


Joined: 11 Mar 2004
Posts: 1435
Location: Berlin, Germany

PostPosted: Tue Jul 11, 2017 3:56 am    Post subject: Reply with quote

here is most recent dmesg:

Code:
[124243.825704] sd 10:0:0:0: [sdg] Synchronizing SCSI cache
[124243.825723] sd 10:0:0:0: [sdg] Synchronize Cache(10) failed: Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
[124246.470838] usb 6-5: new high-speed USB device number 6 using ehci-pci
[124246.628058] usb-storage 6-5:1.0: USB Mass Storage device detected
[124246.628194] scsi host10: usb-storage 6-5:1.0
[124247.640082] scsi 10:0:0:0: Direct-Access     Kindle   Internal Storage 0100 PQ: 0 ANSI: 2
[124247.640320] sd 10:0:0:0: Attached scsi generic sg6 type 0
[124247.649065] sd 10:0:0:0: [sdg] Attached SCSI removable disk
[124249.724925] sd 10:0:0:0: [sdg] 2797568 512-byte logical blocks: (1.43 GB/1.33 GiB)
[124249.942091] sd 10:0:0:0: [sdg] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[124250.162986]  sdg: sdg1
[124260.782331] FAT-fs (sdg1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[124575.991388] FAT-fs (sdg1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[124598.586966] FAT-fs (sdg1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[124999.086808] usb 6-5: USB disconnect, device number 6
[124999.087205] sd 10:0:0:0: [sdg] Synchronizing SCSI cache
[124999.087221] sd 10:0:0:0: [sdg] Synchronize Cache(10) failed: Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
[125028.819034] usb 6-5: new high-speed USB device number 7 using ehci-pci
[125028.976195] usb-storage 6-5:1.0: USB Mass Storage device detected
[125028.976380] scsi host10: usb-storage 6-5:1.0
[125030.000361] scsi 10:0:0:0: Direct-Access     Kindle   Internal Storage 0100 PQ: 0 ANSI: 2
[125030.000627] sd 10:0:0:0: Attached scsi generic sg6 type 0
[125030.009162] sd 10:0:0:0: [sdg] Attached SCSI removable disk
[125032.085147] sd 10:0:0:0: [sdg] 2797568 512-byte logical blocks: (1.43 GB/1.33 GiB)
[125032.300077] sd 10:0:0:0: [sdg] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[125032.521075]  sdg: sdg1
[126961.089265] usb 6-5: USB disconnect, device number 7
[126961.089652] sd 10:0:0:0: [sdg] Synchronizing SCSI cache
[126961.089669] sd 10:0:0:0: [sdg] Synchronize Cache(10) failed: Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
[126991.355216] usb 6-5: new high-speed USB device number 8 using ehci-pci
[126991.512394] usb-storage 6-5:1.0: USB Mass Storage device detected
[126991.512555] scsi host10: usb-storage 6-5:1.0
[126992.524527] scsi 10:0:0:0: Direct-Access     Kindle   Internal Storage 0100 PQ: 0 ANSI: 2
[126992.524759] sd 10:0:0:0: Attached scsi generic sg6 type 0
[126992.533445] sd 10:0:0:0: [sdg] Attached SCSI removable disk
[126994.608448] sd 10:0:0:0: [sdg] 2797568 512-byte logical blocks: (1.43 GB/1.33 GiB)
[126994.825523] sd 10:0:0:0: [sdg] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[126995.046484]  sdg: sdg1
[126996.661065] usb 6-5: USB disconnect, device number 8
[126996.661724] sd 10:0:0:0: [sdg] Synchronizing SCSI cache
[126996.661744] sd 10:0:0:0: [sdg] Synchronize Cache(10) failed: Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
[129372.895065] notification-da[1904]: segfault at 39 ip 000000000040dc00 sp 00007fff34007a08 error 4 in notification-daemon[400000+14000]
[130571.030151] notification-da[14286]: segfault at 39 ip 000000000040dc00 sp 00007ffc092456d8 error 4 in notification-daemon[400000+14000]
[130712.648345] notification-da[15043]: segfault at 39 ip 000000000040dc00 sp 00007ffd9801ff88 error 4 in notification-daemon[400000+14000]
[131288.739899] notification-da[15728]: segfault at 39 ip 000000000040dc00 sp 00007ffef2650938 error 4 in notification-daemon[400000+14000]
[139941.133023] notification-da[16413]: segfault at 39 ip 000000000040dc00 sp 00007ffcd0c69a58 error 4 in notification-daemon[400000+14000]
[139971.349576] notification-da[5151]: segfault at 39 ip 000000000040dc00 sp 00007ffe13d4eb58 error 4 in notification-daemon[400000+14000]
[139971.564767] notification-da[5220]: segfault at 39 ip 000000000040dc00 sp 00007fffda5511e8 error 4 in notification-daemon[400000+14000]
[139971.775267] notification-da[5226]: segfault at 39 ip 000000000040dc00 sp 00007ffc7a55b2a8 error 4 in notification-daemon[400000+14000]
[140136.405592] notification-da[5231]: segfault at 38 ip 000000000040dc00 sp 00007ffdd3901c28 error 4 in notification-daemon[400000+14000]
[141195.038002] notification-da[7576]: segfault at 39 ip 000000000040dc00 sp 00007ffe1e0239e8 error 4 in notification-daemon[400000+14000]
[144904.890128] notification-da[7715]: segfault at 39 ip 000000000040dc00 sp 00007ffcbf44b838 error 4 in notification-daemon[400000+14000]
[144905.934340] notification-da[15979]: segfault at 39 ip 000000000040dc00 sp 00007ffc6ca7c318 error 4 in notification-daemon[400000+14000]
[145692.375042] notification-da[15984]: segfault at 39 ip 000000000040dc00 sp 00007ffdc36103c8 error 4 in notification-daemon[400000+14000]
[145846.824735] usb 5-5: USB disconnect, device number 9
[145846.824737] usb 5-5.2: USB disconnect, device number 11
[145848.559559] usb 5-4: USB disconnect, device number 8
[145848.559561] usb 5-4.2: USB disconnect, device number 10
[150173.197878] mce: [Hardware Error]: Machine check events logged
[150173.197889] mce: [Hardware Error]: CPU 0: Machine Check: 0 Bank 2: dc2540f000040136
[150173.197891] mce: [Hardware Error]: TSC 0 ADDR 68c73e1f8 MISC c008001900000000
[150173.197893] mce: [Hardware Error]: PROCESSOR 2:600f20 TIME 1499729767 SOCKET 0 APIC 0 microcode 6000822
[164825.754552] usb 5-4: new high-speed USB device number 12 using ehci-pci
[164825.903677] hub 5-4:1.0: USB hub found
[164825.903723] hub 5-4:1.0: 3 ports detected
[164828.654452] usb 5-4.2: new full-speed USB device number 13 using ehci-pci
[164829.118438] usb 5-5: new high-speed USB device number 14 using ehci-pci
[164829.267490] hub 5-5:1.0: USB hub found
[164829.267600] hub 5-5:1.0: 3 ports detected
[164831.361786] hid-generic 0003:056D:4002.000F: device has no listeners, quitting
[164832.010296] usb 5-5.2: new full-speed USB device number 15 using ehci-pci
[164834.697017] hid-generic 0003:056D:4002.0010: device has no listeners, quitting


(on a side, that mce looks alarming, as do the segfaults. Any guesses what those might be or whether I should worry?)

Cheers,

EE
Back to top
View user's profile Send private message
Section_8
l33t
l33t


Joined: 22 May 2004
Posts: 627

PostPosted: Tue Jul 11, 2017 11:52 pm    Post subject: Reply with quote

I don't know what's wrong, but since you say calibre isn't involved now, you should probably open a new thread with this problem, since the first post and title of this thread aren't really accurate any more. Have you tried using a different USB cable, different port, etc., to see if it makes any difference?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21633

PostPosted: Wed Jul 12, 2017 12:51 am    Post subject: Reply with quote

The title can be changed, and if the real problem fits better somewhere else, the thread can be moved.
Back to top
View user's profile Send private message
ExecutorElassus
Veteran
Veteran


Joined: 11 Mar 2004
Posts: 1435
Location: Berlin, Germany

PostPosted: Wed Jul 12, 2017 5:44 am    Post subject: Reply with quote

welp, now I can't replicate the error. After doing fsck.vfat on the Kindle a few times, I unmounted it, disconnected it, and shut it down. Then, today, I reattached it, logged in to it on the device itself, then mounted it, seeing the following in dmesg:

Code:
[258248.214289] usb 6-5: new high-speed USB device number 9 using ehci-pci
[258248.371399] usb-storage 6-5:1.0: USB Mass Storage device detected
[258248.371490] scsi host10: usb-storage 6-5:1.0
[258249.399374] scsi 10:0:0:0: Direct-Access     Kindle   Internal Storage 0100 PQ: 0 ANSI: 2
[258249.399609] sd 10:0:0:0: Attached scsi generic sg6 type 0
[258249.408410] sd 10:0:0:0: [sdg] Attached SCSI removable disk
[258261.565002] sd 10:0:0:0: [sdg] 2797568 512-byte logical blocks: (1.43 GB/1.33 GiB)
[258261.784097] sd 10:0:0:0: [sdg] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[258262.005134]  sdg: sdg1


So now I'm stuck, again, with a Kindle that doesn't properly connect to Calibre every time, for which the dirty bit sometimes get set for no reason I can see, and then comes back working properly the next day.

Errors are annoying, but errors that disappear with no explanation and no reason are almost more annoying.

Anyway, thanks for the help (?),

EE
Back to top
View user's profile Send private message
ExecutorElassus
Veteran
Veteran


Joined: 11 Mar 2004
Posts: 1435
Location: Berlin, Germany

PostPosted: Wed Oct 11, 2017 3:37 pm    Post subject: Reply with quote

Back at it again with this kindle tomfoolery.

So, I figured out what my previous (non-calibre-related) issue was: my file manager (Spacefm, which is otherwise quite good) kept attempting to auto-mount the kindle, and that caused issues.

Now I'm back to just calibre. If I use 'fsck.vfat -a -r /dev/sdg1' on the kindle, it resents the dirty bit and changes nothing else. Calibre, however, reports the errors as I previously described them (with the python traceback in my message from the 10th of July).

How do I find out if there are any files on the kindle that are corrupted for calibre? A bunch of the subdirectories in the "documents" folder on the kindle have long strings of characters appended to them; is that normal behavior?

Anyway, thanks (again) for the help.

Cheers,

EE
ADDENDUM: dmesg now also says the following:

Code:
[156083.634302] sd 10:0:0:0: [sdg] Synchronizing SCSI cache
[156083.634328] sd 10:0:0:0: [sdg] Synchronize Cache(10) failed: Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
[156089.005974] usb 6-5: new high-speed USB device number 4 using ehci-pci
[156089.163185] usb-storage 6-5:1.0: USB Mass Storage device detected
[156089.163331] scsi host10: usb-storage 6-5:1.0
[156090.175174] scsi 10:0:0:0: Direct-Access     Kindle   Internal Storage 0100 PQ: 0 ANSI: 2
[156090.175431] sd 10:0:0:0: Attached scsi generic sg6 type 0
[156090.184111] sd 10:0:0:0: [sdg] Attached SCSI removable disk
[156092.260089] sd 10:0:0:0: [sdg] 2797568 512-byte logical blocks: (1.43 GB/1.33 GiB)
[156092.474054] sd 10:0:0:0: [sdg] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[156092.695337]  sdg: sdg1
[156872.994924] usb 6-5: USB disconnect, device number 4
[156873.009797] sd 10:0:0:0: [sdg] Synchronizing SCSI cache
[156873.009852] sd 10:0:0:0: [sdg] Synchronize Cache(10) failed: Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
[156873.465571] usb 6-5: new high-speed USB device number 5 using ehci-pci
[156874.017538] usb 6-5: device not accepting address 5, error -71
[156887.060876] usb 6-5: new high-speed USB device number 7 using ehci-pci
[156887.218012] usb-storage 6-5:1.0: USB Mass Storage device detected
[156887.218201] scsi host10: usb-storage 6-5:1.0
[156888.246073] scsi 10:0:0:0: Direct-Access     Kindle   Internal Storage 0100 PQ: 0 ANSI: 2
[156888.246257] sd 10:0:0:0: Attached scsi generic sg6 type 0
[156888.255063] sd 10:0:0:0: [sdg] Attached SCSI removable disk
[156890.330907] sd 10:0:0:0: [sdg] 2797568 512-byte logical blocks: (1.43 GB/1.33 GiB)
[156890.552748] sd 10:0:0:0: [sdg] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[156890.774035]  sdg: sdg1
what's with the failed sync and the address errors?
Back to top
View user's profile Send private message
Section_8
l33t
l33t


Joined: 22 May 2004
Posts: 627

PostPosted: Sat Oct 14, 2017 3:06 pm    Post subject: Reply with quote

If those directories you see have names ending in .sdr, I think those are have the amazon x-ray data for books that support it. You might be better off asking kindle and calibre questions at the mobileread forums. There are a lot of kindle and calibre experts (including calibre developers) who answer questions there.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21633

PostPosted: Sat Oct 14, 2017 4:08 pm    Post subject: Reply with quote

If you get an answer there, please cross-post either the answer or a link to it here, so that anyone who finds your post here can benefit from the answers too.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum