Skip to content

DeDRM Conversion Issue KFX-ZIP file #989

@snarkylee

Description

@snarkylee

Question / bug report

Conversion from KFX file fails (details below). I tested with deDRM plugin V10.0.9 (RC1 for 10.1.0) and the alpha. I also tried the drag/drop and device import processes. All resulted in the KFX-ZIP file format.

Book

Device

  • Type = Kindle Paperwhite (11th Generation)
  • Firmeware Version = Kindle 5.19.2

Note - I did test other files that successfully transferred.

Which version of Calibre are you running?

9.7

Which version of the DeDRM plugin are you running?

v10.0.9

If applicable, which version of the Kindle software are you running?

Kindle 5.19.2

Log output

ApplicationPaletteChange event ignored
Using calibre Qt style: True
calibre Debug log
calibre 9.7  embedded-python: True
macOS-26.3.1-arm64-arm-64bit-Mach-O Darwin ('64bit', 'Mach-O')
('Darwin', '25.3.0', 'Darwin Kernel Version 25.3.0: Wed Jan 28 20:54:46 PST 2026; root:xnu-12377.91.3~2/RELEASE_ARM64_T6000')
Python 3.14.2
OSX: ('26.3.1', ('', '', ''), 'arm64')
Interface language: None
EXE path: /Applications/calibre.app/Contents/MacOS/calibre-debug
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (2, 30, 0) && DeDRM (10, 0, 9) && Package KFX (from KFX Input) (2, 30, 0) && KFX metadata reader (from KFX Input) (2, 30, 0) && From KFX (2, 30, 0) && KFX Input (2, 30, 0)
calibre 9.7  embedded-python: True
macOS-26.3.1-arm64-arm-64bit-Mach-O Darwin ('64bit', 'Mach-O')
('Darwin', '25.3.0', 'Darwin Kernel Version 25.3.0: Wed Jan 28 20:54:46 PST 2026; root:xnu-12377.91.3~2/RELEASE_ARM64_T6000')
Python 3.14.2
OSX: ('26.3.1', ('', '', ''), 'arm64')
Interface language: None
EXE path: /Applications/calibre.app/Contents/MacOS/calibre-debug
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (2, 30, 0) && DeDRM (10, 0, 9) && Package KFX (from KFX Input) (2, 30, 0) && KFX metadata reader (from KFX Input) (2, 30, 0) && From KFX (2, 30, 0) && KFX Input (2, 30, 0)
QPA platform: cocoa
devicePixelRatio: 2.0
logicalDpi: 72.0 x 72.0
physicalDpi: 96.00000144177535 x 95.00000142675685
[0.00] Starting up...
[0.03] Showing splash screen...
[1.22] splash screen shown
[1.22] Initializing db...
[1.23] db initialized
[1.23] Constructing main UI...
[1.85] GUI main window shown
[1.90] main UI initialized...
[1.90] Hiding splash screen
[1.92] splash screen hidden
[1.92] Started up in 1.92 seconds with 2 books
Failed to request permission for showing notification: The operation couldn’t be completed. (UNErrorDomain error 1.)
Failed to request permission for showing notification: The operation couldn’t be completed. (UNErrorDomain error 1.)
Gather KFX-ZIP (from KFX Input) 2.30.0: Importing /private/var/folders/p0/twwy0gcj0kl90k35dzt6h8zw0000gn/C/calibre-_n7cax8k/0vzq9x73_view_device_book.kfx
Gather KFX-ZIP (from KFX Input): Cannot locate some files needed for the book. KFX files must remain in their original folder structure for successful import. 
Gather KFX-ZIP (from KFX Input): Gathered 1 file(s) as /var/folders/p0/twwy0gcj0kl90k35dzt6h8zw0000gn/C/calibre-_n7cax8k/3_b8b5pd.kfx-zip
DeDRM v10.0.9: Trying to decrypt 3_b8b5pd.kfx-zip
Decrypting KFX-ZIP ebook: 3_b8b5pd
Found 1 keys to try after 0.4 seconds
DeDRM v10.0.9: Failed to decrypt with error: The .kfx-zip archive contains an encrypted DRMION file without a DRM voucher
DeDRM v10.0.9: Looking for new default Kindle Key after 0.4 seconds
No k4Mac kindle-info/rainier/kinf2011 files have been found.
DeDRM v10.0.9: Ultimately failed to decrypt after 0.4 seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md
Running file type plugin DeDRM failed with traceback:
Traceback (most recent call last):
  File "calibre_plugins.dedrm.__init__", line 931, in KindleMobiDecrypt
    book = k4mobidedrm.GetDecryptedBook(path_to_ebook,kindleDatabases,androidFiles,serials,pids,self.starttime)
  File "/Users/sarah/Library/Preferences/calibre/plugins/DeDRM.zip/k4mobidedrm.py", line 203, in GetDecryptedBook
    mb.processBook(totalpids)
    ~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/Users/sarah/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 67, in processBook
    self.decrypt_voucher(totalpids)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/Users/sarah/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 88, in decrypt_voucher
    raise Exception("The .kfx-zip archive contains an encrypted DRMION file without a DRM voucher")
