Unable to send book to device

Asked by Clara Wallace

No ability to send books to android device. When I try to set preferences to send book to devices I get the following error

calibre, version 6.11.0
ERROR: Unhandled exception: <b>TypeError</b>:SaveTemplate.__init__() got an unexpected keyword argument 'parent'

calibre 6.11 embedded-python: False
Linux-6.2.0-31-generic-x86_64-with-glibc2.37 Linux ('64bit', 'ELF')
('Linux', '6.2.0-31-generic', '#31-Ubuntu SMP PREEMPT_DYNAMIC Mon Aug 14 13:42:26 UTC 2023')
Python 3.11.4
Interface language: None
Traceback (most recent call last):
  File "/usr/lib/calibre/calibre/gui2/preferences/main.py", line 308, in show_plugin
    self.showing_widget = plugin.create_widget(self.scroll_area)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/calibre/calibre/customize/__init__.py", line 675, in create_widget
    return widget(parent)
           ^^^^^^^^^^^^^^
  File "/usr/lib/calibre/calibre/gui2/preferences/__init__.py", line 267, in __init__
    self.setupUi(self)
  File "/usr/lib/calibre/calibre/gui2/preferences/sending_ui.py", line 49, in setupUi
    self.send_template = SaveTemplate(parent=Form)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: SaveTemplate.__init__() got an unexpected keyword argument 'parent'

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu calibre Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

Revision history for this message
Clara Wallace (clara62) said :
#1

Debug Log

Using calibre Qt style: True
libusb_claim_interface() reports device is busy, likely in use by GVFS or KDE MTP device handling alreadyLIBMTP PANIC: Unable to initialize device
Traceback (most recent call last):
  File "/usr/lib/calibre/calibre/devices/mtp/unix/driver.py", line 214, in open
    self.dev = self.create_device(connected_device)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/calibre/calibre/devices/mtp/base.py", line 24, in synchronizer
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/calibre/calibre/devices/mtp/unix/driver.py", line 166, in create_device
    return self.libmtp.Device(d.busnum, d.devnum, d.vendor_id,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
libmtp.MTPError: Unable to open MTP device with busnum=1 and devnum=10, tried 1 such devices

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/calibre/calibre/gui2/device.py", line 325, in detect_device
    dev.open(cd, self.current_library_uuid)
  File "/usr/lib/calibre/calibre/devices/mtp/driver.py", line 127, in open
    BASE.open(self, device, library_uuid)
  File "/usr/lib/calibre/calibre/devices/mtp/base.py", line 24, in synchronizer
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/calibre/calibre/devices/mtp/unix/driver.py", line 217, in open
    raise OpenFailed('Failed to open %s: Error: %s'%(
calibre.devices.errors.OpenFailed: Failed to open MTPDevice(busnum=1, devnum=10, vendor_id=1256, product_id=26720, bcd=1284, serial='R52T30A6QST', manufacturer='SAMSUNG', product='SAMSUNG_Android'): Error: Unable to open MTP device with busnum=1 and devnum=10, tried 1 such devices
calibre Debug log
calibre 6.11 embedded-python: False
Linux-6.2.0-31-generic-x86_64-with-glibc2.37 Linux ('64bit', 'ELF')
('Linux', '6.2.0-31-generic', '#31-Ubuntu SMP PREEMPT_DYNAMIC Mon Aug 14 13:42:26 UTC 2023')
Python 3.11.4
Interface language: None
calibre 6.11 embedded-python: False
Linux-6.2.0-31-generic-x86_64-with-glibc2.37 Linux ('64bit', 'ELF')
('Linux', '6.2.0-31-generic', '#31-Ubuntu SMP PREEMPT_DYNAMIC Mon Aug 14 13:42:26 UTC 2023')
Python 3.11.4
Interface language: None
QPA platform: xcb
devicePixelRatio: 1.0
logicalDpi: 96.0 x 96.0
physicalDpi: 127.66492146596858 x 127.59069767441859
[0.00] Starting up...
[0.00] Showing splash screen...
[0.04] splash screen shown
[0.04] Initializing db...
[0.59] db initialized
[0.59] Constructing main UI...
Screens currently in system:
{'depth': 24,
 'device_pixel_ratio': 1.0,
 'geometry_in_logical_pixels': {'height': 1080, 'width': 1920, 'x': 0, 'y': 0},
 'index_in_screens_list': 0,
 'manufacturer': 'LGD',
 'model': '',
 'name': 'eDP-1',
 'serial': '',
 'size_in_logical_pixels': {'height': 1080, 'width': 1920},
 'virtual_geometry': {'height': 1080, 'width': 1920, 'x': 0, 'y': 0}}
Restoring geometry for: calibre_main_window_geometry
{'frame_geometry': {'height': 862, 'width': 1717, 'x': 53, 'y': 545},
 'full_screened': False,
 'geometry': {'height': 825, 'width': 1717, 'x': 53, 'y': 582},
 'maximized': False,
 'normal_geometry': {'height': 825, 'width': 1717, 'x': 53, 'y': 582},
 'screen': {'depth': 24,
            'device_pixel_ratio': 1.0,
            'geometry_in_logical_pixels': {'height': 1080,
                                           'width': 1920,
                                           'x': 0,
                                           'y': 0},
            'index_in_screens_list': 0,
            'manufacturer': 'LGD',
            'model': '',
            'name': 'eDP-1',
            'serial': '',
            'size_in_logical_pixels': {'height': 1080, 'width': 1920},
            'virtual_geometry': {'height': 1080,
                                 'width': 1920,
                                 'x': 0,
                                 'y': 0}}}
Matching screen: {'depth': 24,
 'device_pixel_ratio': 1.0,
 'geometry_in_logical_pixels': {'height': 1080, 'width': 1920, 'x': 0, 'y': 0},
 'index_in_screens_list': 0,
 'manufacturer': 'LGD',
 'model': '',
 'name': 'eDP-1',
 'serial': '',
 'size_in_logical_pixels': {'height': 1080, 'width': 1920},
 'virtual_geometry': {'height': 1080, 'width': 1920, 'x': 0, 'y': 0}}
Setting widget geometry to: {'height': 825, 'width': 1717, 'x': 53, 'y': 582}
Error while trying to open MTPDevice(busnum=1, devnum=10, vendor_id=1256, product_id=26720, bcd=1284, serial='R52T30A6QST', manufacturer='SAMSUNG', product='SAMSUNG_Android') (Driver: <calibre.devices.mtp.driver.MTP_DEVICE object at 0x7fdfb6268710>)
[1.49] main UI initialized...
[1.49] Hiding splash screen
Starting QuickView
calibre 6.11 embedded-python: False
Linux-6.2.0-31-generic-x86_64-with-glibc2.37 Linux ('64bit', 'ELF')
('Linux', '6.2.0-31-generic', '#31-Ubuntu SMP PREEMPT_DYNAMIC Mon Aug 14 13:42:26 UTC 2023')
Python 3.11.4
Interface language: None
Traceback (most recent call last):
  File "/usr/lib/calibre/calibre/gui2/preferences/main.py", line 308, in show_plugin
    self.showing_widget = plugin.create_widget(self.scroll_area)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/calibre/calibre/customize/__init__.py", line 675, in create_widget
    return widget(parent)
           ^^^^^^^^^^^^^^
  File "/usr/lib/calibre/calibre/gui2/preferences/__init__.py", line 267, in __init__
    self.setupUi(self)
  File "/usr/lib/calibre/calibre/gui2/preferences/sending_ui.py", line 49, in setupUi
    self.send_template = SaveTemplate(parent=Form)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: SaveTemplate.__init__() got an unexpected keyword argument 'parent'

[9.47] splash screen hidden
[9.47] Started up in 9.47 seconds with 13034 books
Restoring geometry for: preferences dialog geometry
{'frame_geometry': {'height': 757, 'width': 930, 'x': 446, 'y': 271},
 'full_screened': False,
 'geometry': {'height': 720, 'width': 930, 'x': 446, 'y': 308},
 'maximized': False,
 'normal_geometry': {'height': 720, 'width': 930, 'x': 446, 'y': 308},
 'screen': {'depth': 24,
            'device_pixel_ratio': 1.0,
            'geometry_in_logical_pixels': {'height': 1080,
                                           'width': 1920,
                                           'x': 0,
                                           'y': 0},
            'index_in_screens_list': 0,
            'manufacturer': 'LGD',
            'model': '',
            'name': 'eDP-1',
            'serial': '',
            'size_in_logical_pixels': {'height': 1080, 'width': 1920},
            'virtual_geometry': {'height': 1080,
                                 'width': 1920,
                                 'x': 0,
                                 'y': 0}}}
Matching screen: {'depth': 24,
 'device_pixel_ratio': 1.0,
 'geometry_in_logical_pixels': {'height': 1080, 'width': 1920, 'x': 0, 'y': 0},
 'index_in_screens_list': 0,
 'manufacturer': 'LGD',
 'model': '',
 'name': 'eDP-1',
 'serial': '',
 'size_in_logical_pixels': {'height': 1080, 'width': 1920},
 'virtual_geometry': {'height': 1080, 'width': 1920, 'x': 0, 'y': 0}}
Setting widget geometry to: {'height': 720, 'width': 930, 'x': 446, 'y': 308}
Saving geometry for: preferences dialog geometry
{'frame_geometry': {'height': 757, 'width': 930, 'x': 446, 'y': 219},
 'full_screened': False,
 'geometry': {'height': 720, 'width': 930, 'x': 446, 'y': 256},
 'maximized': False,
 'normal_geometry': {'height': 720, 'width': 930, 'x': 446, 'y': 256},
 'screen': {'depth': 24,
            'device_pixel_ratio': 1.0,
            'geometry_in_logical_pixels': {'height': 1080,
                                           'width': 1920,
                                           'x': 0,
                                           'y': 0},
            'index_in_screens_list': 0,
            'manufacturer': 'LGD',
            'model': '',
            'name': 'eDP-1',
            'serial': '',
            'size_in_logical_pixels': {'height': 1080, 'width': 1920},
            'virtual_geometry': {'height': 1080,
                                 'width': 1920,
                                 'x': 0,
                                 'y': 0}}}
SMART_DEV ( 0.00: 0.001) _attach_to_port try ip address "" on port 9090
SMART_DEV ( 0.84: 0.809) _startup_on_demand listening on port 9090
SMART_DEV ( 0.85: 0.001) _attach_to_port try ip address "" on port 54982
SMART_DEV ( 0.85: 0.000) _startup_on_demand broadcast socket listening on port 54982
SMART_DEV ( 1.85: 1.004) run All IP addresses {'lo': [{'addr': '127.0.0.1', 'netmask': '255.0.0.0', 'peer': '127.0.0.1'}], 'wlp2s0': [{'addr': '192.168.68.69', 'netmask': '255.255.252.0', 'broadcast': '192.168.71.255'}]}
Saving geometry for: calibre_main_window_geometry
{'frame_geometry': {'height': 862, 'width': 1717, 'x': 53, 'y': 166},
 'full_screened': False,
 'geometry': {'height': 825, 'width': 1717, 'x': 53, 'y': 203},
 'maximized': False,
 'normal_geometry': {'height': 825, 'width': 1717, 'x': 53, 'y': 203},
 'screen': {'depth': 24,
            'device_pixel_ratio': 1.0,
            'geometry_in_logical_pixels': {'height': 1080,
                                           'width': 1920,
                                           'x': 0,
                                           'y': 0},
            'index_in_screens_list': 0,
            'manufacturer': 'LGD',
            'model': '',
            'name': 'eDP-1',
            'serial': '',
            'size_in_logical_pixels': {'height': 1080, 'width': 1920},
            'virtual_geometry': {'height': 1080,
                                 'width': 1920,
                                 'x': 0,
                                 'y': 0}}}
Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).

Revision history for this message
Clara Wallace (clara62) said :
#2

I reinstalled Calibre and the issue with configuring preferences for sending book to device now works. I am still unable to send books to a device as Calibre reports the

libusb_claim_interface() reports device is busy, likely in use by GVFS or KDE MTP device handling alreadyLIBMTP PANIC: Unable to initialize device
I can connect to the device through other means so not sure if this is an Ubuntu issue, a device issue, or a Calibre issue. I will keep trying

Revision history for this message
Clara Wallace (clara62) said :
#3

I found a solution
Plug the device in, then unmount it, then start Calibre

Revision history for this message
Clara Wallace (clara62) said :
#4

I found a solution
Plug the device in, then unmount it, then start Calibre

Revision history for this message
samjames (samjames12) said :
#5
Revision history for this message
sobbialex (sobbialex) said :
#6

The error message indicates that the SaveTemplate.__init__() function is not expecting the parent keyword argument. This is likely due to a bug in the Calibre software.

There are a few things you can try to fix the issue:

Upgrade to the latest version of Calibre. The bug may have been fixed in a newer release.
Try disabling any Calibre plugins that you are not using. It is possible that one of the plugins is causing the error.
Reset Calibre's preferences to their default values. This may fix any corrupted settings that are causing the problem.
If you are still having problems, you can try reporting the bug to the Calibre developers.
To reset Calibre's preferences to their default values:

Close Calibre.
Go to the Calibre configuration folder. On Linux, this is typically located at ~/.config/calibre.
Delete the preferences.json file.
Restart Calibre.
If you are unable to fix the issue, you can still send books to your Android device by using a different method. For example, you can copy the books to your device manually, or you can use a cloud storage service such as Google Drive.

Here are some instructions on how to send books to your Android device using Google Drive:

Connect your Android device to the same Wi-Fi network as your computer.
Open Google Drive on your computer.
Upload the books that you want to send to your device to Google Drive.
Open Google Drive on your Android device.
Tap on the books that you want to download to your device.
Tap on the three dots in the top right corner of the screen.
Tap on "Make available offline".
The books will be downloaded to your device and will be available to read in the Google Play Books app. by https://www.crescent-builders.co.uk/

Can you help with this problem?

Provide an answer of your own, or ask Clara Wallace for more information if necessary.

To post a message you must log in.