Leseratte10 / acsm-calibre-plugin

Calibre plugin for ACSM->EPUB and ACSM->PDF conversion.
https://www.mobileread.com/forums/showthread.php?t=341975
GNU General Public License v3.0
695 stars 24 forks source link

Installation failed: Invalid plugin #65

Closed Maragues closed 1 year ago

Maragues commented 1 year ago

Bug description

I had a working installation of DeACSM. For some reason, it stopped working. The plugin wasn't even listed in Preferences.

I tried to reinstall and I get the error trace pasted below.

I also tried reinstalling Calibre, without success. I could install DeDRM without issues.

Thank you very much!

Operating system

MacOS

Which version of Calibre are you running?

6.26.0

Which version of the ACSM Input plugin are you running?

0.0.16

Import type

No response

Further information

Error trace

calibre, version 6.26.0
ERROR: Unhandled exception: <b>InvalidPlugin</b>:Initialization of plugin Traceback (most recent call last):
  File "calibre/customize/ui.py", line 710, in initialize_plugin
  File "calibre_plugins.deacsm.__init__", line 226, in initialize
    from libadobe import createDeviceKeyFile, update_account_path, sendHTTPRequest
  File "/Users/myuser/Downloads/DeACSM_0.0.16.zip/libadobe.py", line 59, in &lt;module&gt;
    from oscrypto import keys
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/keys.py", line 5, in &lt;module&gt;
    from ._asymmetric import parse_certificate, parse_private, parse_public
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_asymmetric.py", line 27, in &lt;module&gt;
    from .kdf import pbkdf1, pbkdf2, pkcs12_kdf
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/kdf.py", line 9, in &lt;module&gt;
    from .util import rand_bytes
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/util.py", line 10, in &lt;module&gt;
    from ._mac.util import rand_bytes
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_mac/util.py", line 208, in &lt;module&gt;
    from .._openssl._libcrypto import libcrypto
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_openssl/_libcrypto.py", line 24, in &lt;module&gt;
    from ._libcrypto_ctypes import (
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_openssl/_libcrypto_ctypes.py", line 30, in &lt;module&gt;
    libcrypto = CDLL(libcrypto_path, use_errno=True)
  File "ctypes/__init__.py", line 374, in __init__
OSError: dlopen(/usr/local/lib/libcrypto.dylib, 0x0006): tried: '/usr/local/lib/libcrypto.dylib' (code signature in &lt;C293C93B-A7B7-3A18-9E0A-711F1BDD5B50&gt; '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/libcrypto.dylib' (no such file), '/usr/local/lib/libcrypto.dylib' (code signature in &lt;C293C93B-A7B7-3A18-9E0A-711F1BDD5B50&gt; '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' (code signature in &lt;C293C93B-A7B7-3A18-9E0A-711F1BDD5B50&gt; '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' (no such file), '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' (code signature in &lt;C293C93B-A7B7-3A18-9E0A-711F1BDD5B50&gt; '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.)
 failed with traceback:
Traceback (most recent call last):
  File "calibre/customize/ui.py", line 710, in initialize_plugin
  File "calibre_plugins.deacsm.__init__", line 226, in initialize
    from libadobe import createDeviceKeyFile, update_account_path, sendHTTPRequest
  File "/Users/myuser/Downloads/DeACSM_0.0.16.zip/libadobe.py", line 59, in &lt;module&gt;
    from oscrypto import keys
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/keys.py", line 5, in &lt;module&gt;
    from ._asymmetric import parse_certificate, parse_private, parse_public
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_asymmetric.py", line 27, in &lt;module&gt;
    from .kdf import pbkdf1, pbkdf2, pkcs12_kdf
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/kdf.py", line 9, in &lt;module&gt;
    from .util import rand_bytes
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/util.py", line 10, in &lt;module&gt;
    from ._mac.util import rand_bytes
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_mac/util.py", line 208, in &lt;module&gt;
    from .._openssl._libcrypto import libcrypto
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_openssl/_libcrypto.py", line 24, in &lt;module&gt;
    from ._libcrypto_ctypes import (
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_openssl/_libcrypto_ctypes.py", line 30, in &lt;module&gt;
    libcrypto = CDLL(libcrypto_path, use_errno=True)
  File "ctypes/__init__.py", line 374, in __init__
OSError: dlopen(/usr/local/lib/libcrypto.dylib, 0x0006): tried: '/usr/local/lib/libcrypto.dylib' (code signature in &lt;C293C93B-A7B7-3A18-9E0A-711F1BDD5B50&gt; '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/libcrypto.dylib' (no such file), '/usr/local/lib/libcrypto.dylib' (code signature in &lt;C293C93B-A7B7-3A18-9E0A-711F1BDD5B50&gt; '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' (code signature in &lt;C293C93B-A7B7-3A18-9E0A-711F1BDD5B50&gt; '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' (no such file), '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' (code signature in &lt;C293C93B-A7B7-3A18-9E0A-711F1BDD5B50&gt; '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.)

calibre 6.26  embedded-python: True
macOS-13.2.1-x86_64-i386-64bit Darwin ('64bit', '')
('Darwin', '22.3.0', 'Darwin Kernel Version 22.3.0: Mon Jan 30 20:42:11 PST 2023; root:xnu-8792.81.3~2/RELEASE_X86_64')
Python 3.10.1
OSX: ('13.2.1', ('', '', ''), 'x86_64')
Interface language: None
Successfully initialized third party plugins: DeDRM (10, 0, 3)
Traceback (most recent call last):
  File "calibre/customize/ui.py", line 710, in initialize_plugin
  File "calibre_plugins.deacsm.__init__", line 226, in initialize
    from libadobe import createDeviceKeyFile, update_account_path, sendHTTPRequest
  File "/Users/myuser/Downloads/DeACSM_0.0.16.zip/libadobe.py", line 59, in <module>
    from oscrypto import keys
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/keys.py", line 5, in <module>
    from ._asymmetric import parse_certificate, parse_private, parse_public
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_asymmetric.py", line 27, in <module>
    from .kdf import pbkdf1, pbkdf2, pkcs12_kdf
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/kdf.py", line 9, in <module>
    from .util import rand_bytes
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/util.py", line 10, in <module>
    from ._mac.util import rand_bytes
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_mac/util.py", line 208, in <module>
    from .._openssl._libcrypto import libcrypto
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_openssl/_libcrypto.py", line 24, in <module>
    from ._libcrypto_ctypes import (
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_openssl/_libcrypto_ctypes.py", line 30, in <module>
    libcrypto = CDLL(libcrypto_path, use_errno=True)
  File "ctypes/__init__.py", line 374, in __init__
OSError: dlopen(/usr/local/lib/libcrypto.dylib, 0x0006): tried: '/usr/local/lib/libcrypto.dylib' (code signature in <C293C93B-A7B7-3A18-9E0A-711F1BDD5B50> '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/libcrypto.dylib' (no such file), '/usr/local/lib/libcrypto.dylib' (code signature in <C293C93B-A7B7-3A18-9E0A-711F1BDD5B50> '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' (code signature in <C293C93B-A7B7-3A18-9E0A-711F1BDD5B50> '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' (no such file), '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' (code signature in <C293C93B-A7B7-3A18-9E0A-711F1BDD5B50> '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "calibre/gui2/preferences/plugins.py", line 325, in add_plugin
  File "calibre/customize/ui.py", line 520, in add_plugin
  File "calibre/customize/ui.py", line 715, in initialize_plugin
calibre.customize.InvalidPlugin: Initialization of plugin Traceback (most recent call last):
  File "calibre/customize/ui.py", line 710, in initialize_plugin
  File "calibre_plugins.deacsm.__init__", line 226, in initialize
    from libadobe import createDeviceKeyFile, update_account_path, sendHTTPRequest
  File "/Users/myuser/Downloads/DeACSM_0.0.16.zip/libadobe.py", line 59, in <module>
    from oscrypto import keys
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/keys.py", line 5, in <module>
    from ._asymmetric import parse_certificate, parse_private, parse_public
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_asymmetric.py", line 27, in <module>
    from .kdf import pbkdf1, pbkdf2, pkcs12_kdf
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/kdf.py", line 9, in <module>
    from .util import rand_bytes
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/util.py", line 10, in <module>
    from ._mac.util import rand_bytes
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_mac/util.py", line 208, in <module>
    from .._openssl._libcrypto import libcrypto
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_openssl/_libcrypto.py", line 24, in <module>
    from ._libcrypto_ctypes import (
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_openssl/_libcrypto_ctypes.py", line 30, in <module>
    libcrypto = CDLL(libcrypto_path, use_errno=True)
  File "ctypes/__init__.py", line 374, in __init__
OSError: dlopen(/usr/local/lib/libcrypto.dylib, 0x0006): tried: '/usr/local/lib/libcrypto.dylib' (code signature in <C293C93B-A7B7-3A18-9E0A-711F1BDD5B50> '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/libcrypto.dylib' (no such file), '/usr/local/lib/libcrypto.dylib' (code signature in <C293C93B-A7B7-3A18-9E0A-711F1BDD5B50> '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' (code signature in <C293C93B-A7B7-3A18-9E0A-711F1BDD5B50> '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' (no such file), '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' (code signature in <C293C93B-A7B7-3A18-9E0A-711F1BDD5B50> '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.)
 failed with traceback:
Traceback (most recent call last):
  File "calibre/customize/ui.py", line 710, in initialize_plugin
  File "calibre_plugins.deacsm.__init__", line 226, in initialize
    from libadobe import createDeviceKeyFile, update_account_path, sendHTTPRequest
  File "/Users/myuser/Downloads/DeACSM_0.0.16.zip/libadobe.py", line 59, in <module>
    from oscrypto import keys
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/keys.py", line 5, in <module>
    from ._asymmetric import parse_certificate, parse_private, parse_public
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_asymmetric.py", line 27, in <module>
    from .kdf import pbkdf1, pbkdf2, pkcs12_kdf
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/kdf.py", line 9, in <module>
    from .util import rand_bytes
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/util.py", line 10, in <module>
    from ._mac.util import rand_bytes
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_mac/util.py", line 208, in <module>
    from .._openssl._libcrypto import libcrypto
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_openssl/_libcrypto.py", line 24, in <module>
    from ._libcrypto_ctypes import (
  File "/Users/myuser/Library/Preferences/calibre/plugins/DeACSM/modules/oscrypto/oscrypto/_openssl/_libcrypto_ctypes.py", line 30, in <module>
    libcrypto = CDLL(libcrypto_path, use_errno=True)
  File "ctypes/__init__.py", line 374, in __init__
OSError: dlopen(/usr/local/lib/libcrypto.dylib, 0x0006): tried: '/usr/local/lib/libcrypto.dylib' (code signature in <C293C93B-A7B7-3A18-9E0A-711F1BDD5B50> '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/libcrypto.dylib' (no such file), '/usr/local/lib/libcrypto.dylib' (code signature in <C293C93B-A7B7-3A18-9E0A-711F1BDD5B50> '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' (code signature in <C293C93B-A7B7-3A18-9E0A-711F1BDD5B50> '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' (no such file), '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' (code signature in <C293C93B-A7B7-3A18-9E0A-711F1BDD5B50> '/usr/local/Cellar/openssl@3/3.1.1_1/lib/libcrypto.3.dylib' not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.)
notEthan commented 1 year ago

This looks the same as https://github.com/Leseratte10/acsm-calibre-plugin/issues/63 . The solution that worked for me and at least one other person was brew unlink openssl@3

Leseratte10 commented 1 year ago

Yeah, looks like that's the same bug.

I'm not sure what triggers that, probably yet another of Apple's "security" things blocking stuff. Not sure if that's an error in Calibre, an error in my plugin, an error in MacOS or an error in OpenSSL / Homebrew; but without a Mac I can't really debug these issues.

Maragues commented 1 year ago

Thanks, unlinking did fix the issue 😍

I haven't upgraded MacOS or anything that I am aware. I tried brew upgrade before reporting this issue, but it didn't fix anything.

Close the bug if that's how you like it in your repo, but unfortunately the bug isn't solved :-/

Leseratte10 commented 1 year ago

Well, the error message code signature in libcrypto.3.dylib not valid for use in process: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed. coming from dlopen is clearly an error coming from MacOS complaining that your version of OpenSSL is unsigned.

That's either a bug in MacOS, a bug in Homebrew or a bug in OpenSSL, but not a bug in my plugin; and since you now have a workaround, I think this report should be closed, yeah.