Exception: The .kfx-zip archive contains an encrypted DRMION file without a DRM voucher

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "calibre/customize/ui.py", line 236, in _run_filetype_plugins
  File "calibre_plugins.dedrm.__init__", line 1030, in run
    decrypted_ebook = self.KindleMobiDecrypt(path_to_ebook)
  File "calibre_plugins.dedrm.__init__", line 981, in KindleMobiDecrypt
    raise DeDRMError("{0} v{1}: Ultimately failed to decrypt after {2:.1f} seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md".format(PLUGIN_NAME, PLUGIN_VERSION,time.time()-self.starttime))
calibre_plugins.dedrm.DeDRMError: DeDRM v10.0.9: Ultimately failed to decrypt after 0.4 seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md
Package KFX (from KFX Input) 2.30.0: Packaging /var/folders/p0/twwy0gcj0kl90k35dzt6h8zw0000gn/C/calibre-_n7cax8k/3_b8b5pd.kfx-zip
Processing container: 0vzq9x73_view_device_book.kfx
Running file type plugin Package KFX (from KFX Input) failed with traceback:
Traceback (most recent call last):
  File "calibre/customize/ui.py", line 236, in _run_filetype_plugins
  File "calibre_plugins.kfx_input.package_filetype", line 23, in run
    return self.package_kfx(path_to_ebook)
           ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "calibre_plugins.kfx_input.package_filetype", line 34, in package_kfx
    kfx_data = YJ_Book(path_to_ebook).convert_to_single_kfx()
  File "calibre_plugins.kfx_input.kfxlib.yj_book", line 79, in convert_to_single_kfx
    self.decode_book()
    ~~~~~~~~~~~~~~~~^^
  File "calibre_plugins.kfx_input.kfxlib.yj_book", line 213, in decode_book
    container = self.get_container(datafile)
  File "calibre_plugins.kfx_input.kfxlib.yj_book", line 331, in get_container
    raise KFXDRMError("Book container %s has DRM and cannot be converted" % datafile.name)
calibre_plugins.kfx_input.kfxlib.utilities.KFXDRMError: Book container 0vzq9x73_view_device_book.kfx has DRM and cannot be converted
KFX metadata reader (from KFX Input) activated for /var/folders/p0/twwy0gcj0kl90k35dzt6h8zw0000gn/C/calibre-_n7cax8k/uhkerhlg_add_books/0/0vzq9x73_view_device_book.kfx-zip
Traceback (most recent call last):
  File "calibre/customize/ui.py", line 530, in get_file_type_metadata
  File "calibre_plugins.kfx_input.metadata_reader", line 28, in get_metadata
    md = YJ_Book(stream).get_metadata()
  File "calibre_plugins.kfx_input.kfxlib.yj_book", line 151, in get_metadata
    raise Exception("Failed to locate a KFX container with metadata")
Exception: Failed to locate a KFX container with metadata
Failed to request permission for showing notification: The operation couldn’t be completed. (UNErrorDomain error 1.)

