calibre-kobo-driver icon indicating copy to clipboard operation
calibre-kobo-driver copied to clipboard

KoboTouchExtended: Error communicating with device

Open jgoerzen opened this issue 9 months ago • 5 comments

Bug Checklist

These items are mandatory. If you need help finding this information submit the bug report with as much completed as you can and ask for help finding the rest.

  • [X] I am using the latest version of calibre to report this bug, which is:
  • [X] I am using an official calibre release, not one from a third party (e.g. your Linux distro, Flatpak, Chocolatey package, Homebrew, etc.)
  • [X] I am using the latest version of this plugin, which is: 3.6.6
  • [ ] My operating system is (e.g. Windows 10, Windows 8.1, Windows 8, macOS 10.15.5, Fedora 32, Arch Linux, etc.):
  • [X] I have included the full, complete, unmodified debug log from calibre
    • Directions for getting the debug log are under the "Logs" header below.
  • [X] I have translated the text in any screenshots and logs to English, or all screenshots and logs included are in English.

These items are optional. Fill in as much of them as possible. If something is not applicable to your bug report, note that.

  • [ ] I have installed the Scramble Epub plugin (see https://www.mobileread.com/forums/showthread.php?t=267998) and will attach a scrambled copy of the book I'm having problems with (attach a file by dragging and dropping onto the Github editor).
    • [ ] If this is a conversion bug, I will also attach a scrambled copy of the converted book.
  • [X] The path to my calibre library or to a book in my calibre library has non-ASCII characters: NO
  • [ ] If I am using Windows 10, I (have/have not) enabled Windows' beta support for Unicode (see https://www.mobileread.com/forums/showpost.php?p=3988195&postcount=2052)
  • [ ] If I am using Windows 10, does this bug happens with beta Unicode support both enabled and disabled, only when enabled, or only when disabled?

Describe the bug

A clear and concise description of what the bug is.

When connecting my Kobo Libra 2, I see:

calibre, version 6.26.0
ERROR: Error: Error communicating with device

[Errno 9] Bad file descriptor

Traceback (most recent call last):
  File "calibre/gui2/device.py", line 104, in run
  File "calibre/gui2/device.py", line 556, in _books
  File "calibre/devices/kobo/driver.py", line 1619, in books
  File "calibre/devices/kobo/driver.py", line 3853, in get_debugging_title
  File "calibre/devices/kobo/driver.py", line 3470, in get_pref
  File "calibre_plugins.kobotouch_extended.device.driver", line 111, in settings
    common.log.debug("KoboTouchExtended:settings: settings=", opts)
  File "calibre_plugins.kobotouch_extended.common", line 95, in print_formatted_log
    self._prints(level, *tagged_args, **kwargs)
  File "calibre_plugins.kobotouch_extended.common", line 91, in _prints
    o.flush()
  File "calibre/utils/logging.py", line 37, in flush
OSError: [Errno 9] Bad file descriptor

Any actions with it (eg, sending a book to the device) also produce the Bad file descriptor error.

This device previously worked fine with Calibre and this driver.

Steps to Reproduce

Steps to reproduce the behavior (as detailed as you can):

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Actual behaviour

A clear and concise description of the actual behaviour you observe. This may be a summary of the bug description.

Screenshots

If applicable, add screenshots to help explain your problem. If you are using calibre in any language other than English, please either provide a translation of any relevant text to English or switch calibre to use English first.

Logs

When running Calibre in debug mode, the issue does not present itself!

I have somewhat redacted this log to eliminate private information...

Using calibre Qt style: True
calibre Debug log
calibre 6.26  embedded-python: True
Linux-6.1.0-12-amd64-x86_64-with-glibc2.36 Linux ('64bit', 'ELF')
('Linux', '6.1.0-12-amd64', '#1 SMP PREEMPT_DYNAMIC Debian 6.1.52-1 (2023-09-07)')
Python 3.10.1
Interface language: None
logicalDpi: 96.0 x 96.0
physicalDpi: 92.89142857142856 x 93.78461538461538
[0.00] Starting up...
[0.00] Showing splash screen...
[0.05] splash screen shown
[0.05] Initializing db...
[0.17] db initialized
[0.17] Constructing main UI...
DEBUG:    0.0 Annotations plugin: Error loading libiMobileDevice. This hasn't worked for a while, and is blacklisted in calibre v3.
DEBUG:    0.0 Annotations plugin: Error is:  No module named 'calibre.devices.idevice'
DEBUG:    0.0 Annotations::reader_app_support.py - loading translations
DEBUG:    0.0 Annotations::common_utils.py - loading translations
DEBUG:    0.0 Annotations::appearance.py - loading translations
DEBUG:    0.0 Annotations::config.py - loading translations
DEBUG:    0.0 Annotations::annotated_books.py - loading translations
DEBUG:    0.0 Annotations::action.py - loading translations
DEBUG:    0.0 obok::utilities.py - loading translations
DEBUG:    0.0 obok::dialogs.py - loading translations
DEBUG:    0.0 obok::config.py - loading translations
DEBUG:    0.0 obok::action_err.py - loading translations
[0.68] main UI initialized...
[0.68] Hiding splash screen
Starting QuickView

Found device nodes: /dev/sda None None
Shortcut for 'Interface Action: Annotations (Annotations) - Find annotations' already registered by Find annotations
Job: 0 Get device information started
DeviceJob: 0 Get device information done, calling callback
DeviceJob: 0 Get device information callback returned
Job: 1 Set library information started
DeviceJob: 1 Set library information done, calling callback
DeviceJob: 1 Set library information callback returned
Job: 2 Get list of books on device started
DEBUG:    6.0 KoboTouch:books - oncard='None'
2023-09-21 07:14:48 [DEBUG] KoboTouchExtended:settings: settings= ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@2023-09-21 07:14:48 [DEBUG] <calibre.utils.config_base.OptionValues object at 0x7fcc38363b50>
DEBUG:    6.0 KoboTouch:books - oncard='None', prefix='/media/jgoerzen/KOBOeReader/'
DEBUG:    6.0 device_version_info - start
DEBUG:    6.0 device_version_info - version_file=/media/jgoerzen/KOBOeReader/.kobo/version
DEBUG:    6.0 device_version_info - have opened version_file
DEBUG:    6.0 device_version_info - self._device_version_info= ['N418273052008', '4.1.15', '4.38.21908', '4.1.15', '4.1.15', '00000000-0000-0000-0000-000000000388']
DEBUG:    6.0 Kobo device: Kobo Libra 2
DEBUG:    6.0 Version of driver: (3, 6, 6) Has kepubs: True
DEBUG:    6.0 Version of firmware: (4, 38, 21908) Has kepubs: True
DEBUG:    6.0 Firmware supports cover image tree: True
2023-09-21 07:14:48 [DEBUG] KoboTouchExtended:settings: settings= ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@2023-09-21 07:14:48 [DEBUG] <calibre.utils.config_base.OptionValues object at 0x7fcc881b5720>
DEBUG:    6.0 KoboTouch:books - opts.extra_customization= []
DEBUG:    6.0 KoboTouch:books - driver options= Driver:KoboTouchExtended, Options - format_map: ['kepub', 'cbr', 'cbz', 'txt', 'pdf', 'epub'], use_subdirs: True, read_metadata: True, use_author_sort: False, save_template: {author_sort}/{title} - {authors}, extra_customization: [], manage_collections: True, use_collections_columns: True, collections_columns: #collection, use_collections_template: False, collections_template: , create_collections: True, delete_empty_collections: True, ignore_collections_names: , upload_covers: True, dithered_covers: False, keep_cover_aspect: True, upload_grayscale: True, letterbox_fs_covers: False, letterbox_fs_covers_color: #000000, png_covers: False, show_archived_books: False, show_previews: False, show_recommendations: False, update_series: True, update_core_metadata: False, update_purchased_kepubs: False, update_device_metadata: True, update_subtitle: False, subtitle_template: , update_bookstats: False, bookstats_wordcount_template: , bookstats_pagecount_template: , bookstats_timetoread_upper_template: , bookstats_timetoread_lower_template: , modify_css: False, override_kobo_replace_existing: True, support_newer_firmware: False, debugging_title: , driver_version: 3.6.3, extra_features: True, use_template: False, kepubify_template: , upload_encumbered: False, skip_failed: False, hyphenate: False, smarten_punctuation: False, clean_markup: False, full_page_numbers: False, disable_hyphenation: False, file_copy_dir: , hyphenate_chars: 6, hyphenate_chars_before: 3, hyphenate_chars_after: 3, hyphenate_limit_lines: 2
DEBUG:    6.1 KoboTouch:books - prefs['manage_device_metadata']= manual
DEBUG:    6.1 KoboTouch:books - set_debugging_title to ''
DEBUG:    6.1 KoboTouch:books - length bl=0
DEBUG:    6.1 KoboTouch:books - length bl after sync=446
DEBUG:    6.1 KoboTouch:books - reading device database
DEBUG:    6.1 Database Version:  174
DEBUG:    6.1 KoboTouch:books - query= SELECT Title, Attribution, DateCreated, ContentID, MimeType, ContentType, ImageId, ReadStatus, Description, Publisher , ___ExpirationStatus, FavouritesIndex, Accessibility, Language, IsDownloaded, ISBN, Series, SeriesNumber, ___UserID, ExternalId, Subtitle, SeriesID, SeriesNumberFloat, StorePages, StoreWordCount, StoreTimeToReadLowerEstimate, StoreTimeToReadUpperEstimate FROM content  WHERE BookID IS NULL  AND ((Accessibility = -1 AND IsDownloaded in ('true', 1 ))       OR (Accessibility IN (1,2,8,9) and IsDownloaded in ('true', 1))         )  AND (externalId IS NULL OR externalId = '') AND contentId NOT LIKE 'file:///mnt/sd/%'
Job: 0 Get device information finished
No details available.
Job: 1 Set library information finished
No details available.
DEBUG:    6.2 KoboTouch:books - self.kobo_series_dict= {'Wizards': '5ad8a011-7a42-53a3-9ad6-2f4c27fe6642'}
DEBUG:    6.5 KoboTouch:books - about to sync_booklists
DEBUG:    6.5 USBMS: starting sync_booklists
DEBUG:    7.1 USBMS: finished sync_booklists
DEBUG:    7.1 KoboTouch:books - have done sync_booklists
DEBUG:    7.1 KoboTouch:books - end - oncard='None'
DEBUG:    7.1 KoboTouch:books - oncard='carda'
DEBUG:    7.1 KoboTouch:books - Asked to process 'carda', but do not have one!
DEBUG:    7.1 KoboTouch:books - oncard='cardb'
DEBUG:    7.1 KoboTouch:books - Asked to process 'cardb', but do not have one!
DeviceJob: 2 Get list of books on device done, calling callback
DeviceJob: metadata_downloaded: Starting set_books_in_library
DeviceJob: set_books_in_library: books to process= 446
Job: 2 Get list of books on device finished
No details available.
DeviceJob: set_books_in_library finished: time= 0.024939537048339844
DeviceJob: metadata_downloaded: updating views
DeviceJob: metadata_downloaded: syncing
2023-09-21 07:14:49 [DEBUG] KoboTouchExtended:settings: settings= ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@2023-09-21 07:14:49 [DEBUG] <calibre.utils.config_base.OptionValues object at 0x7fcc304f15a0>

Additional context

jgoerzen avatar Sep 21 '23 12:09 jgoerzen