[Solved - Clear fingerprint reader storage] Fingerprint reader problems

I’m having trouble enrolling fingerprints under Fedora after an OS reinstall.

I’m dual booting Fedora 36 and Windows 11, but I have never enrolled fingerprints under Windows, only under Fedora. My understanding is that fingerprint data is stored in data files by Fedora, but in the hardware itself by Windows. Is this correct?

Under my initial Fedora installation, I enrolled fingerprints and everything worked just fine, but I decided to disable that functionality as I was using the laptop with an external keyboard, mouse and monitor and having to reach over to the laptop to authenticate things was a little annoying. So, I used fprintd-delete to remove all stored fingerprints from Fedora.

I later wiped the SSD and reinstalled both operating systems, this time enabling LUKS encryption for the Fedora installation. I’ve been trying to set up fingerprint authentication again, but keep getting errors. The graphical fingerprint enrollment dialogue in GNOME settings just returns a “Failed to enroll new fingerprint” error. Attempting it at the comment line gives an ‘enroll-duplicate’ response:

[root@framework ~]# fprintd-enroll -f right-thumb jason
Using device /net/reactivated/Fprint/Device/0
Enrolling right-thumb finger.
Enroll result: enroll-duplicate

[root@framework ~]# fprintd-list jason
found 1 devices
Device at /net/reactivated/Fprint/Device/0
Using device /net/reactivated/Fprint/Device/0
User jason has no fingers enrolled for Goodix MOC Fingerprint Sensor.

If fprintd can’t see any enrolled fingerprints in its data files, and I’ve never enrolled any in the hardware under Windows, why am I seeing this ‘duplicate’ response?

Can anyone give me any pointers?

Try the script at Fingerprints not getting deleted from device? (#415) · Issues · libfprint / libfprint · GitLab

The script throws errors for me:

[jason@framework ~]$ sudo dnf list installed \*fprint\*
Installed Packages
fprintd.x86_64                        1.94.2-2.fc36                    @anaconda
fprintd-pam.x86_64                    1.94.2-2.fc36                    @anaconda
libfprint.x86_64                      1.94.4-1.fc36                    @updates

[jason@framework ~]$ sudo python3 clearprints.py 
<__gi__.FpiDeviceGoodixMoc object at 0x7ff4e92dfd00 (FpiDeviceGoodixMoc at 0x55d2b1c81130)>
goodixmoc
UID1D2B4DB9_XXXX_MOC_B0
libusb: error [udev_hotplug_event] ignoring udev action change
libusb: error [udev_hotplug_event] ignoring udev action change
libusb: error [udev_hotplug_event] ignoring udev action change
libusb: error [udev_hotplug_event] ignoring udev action change

(process:8155): libfprint-ERROR **: 15:33:34.507: parse fingerlist error
Trace/breakpoint trap

Others have had success with this script, which looks a little different:

2 Likes

That one worked fine, thank you very much!

I’ve been able to re-enroll some fingerprints now.

2 Likes

Hey, I just wanted to provide my shell for any nixos users as it was a bit tricky to run python with sudo and keep the shell env vars (-E flag didn’t work)

Here’s the shell with the proper command needed to get it work (note the \ to escape the $ aren’t needed if you’re just copying from here). It took me a like 10 hours of googling and trial and error to finally get this to work (I don’t use python). Maybe I’m dumb but thought if anyone else came across this it’ll help them:

let
  pkgs = import <nixpkgs> {
    config = {
      allowUnfree = true;
    };
  };
in
pkgs.mkShell {
  buildInputs = with pkgs; [
    python3
    python3Packages.pygobject3
    gobject-introspection
    libfprint
    gusb
    libfprint-2-tod1-goodix
  ];

  shellHook = ''
    echo "Run 'sudo LD_LIBRARY_PATH=\$LD_LIBRARY_PATH PYTHONPATH=\$PYTHONPATH GI_TYPELIB_PATH=\$GI_TYPELIB_PATH python3 ./fprint_clear_storage.py'"
  '';
}

And the exact python script I’m running though I’m sure you can find several around:

#! /usr/bin/python3

import gi
gi.require_version('FPrint', '2.0')
from gi.repository import FPrint

ctx = FPrint.Context()

print("Looking for fingerprint devices.")

devices = ctx.get_devices()

for dev in devices:
    print(dev)
    print(dev.get_driver())
    print(dev.props.device_id);

    dev.open_sync()

    dev.clear_storage_sync()
    print("All prints deleted.")

    dev.close_sync()

if devices:
    print("All prints on all devices deleted.")
else:
    print("No devices found.")