{'bsd_drives': {'main': '/dev/disk6'},
 'drives': {'main': '/Volumes/Kindle'},
 'mount_map': {'/dev/disk1s1': '/System/Volumes/iSCPreboot',
               '/dev/disk1s2': '/System/Volumes/xarts',
               '/dev/disk1s3': '/System/Volumes/Hardware',
               '/dev/disk3s1s1': '/',
               '/dev/disk3s2': '/System/Volumes/Preboot',
               '/dev/disk3s4': '/System/Volumes/Update',
               '/dev/disk3s5': '/System/Volumes/Data',
               '/dev/disk3s6': '/System/Volumes/VM',
               '/dev/disk5s1': '/Volumes/calibre-9.7.0',
               '/dev/disk6': '/Volumes/Kindle',
               'devfs': '/dev',
               'map auto_home': '/System/Volumes/Data/home'}}
Syncing cover thumbnails to workaround amazon cover bug
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:    0.0 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= None
DEBUG:    0.0 USBMS: dirs are: /Volumes/Kindle/ documents
DEBUG:    0.0 USBMS: scan from root False /Volumes/Kindle/documents
DEBUG:    0.4 USBMS: count found in cache: 164, count of files in metadata: 164, need_sync: False
DEBUG:    0.4 USBMS: Finished fetching list of books from device. oncard= None
DEBUG:    0.4 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= carda
DEBUG:    0.4 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= cardb
DeviceJob: 2 Get list of books on device done, calling callback
DEBUG:    0.4 DeviceJob: metadata_downloaded: Starting set_books_in_library
DEBUG:    0.4 DeviceJob: set_books_in_library: books to process= 164
DEBUG:    0.4 DeviceJob: set_books_in_library finished: time= 0.0034220218658447266
DEBUG:    0.4 DeviceJob: metadata_downloaded: updating views
DEBUG:    0.4 DeviceJob: metadata_downloaded: syncing
DEBUG:    0.4 DeviceJob: metadata_downloaded: refreshing ondevice
DEBUG:    0.4 DeviceJob: metadata_downloaded: sending metadata_available signal
DeviceJob: 2 Get list of books on device callback returned
Job: 0 Get device information finished
No details available.
Job: 2 Get list of books on device finished
No details available.
Job: 1 Set library information finished
No details available.
Job: 3 View book on device started
DeviceJob: 3 View book on device done, calling callback
DeviceJob: 3 View book on device callback returned
Job: 3 View book on device finished
No details available.
Added 1 books in 1.0 seconds
Gather KFX-ZIP (from KFX Input) 2.30.0: Importing /Volumes/Kindle/documents/Downloads/Items01/Everyday Crochet_ The Complete Beginner's Guide_ 15+ Cozy Patterns_B0B1HD7DDH.kfx
Job: 4 Upload one book to the device: 0vzq9x73 view device book started
Device using plugboard kfx-zip KINDLE2 None
Setting metadata in: 0vzq9x73 view device book at: /var/folders/p0/twwy0gcj0kl90k35dzt6h8zw0000gn/C/calibre-_n7cax8k/uhkerhlg_add_books/0/0vzq9x73_view_device_book.kfx-zip
DEBUG:   38.6 USBMS: uploading 1 books
DEBUG:   38.6 USBMS: finished uploading 1 books
DeviceJob: 4 Upload one book to the device: 0vzq9x73 view device book done, calling callback
DEBUG:   38.6 USBMS: adding metadata for 1 books
DEBUG:   38.6 USBMS: finished adding metadata
DEBUG:   38.6 DeviceJob: set_books_in_library: books to process= 165
DEBUG:   38.6 DeviceJob: set_books_in_library finished: time= 0.005571842193603516
DeviceJob: 4 Upload one book to the device: 0vzq9x73 view device book callback returned
Job: 5 Send metadata to device started
DEBUG:   38.6 USBMS: starting sync_booklists
DEBUG:   38.7 USBMS: finished sync_booklists
DeviceJob: 5 Send metadata to device done, calling callback
DeviceJob: 5 Send metadata to device callback returned
Job: 4 Upload one book to the device: 0vzq9x73 view device book finished
No details available.
Job: 5 Send metadata to device finished
No details available.
Job: 6 Prepare files for transfer from device started
DeviceJob: 6 Prepare files for transfer from device done, calling callback
DeviceJob: 6 Prepare files for transfer from device callback returned
Gather KFX-ZIP (from KFX Input): Gathered 18 file(s) as /var/folders/p0/twwy0gcj0kl90k35dzt6h8zw0000gn/C/calibre-_n7cax8k/mufwi794.kfx-zip
DeDRM v10.0.9: Trying to decrypt mufwi794.kfx-zip
Decrypting KFX-ZIP ebook: mufwi794
Found 1 keys to try after 0.4 seconds
Decrypting KFX DRM voucher: voucher
Traceback (most recent call last):
  File "/Users/sarah/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 104, in decrypt_voucher
    voucher.parse()
    ~~~~~~~~~~~~~^^
  File "/Users/sarah/Library/Preferences/calibre/plugins/DeDRM.zip/ion.py", line 1394, in parse
    _assert(self.envelope.next() == TID_STRUCT and str.startswith(self.envelope.gettypename(), "com.amazon.drm.VoucherEnvelope@"),
    ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            "Unknown type encountered in envelope, expected VoucherEnvelope")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sarah/Library/Preferences/calibre/plugins/DeDRM.zip/ion.py", line 103, in _assert
    raise Exception(msg)
Exception: Unknown type encountered in envelope, expected VoucherEnvelope
Traceback (most recent call last):
  File "/Users/sarah/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 104, in decrypt_voucher
    voucher.parse()
    ~~~~~~~~~~~~~^^
  File "/Users/sarah/Library/Preferences/calibre/plugins/DeDRM.zip/ion.py", line 1394, in parse
    _assert(self.envelope.next() == TID_STRUCT and str.startswith(self.envelope.gettypename(), "com.amazon.drm.VoucherEnvelope@"),
    ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            "Unknown type encountered in envelope, expected VoucherEnvelope")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sarah/Library/Preferences/calibre/plugins/DeDRM.zip/ion.py", line 103, in _assert
    raise Exception(msg)
Exception: Unknown type encountered in envelope, expected VoucherEnvelope
DeDRM v10.0.9: Failed to decrypt with error: Failed to decrypt KFX DRM voucher with any key
DeDRM v10.0.9: Looking for new default Kindle Key after 0.4 seconds
No k4Mac kindle-info/rainier/kinf2011 files have been found.
DeDRM v10.0.9: Ultimately failed to decrypt after 0.4 seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md
Running file type plugin DeDRM failed with traceback:
Traceback (most recent call last):
  File "calibre_plugins.dedrm.__init__", line 931, in KindleMobiDecrypt
    book = k4mobidedrm.GetDecryptedBook(path_to_ebook,kindleDatabases,androidFiles,serials,pids,self.starttime)
  File "/Users/sarah/Library/Preferences/calibre/plugins/DeDRM.zip/k4mobidedrm.py", line 203, in GetDecryptedBook
    mb.processBook(totalpids)
    ~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/Users/sarah/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 67, in processBook
    self.decrypt_voucher(totalpids)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/Users/sarah/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 111, in decrypt_voucher
    raise Exception("Failed to decrypt KFX DRM voucher with any key")
Exception: Failed to decrypt KFX DRM voucher with any key

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "calibre/customize/ui.py", line 236, in _run_filetype_plugins
  File "calibre_plugins.dedrm.__init__", line 1030, in run
    decrypted_ebook = self.KindleMobiDecrypt(path_to_ebook)
  File "calibre_plugins.dedrm.__init__", line 981, in KindleMobiDecrypt
    raise DeDRMError("{0} v{1}: Ultimately failed to decrypt after {2:.1f} seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md".format(PLUGIN_NAME, PLUGIN_VERSION,time.time()-self.starttime))
