Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Arch Linux] nitropy does not work any more #562

Closed
klakomuc opened this issue Aug 21, 2024 · 11 comments
Closed

[Arch Linux] nitropy does not work any more #562

klakomuc opened this issue Aug 21, 2024 · 11 comments

Comments

@klakomuc
Copy link

Hi,

I am afraid, nitropy does not work any more on Arch Linux (Linux archie 6.10.6-arch1-1 #1 SMP PREEMPT_DYNAMIC Mon, 19 Aug 2024 17:02:39 +0000 x86_64 GNU/Linux). Trying to execute nitropy nk3 status in GNOME Terminal results in:

/usr/lib/python3.12/site-packages/google/protobuf/internal/api_implementation.py:89: UserWarning: Selected implementation cpp is not available.
  warnings.warn(
Traceback (most recent call last):
  File "/usr/bin/nitropy", line 5, in <module>
    from pynitrokey.cli import main
  File "/usr/lib/python3.12/site-packages/pynitrokey/cli/__init__.py", line 26, in <module>
    from pynitrokey.cli.nk3 import nk3
  File "/usr/lib/python3.12/site-packages/pynitrokey/cli/nk3/__init__.py", line 19, in <module>
    from pynitrokey.nk3 import NK3_DATA
  File "/usr/lib/python3.12/site-packages/pynitrokey/nk3/__init__.py", line 14, in <module>
    from pynitrokey.trussed.bootloader.nrf52 import SignatureKey
  File "/usr/lib/python3.12/site-packages/pynitrokey/trussed/bootloader/nrf52.py", line 29, in <module>
    from .nrf52_upload.dfu.init_packet_pb import InitPacketPB
  File "/usr/lib/python3.12/site-packages/pynitrokey/trussed/bootloader/nrf52_upload/dfu/init_packet_pb.py", line 39, in <module>
    from . import dfu_cc_pb2 as pb
  File "/usr/lib/python3.12/site-packages/pynitrokey/trussed/bootloader/nrf52_upload/dfu/dfu_cc_pb2.py", line 7, in <module>
    from google.protobuf import descriptor as _descriptor
  File "/usr/lib/python3.12/site-packages/google/protobuf/descriptor.py", line 28, in <module>
    from google.protobuf.pyext import _message
ImportError: libabsl_die_if_null.so.2401.0.0: cannot open shared object file: No such file or directory

Best regards
klakomuc

@klakomuc klakomuc changed the title [Arch Linux] nitropy does not work anymore [Arch Linux] nitropy does not work any more Aug 21, 2024
@daringer
Copy link
Collaborator

can not reproduce on Arch on current state, can you confirm you are having pynitrokey 0.4.50 installed ?

@klakomuc
Copy link
Author

Due to the error message ImportError: libabsl_die_if_null.so.2401.0.0: cannot open shared object file: No such file or directory I assume that the error is related to python-protobuf (v27.3-2). Regardless of this, I have installed the latest version of python-pynitrokey (v0.4.50-1).

pacman -Qi python-pynitrokey

Name                     : python-pynitrokey
Version                  : 0.4.50-1
Beschreibung             : A command line interface for the Nitrokey FIDO2 and Nitrokey Start
Architektur              : any
URL                      : https://github.com/Nitrokey/pynitrokey
Lizenzen                 : Apache-2.0 OR MIT
Gruppen                  : Nichts
Stellt bereit            : Nichts
Hängt ab von             : libnitrokey  python  python-certifi  python-cffi  python-click
                           python-click-aliases  python-cryptography  python-dateutil
                           python-ecdsa  python-fido2  python-frozendict  python-intelhex
                           python-nethsm  python-nkdfu  python-protobuf  python-pyserial
                           python-pyusb  python-requests  python-semver  python-spsdk
                           python-tlv8  python-tqdm  python-typing_extensions
Optionale Abhängigkeiten : python-libusb1: for pro and storage subcommands [Installiert]
                           python-pyscard: for pcsclite integration [Installiert]
Benötigt von             : nitrokey-app2
Optional für             : Nichts
In Konflikt mit          : Nichts
Ersetzt                  : Nichts
Installationsgröße       : 2,43 MiB
Packer                   : David Runge <dvzrv@archlinux.org>
Erstellt am              : So 11 Aug 2024 21:46:57 CEST
Installiert am           : Mo 12 Aug 2024 04:01:35 CEST
Installationsgrund       : Ausdrücklich installiert
Installations-Skript     : Nein
Verifiziert durch        : Signatur

@daringer
Copy link
Collaborator

okok, v0.4.50 looks good, but the missing library is weird, so for me (on Arch) there is no: libabsl_die_if_null.so.2401.0.0 only /usr/lib/libabsl_die_if_null.so.2407.0.0 which originates in the abseil-cpp package in version 20240722.0-1.

Could you check your abseil-cpp version please and where this 2401 lib variant originates from?

@klakomuc
Copy link
Author

I found out that libabsl_die_if_null.so.2401.0.0 is part of abseil-cpp 20240116.2-3, but abseil-cpp 20240722.0-1 is currently installed on my system. After downgrading to abseil-cpp 20240116.2-3 nitropy and nitrokeyapp works like a charm. A subsequent update to abseil-cpp 20240722.0-1 leads to exactly the error that I recently reported.

@robin-nitrokey
Copy link
Member

AFAIS this should be fixed by python-protobuf 27.2-2. Can you check if updating python-protobuf fixes the problem?

@klakomuc
Copy link
Author

klakomuc commented Sep 9, 2024

At the moment I have installed python-protobuf 27.3-2, and it does not work. I must have installed this version on 17.08.2024.

A downgrade to python-protobuf 27.2-2 is not possible without further ado due to an unfulfillable dependency.

However, there seems to be an update to python-protobuf 28.0-1 coming soon. When it is available, I will install it, test it and report back here.

@klakomuc
Copy link
Author

An update to python-protobuf-28.0-2 could not solve the problem.

@robin-nitrokey
Copy link
Member

Strange, I cannot reproduce this problem with:

$ pacman -Q python-pynitrokey
python-pynitrokey 0.4.50-1
$ pacman -Q python-protobuf
python-protobuf 28.0-2
$ pacman -Q abseil-cpp
abseil-cpp 20240722.0-1

If you try to run this line in Python directly, does it work?

$ python3
>>> from google.protobuf import descriptor

@klakomuc
Copy link
Author

Our package versions are identical:

$ pacman -Q python-pynitrokey python-protobuf abseil-cpp
python-pynitrokey 0.4.50-1
python-protobuf 28.0-2
abseil-cpp 20240722.0-1

The descriptor import from google.protobuf import descriptor in Python produced the error message: ImportError: libabsl_die_if_null.so.2401.0.0: cannot open shared object file: No such file or directory

Further research showed:

$ pkgfile -s libabsl_die_if_null.so.2401.0.0
(null)

and

$ pkgfile -l abseil-cpp | grep libabsl_die_if_null.so
extra/abseil-cpp	/usr/lib/libabsl_die_if_null.so
extra/abseil-cpp	/usr/lib/libabsl_die_if_null.so.2407.0.0

So my Python installation tries to access libabsl_*2401*, although libabsl_*2407* is installed.

The simplest solution was:

$ sudo pacman -Rd --nodeps abseil-cpp protobuf python-protobuf
$ sudo pacman -S abseil-cpp protobuf python-protobuf

After that, the descriptor import in Python worked.

But now a negligible warning message appears when starting nitropy ...

$ nitropy nk3 status
/usr/lib/python3.12/site-packages/google/protobuf/runtime_version.py:112: UserWarning: Protobuf gencode version 5.27.3 is older than the runtime version 5.28.0 at dfu-cc.proto. Please avoid checked-in Protobuf gencode that can be obsolete.
  warnings.warn(

... or nitrokeyapp (via tmux):

$ nitrokeyapp
/usr/lib/python3.12/site-packages/google/protobuf/runtime_version.py:112: UserWarning: Protobuf gencode version 5.27.3 is older than the runtime version 5.28.0 at dfu-cc.proto. Please avoid checked-in Protobuf gencode that can be obsolete.
  warnings.warn(

@robin-nitrokey
Copy link
Member

Thanks for the update! The warning will either be fixed by the next update to the python-pynitrokey package in Arch, or potentially by upstream if they remove this warning, see protocolbuffers/protobuf#18096. You can suppress it by setting the TEMORARILY_DISABLE_PROTOBUF_VERSION_CHECK environment variable to true.

@klakomuc
Copy link
Author

Thanks a lot for the hint and your great support. I really appreciate your work.

With an alias nitropy='TEMORARILY_DISABLE_PROTOBUF_VERSION_CHECK=True nitropy' in my .bashrc everything runs without any warning message. Consequently, we can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants