Hi guys,
Sid, I saw that you added + \n, which I had not done on my end, and figured that might be the issue, but unfortunately that didn't resolve it. But thank you for the suggestion!
Vinay, I did some reading and managed to get the logger working. Here's the output:
initial daemon)>, <_io.BytesIO object at 0x7f1a51566bd0>, <_io.BufferedWriter name=7>
stderr reader: <Thread(Thread-4, initial daemon)>
[DEBUG]
2023-06-15T13:21:06.798Z
814e2cf0-75d6-46d1-ac51-b330f306b685
stderr reader: <Thread(Thread-4, initial daemon)>
closed output, 1422 bytes sent
[DEBUG]
2023-06-15T13:21:06.799Z
814e2cf0-75d6-46d1-ac51-b330f306b685
closed output, 1422 bytes sent
stdout reader: <Thread(Thread-5, initial daemon)>
[DEBUG]
2023-06-15T13:21:06.799Z
814e2cf0-75d6-46d1-ac51-b330f306b685
stdout reader: <Thread(Thread-5, initial daemon)>
gpg: keyring `/tmp/secring.gpg' created
[DEBUG]
2023-06-15T13:21:06.800Z
814e2cf0-75d6-46d1-ac51-b330f306b685
gpg: keyring `/tmp/secring.gpg' created
gpg: keyring `/tmp/pubring.gpg' created
[DEBUG]
2023-06-15T13:21:06.800Z
814e2cf0-75d6-46d1-ac51-b330f306b685
gpg: keyring `/tmp/pubring.gpg' created
gpg: no valid OpenPGP data found.
[DEBUG]
2023-06-15T13:21:06.818Z
814e2cf0-75d6-46d1-ac51-b330f306b685
gpg: no valid OpenPGP data found.
[GNUPG:] NODATA 1
[DEBUG]
2023-06-15T13:21:06.819Z
814e2cf0-75d6-46d1-ac51-b330f306b685
[GNUPG:] NODATA 1
gpg: Total number processed: 0
[DEBUG]
2023-06-15T13:21:06.819Z
814e2cf0-75d6-46d1-ac51-b330f306b685
gpg: Total number processed: 0
[GNUPG:] IMPORT_RES 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[DEBUG]
2023-06-15T13:21:06.819Z
814e2cf0-75d6-46d1-ac51-b330f306b685
[GNUPG:] IMPORT_RES 0 0 0 0 0 0 0 0 0 0 0 0 0 0
gpg returned a non-zero error code: 2
[WARNING]
2023-06-15T13:21:06.838Z
814e2cf0-75d6-46d1-ac51-b330f306b685
gpg returned a non-zero error code: 2
import_keys result: {'gpg': <gnupg.GPG object at 0x7f1a564dbca0>,
'results': [{'fingerprint': None, 'problem': '0', 'text': 'No valid data found'}], 'fingerprints': [], 'count': 0, 'no_user_id': 0, 'imported': 0, 'imported_rsa': 0, 'unchanged': 0, 'n_uids': 0, 'n_subk': 0, 'n_sigs': 0, 'n_revoc': 0, 'sec_read': 0, 'sec_imported': 0, 'sec_dups': 0, 'not_imported': 0, 'stderr': "gpg: keyring `/tmp/secring.gpg' created\ngpg: keyring `/tmp/pubring.gpg' created\ngpg: no valid OpenPGP data found.\n[GNUPG:] NODATA 1\ngpg: Total number processed: 0\n[GNUPG:] IMPORT_RES 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", 'data': b'', 'returncode': 2}
[DEBUG]
2023-06-15T13:21:06.839Z
814e2cf0-75d6-46d1-ac51-b330f306b685
import_keys result: {'gpg': <gnupg.GPG object at 0x7f1a564dbca0>, 'results': [{'fingerprint': None, 'problem': '0', 'text': 'No valid data found'}], 'fingerprints': [], 'count': 0, 'no_user_id': 0, 'imported': 0, 'imported_rsa': 0, 'unchanged': 0, 'n_uids': 0, 'n_subk': 0, 'n_sigs': 0, 'n_revoc': 0, 'sec_read': 0, 'sec_imported': 0, 'sec_dups': 0, 'not_imported': 0, 'stderr': "gpg: keyring `/tmp/secring.gpg' created\ngpg: keyring `/tmp/pubring.gpg' created\ngpg: no valid OpenPGP data found.\n[GNUPG:] NODATA 1\ngpg: Total number processed: 0\n[GNUPG:] IMPORT_RES 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n", 'data': b'', 'returncode': 2}
Keys:
20: /opt/python/gpg/g10/gpg --status-fd 2 --no-tty --no-verbose --fixed-list-mode --batch --with-colons --homedir /tmp --list-secret-keys --fingerprint --fingerprint
[DEBUG]
2023-06-15T13:21:06.878Z
814e2cf0-75d6-46d1-ac51-b330f306b685
20: /opt/python/gpg/g10/gpg --status-fd 2 --no-tty --no-verbose --fixed-list-mode --batch --with-colons --homedir /tmp --list-secret-keys --fingerprint --fingerprint
stderr reader: <Thread(Thread-6, initial daemon)>
[DEBUG]
2023-06-15T13:21:06.879Z
814e2cf0-75d6-46d1-ac51-b330f306b685
stderr reader: <Thread(Thread-6, initial daemon)>
stdout reader: <Thread(Thread-7, initial daemon)>
[DEBUG]
2023-06-15T13:21:06.898Z
814e2cf0-75d6-46d1-ac51-b330f306b685
stdout reader: <Thread(Thread-7, initial daemon)>
gpg: /tmp/trustdb.gpg: trustdb created
[DEBUG]
2023-06-15T13:21:06.919Z
814e2cf0-75d6-46d1-ac51-b330f306b685
gpg: /tmp/trustdb.gpg: trustdb created
[]
2023-06-15T13:21:06.980Z 814e2cf0-75d6-46d1-ac51-b330f306b685 Task timed out after 3.04 seconds
I bolded the most interesting part. It seems like there's an issue with the keys, or at least their format, that I'm trying to import. I've generated the keypair in Kleopatra and copy/pasted them directly from their .asc files after exporting, for testing purposes. Correct me if I'm wrong, but should the format not be:
-----BEGIN PGP PUBLIC KEY BLOCK-----
XXXXXXXXXXX
XXXXXXXXXXX
XXXXXXXXXXX
XY==
=ZABC
-----END PGP PUBLIC KEY BLOCK-----
(And the private key block equivalent.)