calibre_plugins.dedrm.DeDRMError: DeDRM v10.0.9: Ultimately failed to decrypt after 0.4 seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md
Package KFX (from KFX Input) 2.30.0: Packaging /var/folders/p0/twwy0gcj0kl90k35dzt6h8zw0000gn/C/calibre-_n7cax8k/mufwi794.kfx-zip
Processing container: CR!50M0YSVJ597MQ43PZV3WBDMRCK37.kfx
Processing container: CR!8M51Z62AK11MN45R5PC0AMVB5NXA.kfx
Processing container: CR!DG6J850HN13M91MSGE5MFM9SBQA7.kfx
Processing container: CR!EA4H65KB0D0894K7NMEA175J34JF.kfx
Processing container: CR!ESJA1YCCNN2XX5YKDD11PG4JS13R.kfx
Processing container: CR!EWR94SBYED22D91PVB2S541VHGAC.kfx
Processing container: CR!FFSXWHBT2X71N9SMMGZ14FWM6QWW.kfx
Processing container: CR!HKBF8Z9TA54RKFJBCEEW8GYATYDN.kfx
Processing container: CR!J0G85QBWCH40HBNA0SV8QEGA51DW.kfx
Processing container: CR!PSMV3E37E11MF82XPHHW5CXG2FHK.kfx
Processing container: CR!SX8AEN235N089F5EBJ1R3ZMCY2ZK.kfx
Processing container: CR!T1G657GRYH14H64FY6WPAWG0FHYX.kfx
Processing container: CR!X17BBYF6GH6MN8H602B4SNXY2HY2.kfx
Processing container: CR!YT01ESEG2X1A70111F1EESHS1NZQ.kfx
Processing container: CR!ZG25H1HC2N5SK3RQPB9ATTXJJPZC.kfx
Processing container: Everyday Crochet_ The Complete Beginner's Guide_ 15+ Cozy Patterns_B0B1HD7DDH.kfx
Running file type plugin Package KFX (from KFX Input) failed with traceback:
Traceback (most recent call last):
  File "calibre/customize/ui.py", line 236, in _run_filetype_plugins
  File "calibre_plugins.kfx_input.package_filetype", line 23, in run
    return self.package_kfx(path_to_ebook)
           ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "calibre_plugins.kfx_input.package_filetype", line 34, in package_kfx
    kfx_data = YJ_Book(path_to_ebook).convert_to_single_kfx()
  File "calibre_plugins.kfx_input.kfxlib.yj_book", line 79, in convert_to_single_kfx
    self.decode_book()
    ~~~~~~~~~~~~~~~~^^
  File "calibre_plugins.kfx_input.kfxlib.yj_book", line 213, in decode_book
    container = self.get_container(datafile)
  File "calibre_plugins.kfx_input.kfxlib.yj_book", line 331, in get_container
    raise KFXDRMError("Book container %s has DRM and cannot be converted" % datafile.name)
calibre_plugins.kfx_input.kfxlib.utilities.KFXDRMError: Book container Everyday Crochet_ The Complete Beginner's Guide_ 15+ Cozy Patterns_B0B1HD7DDH.kfx has DRM and cannot be converted
KFX metadata reader (from KFX Input) activated for /var/folders/p0/twwy0gcj0kl90k35dzt6h8zw0000gn/C/calibre-_n7cax8k/qkkfoms2_add_books/0/Everyday Crochet_ The Complete Beginner's Guide_ 15+ Cozy Patterns_B0B1HD7DDH.kfx-zip
Failed to count pages in book: 9 KFX-ZIP because it is DRM locked
Job: 6 Prepare files for transfer from device finished
No details available.
Added Everyday Crochet: The Complete Beginner's Guide to db in: 0.0
Added 1 books in 2.8 seconds
DEBUG:  101.6 DeviceJob: set_books_in_library: books to process= 165
DEBUG:  101.6 DeviceJob: set_books_in_library finished: time= 0.006356000900268555
[296.99] Shutdown starting...
[297.01] Shutdown message shown...
[297.01] Grid view shutdown
[297.01] Bookshelf view shutdown
[297.01] Actions shutdown
[297.21] Various services shutdown
[297.21] Metadata backup shutdown
[297.35] Current database closed
[297.35] Windows hidden
[297.36] Waiting for overseers, mdns, and live to shutdown
[297.36] Waiting for device manager to shutdown
[297.36] Shutdown complete in 0.37, quitting...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions