Yubico / yubioath-flutter

Yubico Authenticator for Desktop (Windows, macOS and Linux) and Android
https://developers.yubico.com/yubioath-flutter/
Apache License 2.0
1.02k stars 138 forks source link

[Sway, Arch] Help with very slow startup..? #1067

Open schmitmd opened 1 year ago

schmitmd commented 1 year ago

I'm seeing some very slow startups. As in, it takes 5-6 full seconds to even get the "logging initialized" line.

mybox:~%>date && /opt/yubico/authenticator 
Thu May  4 07:23:19 AM UTC 2023
07:23:24.531 [desktop.init] INFO: Logging initialized, outputting to stderr
07:23:24.533 [desktop.init] INFO: Starting Helper subprocess: /opt/yubico/helper/authenticator-helper
07:23:24.536 [desktop.init] INFO: Helper process started
/opt/yubico/helper/authenticator-helper
07:23:30.140 [helper.ykman.logging] INFO: Logging at level: INFO
07:23:30.140 [helper.helper.device] INFO: Log level set to: INFO
07:23:30.176 [desktop.devices] INFO: USB state change
{"data":{"state":5740354900026002187,"pids":{}},"actions":["get","scan"],"children":{}}
07:23:30.176 [desktop.devices] INFO: USB state updated, unaccounted for: {}

Can someone help me get better logs & diagnose this? This is the only other line in the output, but I'm not sure if it's significant: (authenticator:32568): libayatana-appindicator-CRITICAL **: 16:40:03.618: app_indicator_set_menu: assertion 'IS_APP_INDICATOR (self)' failed

My setup: OS: Archlinux Environment: Wayland (specifically Sway, but I tried Wayfire and see the same behavior) Package installed via AUR, just the normal yubico-authenticator-bin package.

acidDrain commented 1 year ago

Hello, I am also experiencing this issue on Arch Linux, first beginning around the same time as this issue was opened (if I remember, right).

Here are my system's technical details: Application: Yubico Authenticator Version: 6.2.0

~ $ uname -a
Linux demandred 6.4.3-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Tue, 11 Jul 2023 05:13:16 +0000 x86_64 GNU/Linux

~ $ lsb_release -a
LSB Version:    n/a
Distributor ID: Arch
Description:    Arch Linux
Release:    rolling
Codename:   n/a

~ $ cd ~/.local/share/yubioath-desktop-6.2.0-linux

~/.local/share/yubioath-desktop-6.2.0-linux $ ls -lh authenticator
-rwxr-xr-x 1 1000 1000 21K Apr 19 04:52 authenticator

~/.local/share/yubioath-desktop-6.2.0-linux $ ldd authenticator
    linux-vdso.so.1 (0x00007ffe8e5db000)
    libdesktop_drop_plugin.so => ~/.local/share/yubioath-desktop-6.2.0-linux/./lib/libdesktop_drop_plugin.so (0x00007f6b06c00000)
    liblocal_notifier_plugin.so => ~/.local/share/yubioath-desktop-6.2.0-linux/./lib/liblocal_notifier_plugin.so (0x00007f6b06800000)
    libscreen_retriever_plugin.so => ~/.local/share/yubioath-desktop-6.2.0-linux/./lib/libscreen_retriever_plugin.so (0x00007f6b06400000)
    libtray_manager_plugin.so => ~/.local/share/yubioath-desktop-6.2.0-linux/./lib/libtray_manager_plugin.so (0x00007f6b06000000)
    liburl_launcher_linux_plugin.so => ~/.local/share/yubioath-desktop-6.2.0-linux/./lib/liburl_launcher_linux_plugin.so (0x00007f6b05c00000)
    libwindow_manager_plugin.so => ~/.local/share/yubioath-desktop-6.2.0-linux/./lib/libwindow_manager_plugin.so (0x00007f6b05800000)
    libgtk-3.so.0 => /usr/lib/libgtk-3.so.0 (0x00007f6b05000000)
    libgdk-3.so.0 => /usr/lib/libgdk-3.so.0 (0x00007f6b06e6f000)
    libpangocairo-1.0.so.0 => /usr/lib/libpangocairo-1.0.so.0 (0x00007f6b06e5f000)
    libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0x00007f6b06b97000)
    libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0x00007f6b06e37000)
    libcairo-gobject.so.2 => /usr/lib/libcairo-gobject.so.2 (0x00007f6b06e2a000)
    libcairo.so.2 => /usr/lib/libcairo.so.2 (0x00007f6b06a65000)
    libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0x00007f6b06a1f000)
    libflutter_linux_gtk.so => ~/.local/share/yubioath-desktop-6.2.0-linux/./lib/libflutter_linux_gtk.so (0x00007f6b04000000)
    libgio-2.0.so.0 => /usr/lib/libgio-2.0.so.0 (0x00007f6b0662a000)
    libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x00007f6b0639e000)
    libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007f6b06253000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f6b03c00000)
    libm.so.6 => /usr/lib/libm.so.6 (0x00007f6b05f13000)
    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f6b06605000)
    libc.so.6 => /usr/lib/libc.so.6 (0x00007f6b05a16000)
    libnotify.so.4 => /usr/lib/libnotify.so.4 (0x00007f6b06e19000)
    libayatana-appindicator3.so.1 => ~/.local/share/yubioath-desktop-6.2.0-linux/./lib/libayatana-appindicator3.so.1 (0x00007f6b03800000)
    libdbusmenu-glib.so.4 => ~/.local/share/yubioath-desktop-6.2.0-linux/./lib/libdbusmenu-glib.so.4 (0x00007f6b03400000)
    libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x00007f6b06e12000)
    libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x00007f6b05e17000)
    libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0x00007f6b06a07000)
    libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x00007f6b06204000)
    libfribidi.so.0 => /usr/lib/libfribidi.so.0 (0x00007f6b057e0000)
    libepoxy.so.0 => /usr/lib/libepoxy.so.0 (0x00007f6b04ecf000)
    libXi.so.6 => /usr/lib/libXi.so.6 (0x00007f6b04ebb000)
    libX11.so.6 => /usr/lib/libX11.so.6 (0x00007f6b03ebd000)
    libatk-bridge-2.0.so.0 => /usr/lib/libatk-bridge-2.0.so.0 (0x00007f6b03e82000)
    libcloudproviders.so.0 => /usr/lib/libcloudproviders.so.0 (0x00007f6b04ea4000)
    libtracker-sparql-3.0.so.0 => /usr/lib/libtracker-sparql-3.0.so.0 (0x00007f6b03b25000)
    libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x00007f6b06e06000)
    libxkbcommon.so.0 => /usr/lib/libxkbcommon.so.0 (0x00007f6b03ade000)
    libwayland-client.so.0 => /usr/lib/libwayland-client.so.0 (0x00007f6b05e05000)
    libwayland-cursor.so.0 => /usr/lib/libwayland-cursor.so.0 (0x00007f6b05a0c000)
    libwayland-egl.so.1 => /usr/lib/libwayland-egl.so.1 (0x00007f6b057db000)
    libXext.so.6 => /usr/lib/libXext.so.6 (0x00007f6b03ac9000)
    libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0x00007f6b04e98000)
    libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x00007f6b04e93000)
    libXcomposite.so.1 => /usr/lib/libXcomposite.so.1 (0x00007f6b03e7d000)
    libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0x00007f6b03abc000)
    libXinerama.so.1 => /usr/lib/libXinerama.so.1 (0x00007f6b03ab7000)
    libthai.so.0 => /usr/lib/libthai.so.0 (0x00007f6b03aac000)
    libz.so.1 => /usr/lib/libz.so.1 (0x00007f6b03a92000)
    libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007f6b03a58000)
    libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007f6b03732000)
    libXrender.so.1 => /usr/lib/libXrender.so.1 (0x00007f6b03a4b000)
    libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007f6b03a20000)
    libxcb-render.so.0 => /usr/lib/libxcb-render.so.0 (0x00007f6b03a11000)
    libxcb-shm.so.0 => /usr/lib/libxcb-shm.so.0 (0x00007f6b0372d000)
    libpixman-1.so.0 => /usr/lib/libpixman-1.so.0 (0x00007f6b03680000)
    libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0x00007f6b0337d000)
    libtiff.so.6 => /usr/lib/libtiff.so.6 (0x00007f6b032e6000)
    libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f6b0367b000)
    libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f6b03676000)
    /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f6b06fb4000)
    libmount.so.1 => /usr/lib/libmount.so.1 (0x00007f6b03625000)
    libffi.so.8 => /usr/lib/libffi.so.8 (0x00007f6b032db000)
    libpcre2-8.so.0 => /usr/lib/libpcre2-8.so.0 (0x00007f6b03240000)
    libayatana-indicator3.so.7 => ~/.local/share/yubioath-desktop-6.2.0-linux/./lib/libayatana-indicator3.so.7 (0x00007f6b03000000)
    libdbusmenu-gtk3.so.4 => ~/.local/share/yubioath-desktop-6.2.0-linux/./lib/libdbusmenu-gtk3.so.4 (0x00007f6b02c00000)
    libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x00007f6b0321d000)
    libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00007f6b02fd5000)
    libatspi.so.0 => /usr/lib/libatspi.so.0 (0x00007f6b02f9b000)
    libdbus-1.so.3 => /usr/lib/libdbus-1.so.3 (0x00007f6b02f4a000)
    libjson-glib-1.0.so.0 => /usr/lib/libjson-glib-1.0.so.0 (0x00007f6b02f1f000)
    libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00007f6b02a9a000)
    libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0x00007f6b02946000)
    libdatrie.so.1 => /usr/lib/libdatrie.so.1 (0x00007f6b03214000)
    libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007f6b02f0c000)
    libbrotlidec.so.1 => /usr/lib/libbrotlidec.so.1 (0x00007f6b02efe000)
    libXau.so.6 => /usr/lib/libXau.so.6 (0x00007f6b02ef9000)
    libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007f6b02ef1000)
    libzstd.so.1 => /usr/lib/libzstd.so.1 (0x00007f6b02e1e000)
    liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007f6b02913000)
    libblkid.so.1 => /usr/lib/libblkid.so.1 (0x00007f6b028d7000)
    libsystemd.so.0 => /usr/lib/libsystemd.so.0 (0x00007f6b027ef000)
    libicuuc.so.73 => /usr/lib/libicuuc.so.73 (0x00007f6b02400000)
    libbrotlicommon.so.1 => /usr/lib/libbrotlicommon.so.1 (0x00007f6b027cc000)
    libcap.so.2 => /usr/lib/libcap.so.2 (0x00007f6b027c0000)
    libgcrypt.so.20 => /usr/lib/libgcrypt.so.20 (0x00007f6b02678000)
    liblz4.so.1 => /usr/lib/liblz4.so.1 (0x00007f6b02656000)
    libicudata.so.73 => /usr/lib/libicudata.so.73 (0x00007f6b00400000)
    libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x00007f6b02630000)

Exercept from my ~/.config/bspwm/bspwmrc

    if command -v yubico-authenticator &>/dev/null; then
      if ! pgrep authenticator &>/dev/null; then
        yubico-authenticator &
      fi
    fi

Here are the startup logs if I launch the application from a terminal:

~/.local/share/yubioath-desktop-6.2.0-linux $ ./authenticator
11:42:06.216 [desktop.init] INFO: Logging initialized, outputting to stderr
11:42:06.218 [desktop.init] INFO: Starting Helper subprocess: ~/.local/share/yubioath-desktop-6.2.0-linux/helper/authenticator-helper
11:42:06.220 [desktop.init] INFO: Helper process started

(authenticator:58715): libayatana-appindicator-CRITICAL **: 11:42:06.223: app_indicator_set_menu: assertion 'IS_APP_INDICATOR (self)' failed
11:42:13.605 [helper.ykman.logging] INFO: Logging at level: INFO
11:42:13.605 [helper.helper.device] INFO: Log level set to: INFO
11:42:13.605 [desktop.init] INFO: Helper log level set

(authenticator:58715): Gdk-CRITICAL **: 11:42:13.736: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed
11:42:15.397 [desktop.devices] INFO: USB state change
{"data":{"state":-2871992096025928065,"pids":{"1031":1}},"actions":["get","scan"],"children":{"11111111":{"pid":1031,"name":"YubiKey 5 Nano","serial":11111111}}}
11:42:15.942 [desktop.devices] INFO: USB state updated, unaccounted for: {}
11:42:16.463 [desktop.devices] INFO: USB state change
{"data":{"state":-2871992096025928065,"pids":{"1031":1}},"actions":["get","scan"],"children":{"11111111":{"pid":1031,"name":"YubiKey 5 Nano","serial":11111111}}}
11:42:17.030 [desktop.devices] INFO: USB state updated, unaccounted for: {}

Here are the logs that were copied from the app when I clicked "Copy Log" under the "Troubleshooting" section, in the "About" page:

# NOTE: I wasn't certain of how to persist DEBUG logging after restarting the app
11:36:47.915 [helper.ykman.logging] INFO: Logging at level: INFO
11:36:47.915 [helper.helper.device] INFO: Log level set to: INFO
11:36:47.915 [desktop.init] INFO: Helper log level set
11:36:49.702 [desktop.devices] INFO: USB state change
{"data":{"state":-481390892055195187,"pids":{"1031":1}},"actions":["get","scan"],"children":{"11111111":{"pid":1031,"name":"YubiKey 5 Nano","serial":11111111}}}
11:36:49.727 [desktop.devices] INFO: USB state updated, unaccounted for: {}
11:37:44.338 [about] INFO: Running diagnostics...
11:37:48.714 [about] INFO: Copying log to clipboard (6.2.0)...

I know that libindicator-gtk3 and libappindicator-gtk3 are statically linked in the project's lib folder, but just in case:

~ $ yay --query | grep 'libappindicator\|libindicator'
libappindicator-gtk3 12.10.0.r298-2
libindicator-gtk3 12.10.1-10

strace output:

~/.local/share/yubioath-desktop-6.2.0-linux $ strace ./authenticator &>> yubico-authenticator-strace.log &

futex(0x7fbfcb7f1ba0, FUTEX_WAIT_PRIVATE, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x7fbfcb7f1ba0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7fbfcdbfefd8, FUTEX_WAKE_PRIVATE, 2147483647) = 0
getpeername(2, 0x7fff145d6930, [128])   = -1 ENOTSOCK (Socket operation on non-socket)
futex(0x7fbfcdbfefd8, FUTEX_WAKE_PRIVATE, 2147483647) = 0
ioctl(2, TCGETS, 0x7fff145d6900)        = -1 ENOTTY (Inappropriate ioctl for device)
getpid()                                = 44694
newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0644, st_size=3592, ...}, 0) = 0
write(2, "\n(authenticator:44694): libayata"..., 128
(authenticator:44694): libayatana-appindicator-CRITICAL **: 11:24:14.918: app_indicator_set_menu: assertion 'IS_APP_INDICATOR () = 128
write(2, "self)' failed\n", 14self)' failed
)         = 14
futex(0x7fbfcb7f1ba0, FUTEX_WAIT_PRIVATE, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x7fbfcb7f1ba0, FUTEX_WAKE_PRIVATE, 1) = 0
timerfd_settime(20, TFD_TIMER_ABSTIME, {it_interval={tv_sec=5819, tv_nsec=742246726}, it_value={tv_sec=5819, tv_nsec=742246726}}, NULL) = 0
recvmsg(7, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}], 3, 0) = 0 (Timeout)
recvmsg(7, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}], 3, 9194) = 1 ([{fd=3, revents=POLLIN}])
read(3, "\2\0\0\0\0\0\0\0", 8)          = 8
read(3, 0x7fff145d7100, 8)              = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(7, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}], 3, 111:24:22.576 [helper.ykman.logging] INFO: Logging at level: INFO
11:24:22.576 [helper.helper.device] INFO: Log level set to: INFO
11:24:22.576 [desktop.init] INFO: Helper log level set
) = 0 (Timeout)
acidDrain commented 1 year ago

Hello, I am also experiencing this issue on Arch Linux, first beginning around the same time as this issue was opened (if I remember, right).

Here are my system's technical details: Application: Yubico Authenticator Version: 6.2.0

~ $ uname -a
Linux demandred 6.4.3-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Tue, 11 Jul 2023 05:13:16 +0000 x86_64 GNU/Linux

~ $ lsb_release -a
LSB Version:  n/a
Distributor ID:   Arch
Description:  Arch Linux
Release:  rolling
Codename: n/a

~ $ cd ~/.local/share/yubioath-desktop-6.2.0-linux

~/.local/share/yubioath-desktop-6.2.0-linux $ ls -lh authenticator
-rwxr-xr-x 1 1000 1000 21K Apr 19 04:52 authenticator

~/.local/share/yubioath-desktop-6.2.0-linux $ ldd authenticator
  linux-vdso.so.1 (0x00007ffe8e5db000)
  libdesktop_drop_plugin.so => ~/.local/share/yubioath-desktop-6.2.0-linux/./lib/libdesktop_drop_plugin.so (0x00007f6b06c00000)
  liblocal_notifier_plugin.so => ~/.local/share/yubioath-desktop-6.2.0-linux/./lib/liblocal_notifier_plugin.so (0x00007f6b06800000)
  libscreen_retriever_plugin.so => ~/.local/share/yubioath-desktop-6.2.0-linux/./lib/libscreen_retriever_plugin.so (0x00007f6b06400000)
  libtray_manager_plugin.so => ~/.local/share/yubioath-desktop-6.2.0-linux/./lib/libtray_manager_plugin.so (0x00007f6b06000000)
  liburl_launcher_linux_plugin.so => ~/.local/share/yubioath-desktop-6.2.0-linux/./lib/liburl_launcher_linux_plugin.so (0x00007f6b05c00000)
  libwindow_manager_plugin.so => ~/.local/share/yubioath-desktop-6.2.0-linux/./lib/libwindow_manager_plugin.so (0x00007f6b05800000)
  libgtk-3.so.0 => /usr/lib/libgtk-3.so.0 (0x00007f6b05000000)
  libgdk-3.so.0 => /usr/lib/libgdk-3.so.0 (0x00007f6b06e6f000)
  libpangocairo-1.0.so.0 => /usr/lib/libpangocairo-1.0.so.0 (0x00007f6b06e5f000)
  libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0x00007f6b06b97000)
  libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0x00007f6b06e37000)
  libcairo-gobject.so.2 => /usr/lib/libcairo-gobject.so.2 (0x00007f6b06e2a000)
  libcairo.so.2 => /usr/lib/libcairo.so.2 (0x00007f6b06a65000)
  libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0x00007f6b06a1f000)
  libflutter_linux_gtk.so => ~/.local/share/yubioath-desktop-6.2.0-linux/./lib/libflutter_linux_gtk.so (0x00007f6b04000000)
  libgio-2.0.so.0 => /usr/lib/libgio-2.0.so.0 (0x00007f6b0662a000)
  libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x00007f6b0639e000)
  libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007f6b06253000)
  libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f6b03c00000)
  libm.so.6 => /usr/lib/libm.so.6 (0x00007f6b05f13000)
  libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f6b06605000)
  libc.so.6 => /usr/lib/libc.so.6 (0x00007f6b05a16000)
  libnotify.so.4 => /usr/lib/libnotify.so.4 (0x00007f6b06e19000)
  libayatana-appindicator3.so.1 => ~/.local/share/yubioath-desktop-6.2.0-linux/./lib/libayatana-appindicator3.so.1 (0x00007f6b03800000)
  libdbusmenu-glib.so.4 => ~/.local/share/yubioath-desktop-6.2.0-linux/./lib/libdbusmenu-glib.so.4 (0x00007f6b03400000)
  libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x00007f6b06e12000)
  libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x00007f6b05e17000)
  libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0x00007f6b06a07000)
  libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x00007f6b06204000)
  libfribidi.so.0 => /usr/lib/libfribidi.so.0 (0x00007f6b057e0000)
  libepoxy.so.0 => /usr/lib/libepoxy.so.0 (0x00007f6b04ecf000)
  libXi.so.6 => /usr/lib/libXi.so.6 (0x00007f6b04ebb000)
  libX11.so.6 => /usr/lib/libX11.so.6 (0x00007f6b03ebd000)
  libatk-bridge-2.0.so.0 => /usr/lib/libatk-bridge-2.0.so.0 (0x00007f6b03e82000)
  libcloudproviders.so.0 => /usr/lib/libcloudproviders.so.0 (0x00007f6b04ea4000)
  libtracker-sparql-3.0.so.0 => /usr/lib/libtracker-sparql-3.0.so.0 (0x00007f6b03b25000)
  libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x00007f6b06e06000)
  libxkbcommon.so.0 => /usr/lib/libxkbcommon.so.0 (0x00007f6b03ade000)
  libwayland-client.so.0 => /usr/lib/libwayland-client.so.0 (0x00007f6b05e05000)
  libwayland-cursor.so.0 => /usr/lib/libwayland-cursor.so.0 (0x00007f6b05a0c000)
  libwayland-egl.so.1 => /usr/lib/libwayland-egl.so.1 (0x00007f6b057db000)
  libXext.so.6 => /usr/lib/libXext.so.6 (0x00007f6b03ac9000)
  libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0x00007f6b04e98000)
  libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x00007f6b04e93000)
  libXcomposite.so.1 => /usr/lib/libXcomposite.so.1 (0x00007f6b03e7d000)
  libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0x00007f6b03abc000)
  libXinerama.so.1 => /usr/lib/libXinerama.so.1 (0x00007f6b03ab7000)
  libthai.so.0 => /usr/lib/libthai.so.0 (0x00007f6b03aac000)
  libz.so.1 => /usr/lib/libz.so.1 (0x00007f6b03a92000)
  libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007f6b03a58000)
  libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007f6b03732000)
  libXrender.so.1 => /usr/lib/libXrender.so.1 (0x00007f6b03a4b000)
  libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007f6b03a20000)
  libxcb-render.so.0 => /usr/lib/libxcb-render.so.0 (0x00007f6b03a11000)
  libxcb-shm.so.0 => /usr/lib/libxcb-shm.so.0 (0x00007f6b0372d000)
  libpixman-1.so.0 => /usr/lib/libpixman-1.so.0 (0x00007f6b03680000)
  libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0x00007f6b0337d000)
  libtiff.so.6 => /usr/lib/libtiff.so.6 (0x00007f6b032e6000)
  libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f6b0367b000)
  libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f6b03676000)
  /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f6b06fb4000)
  libmount.so.1 => /usr/lib/libmount.so.1 (0x00007f6b03625000)
  libffi.so.8 => /usr/lib/libffi.so.8 (0x00007f6b032db000)
  libpcre2-8.so.0 => /usr/lib/libpcre2-8.so.0 (0x00007f6b03240000)
  libayatana-indicator3.so.7 => ~/.local/share/yubioath-desktop-6.2.0-linux/./lib/libayatana-indicator3.so.7 (0x00007f6b03000000)
  libdbusmenu-gtk3.so.4 => ~/.local/share/yubioath-desktop-6.2.0-linux/./lib/libdbusmenu-gtk3.so.4 (0x00007f6b02c00000)
  libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x00007f6b0321d000)
  libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00007f6b02fd5000)
  libatspi.so.0 => /usr/lib/libatspi.so.0 (0x00007f6b02f9b000)
  libdbus-1.so.3 => /usr/lib/libdbus-1.so.3 (0x00007f6b02f4a000)
  libjson-glib-1.0.so.0 => /usr/lib/libjson-glib-1.0.so.0 (0x00007f6b02f1f000)
  libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00007f6b02a9a000)
  libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0x00007f6b02946000)
  libdatrie.so.1 => /usr/lib/libdatrie.so.1 (0x00007f6b03214000)
  libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007f6b02f0c000)
  libbrotlidec.so.1 => /usr/lib/libbrotlidec.so.1 (0x00007f6b02efe000)
  libXau.so.6 => /usr/lib/libXau.so.6 (0x00007f6b02ef9000)
  libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007f6b02ef1000)
  libzstd.so.1 => /usr/lib/libzstd.so.1 (0x00007f6b02e1e000)
  liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007f6b02913000)
  libblkid.so.1 => /usr/lib/libblkid.so.1 (0x00007f6b028d7000)
  libsystemd.so.0 => /usr/lib/libsystemd.so.0 (0x00007f6b027ef000)
  libicuuc.so.73 => /usr/lib/libicuuc.so.73 (0x00007f6b02400000)
  libbrotlicommon.so.1 => /usr/lib/libbrotlicommon.so.1 (0x00007f6b027cc000)
  libcap.so.2 => /usr/lib/libcap.so.2 (0x00007f6b027c0000)
  libgcrypt.so.20 => /usr/lib/libgcrypt.so.20 (0x00007f6b02678000)
  liblz4.so.1 => /usr/lib/liblz4.so.1 (0x00007f6b02656000)
  libicudata.so.73 => /usr/lib/libicudata.so.73 (0x00007f6b00400000)
  libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x00007f6b02630000)

Exercept from my ~/.config/bspwm/bspwmrc

    if command -v yubico-authenticator &>/dev/null; then
      if ! pgrep authenticator &>/dev/null; then
        yubico-authenticator &
      fi
    fi

Here are the startup logs if I launch the application from a terminal:

~/.local/share/yubioath-desktop-6.2.0-linux $ ./authenticator
11:42:06.216 [desktop.init] INFO: Logging initialized, outputting to stderr
11:42:06.218 [desktop.init] INFO: Starting Helper subprocess: ~/.local/share/yubioath-desktop-6.2.0-linux/helper/authenticator-helper
11:42:06.220 [desktop.init] INFO: Helper process started

(authenticator:58715): libayatana-appindicator-CRITICAL **: 11:42:06.223: app_indicator_set_menu: assertion 'IS_APP_INDICATOR (self)' failed
11:42:13.605 [helper.ykman.logging] INFO: Logging at level: INFO
11:42:13.605 [helper.helper.device] INFO: Log level set to: INFO
11:42:13.605 [desktop.init] INFO: Helper log level set

(authenticator:58715): Gdk-CRITICAL **: 11:42:13.736: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed
11:42:15.397 [desktop.devices] INFO: USB state change
{"data":{"state":-2871992096025928065,"pids":{"1031":1}},"actions":["get","scan"],"children":{"11111111":{"pid":1031,"name":"YubiKey 5 Nano","serial":11111111}}}
11:42:15.942 [desktop.devices] INFO: USB state updated, unaccounted for: {}
11:42:16.463 [desktop.devices] INFO: USB state change
{"data":{"state":-2871992096025928065,"pids":{"1031":1}},"actions":["get","scan"],"children":{"11111111":{"pid":1031,"name":"YubiKey 5 Nano","serial":11111111}}}
11:42:17.030 [desktop.devices] INFO: USB state updated, unaccounted for: {}

Here are the logs that were copied from the app when I clicked "Copy Log" under the "Troubleshooting" section, in the "About" page:

# NOTE: I wasn't certain of how to persist DEBUG logging after restarting the app
11:36:47.915 [helper.ykman.logging] INFO: Logging at level: INFO
11:36:47.915 [helper.helper.device] INFO: Log level set to: INFO
11:36:47.915 [desktop.init] INFO: Helper log level set
11:36:49.702 [desktop.devices] INFO: USB state change
{"data":{"state":-481390892055195187,"pids":{"1031":1}},"actions":["get","scan"],"children":{"11111111":{"pid":1031,"name":"YubiKey 5 Nano","serial":11111111}}}
11:36:49.727 [desktop.devices] INFO: USB state updated, unaccounted for: {}
11:37:44.338 [about] INFO: Running diagnostics...
11:37:48.714 [about] INFO: Copying log to clipboard (6.2.0)...

I know that libindicator-gtk3 and libappindicator-gtk3 are statically linked in the project's lib folder, but just in case:

~ $ yay --query | grep 'libappindicator\|libindicator'
libappindicator-gtk3 12.10.0.r298-2
libindicator-gtk3 12.10.1-10

strace output:

~/.local/share/yubioath-desktop-6.2.0-linux $ strace ./authenticator &>> yubico-authenticator-strace.log &

futex(0x7fbfcb7f1ba0, FUTEX_WAIT_PRIVATE, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x7fbfcb7f1ba0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7fbfcdbfefd8, FUTEX_WAKE_PRIVATE, 2147483647) = 0
getpeername(2, 0x7fff145d6930, [128])   = -1 ENOTSOCK (Socket operation on non-socket)
futex(0x7fbfcdbfefd8, FUTEX_WAKE_PRIVATE, 2147483647) = 0
ioctl(2, TCGETS, 0x7fff145d6900)        = -1 ENOTTY (Inappropriate ioctl for device)
getpid()                                = 44694
newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0644, st_size=3592, ...}, 0) = 0
write(2, "\n(authenticator:44694): libayata"..., 128
(authenticator:44694): libayatana-appindicator-CRITICAL **: 11:24:14.918: app_indicator_set_menu: assertion 'IS_APP_INDICATOR () = 128
write(2, "self)' failed\n", 14self)' failed
)         = 14
futex(0x7fbfcb7f1ba0, FUTEX_WAIT_PRIVATE, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x7fbfcb7f1ba0, FUTEX_WAKE_PRIVATE, 1) = 0
timerfd_settime(20, TFD_TIMER_ABSTIME, {it_interval={tv_sec=5819, tv_nsec=742246726}, it_value={tv_sec=5819, tv_nsec=742246726}}, NULL) = 0
recvmsg(7, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}], 3, 0) = 0 (Timeout)
recvmsg(7, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}], 3, 9194) = 1 ([{fd=3, revents=POLLIN}])
read(3, "\2\0\0\0\0\0\0\0", 8)          = 8
read(3, 0x7fff145d7100, 8)              = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(7, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}], 3, 111:24:22.576 [helper.ykman.logging] INFO: Logging at level: INFO
11:24:22.576 [helper.helper.device] INFO: Log level set to: INFO
11:24:22.576 [desktop.init] INFO: Helper log level set
) = 0 (Timeout)

Just an FYI, I tested with version 0.5.91 and 0.5.92 of libayatana-appindicator, where IS_APP_INDICATOR was changed to APP_IS_INDICATOR, and regardless of which version of the library (and hence the function/method name) I use, an error referencing that name always appears during startup. So, this appears to be a red-herring. Sorry about that!

markstos commented 1 year ago

Issue title should be updated to clarify this is on Sway on Arch Linux.

OtaK commented 8 months ago

Same happens (super slow start, up to 30 seconds) on Hyprland (Gentoo)

markstos commented 8 months ago

@OtaK Have you tested with the Sway 1.9 release?

OtaK commented 8 months ago

@OtaK Have you tested with the Sway 1.9 release?

As mentioned in my comment, I do not use Sway but rather Hyprland. It is also wlroots-based and the app seems to have an issue with wlroots/wayland rather than Sway in particular. To be completely fair, the app works. It's just extremely slow to start.

Also worth noting that this is a regression over the legacy Qt version of yubioath, the old version starts instantly.

trinitronx commented 2 months ago

@OtaK:

To be completely fair, the app works. It's just extremely slow to start.

I'm not sure if this is a related symptom to the problem I encountered on Manjaro Sway edition (based on Arch) with Yubico Authenticator (yubioath-flutter) failing to open the smartcard connection...

Expand for the symptoms in logs for this issue

```console $ /opt/yubioath-desktop-beta/authenticator 11:19:01.167 [desktop.init] INFO: Logging initialized, outputting to stderr 11:19:01.169 [desktop.init] INFO: Window hidden on startup: false 11:19:01.169 [desktop.init] INFO: Starting Helper subprocess: /opt/yubioath-desktop-beta/helper/authenticator-helper 11:19:01.172 [desktop.init] INFO: Helper process started 11:19:01.421 [helper.ykman.logging] INFO: Logging at level: INFO 11:19:01.421 [helper.helper.device] INFO: Log level set to: INFO 11:19:01.421 [desktop.init] INFO: Helper log level set 11:19:01.968 [desktop.devices] INFO: USB state change {"data":{"state":1212473338440330761,"pids":{"1031":1}},"actions":["get","scan"],"children":{"XXXXXXX":{"pid":1031,"name":"YubiKey 4","serial":XXXXXXX}}} 11:19:01.971 [helper.helper.device] WARNING: Unable to connect via Traceback (most recent call last): File "helper/device.py", line 300, in get_data File "ykman/device.py", line 257, in open_connection ValueError: Unsupported Connection type 11:19:02.015 [desktop.devices] INFO: USB state updated, unaccounted for: {} 11:19:02.044 [helper.helper.device] WARNING: Error opening connection Traceback (most recent call last): File "helper/device.py", line 309, in ccid File "helper/device.py", line 293, in _create_connection File "ykman/device.py", line 257, in open_connection ValueError: Unsupported Connection type 11:19:02.044 [helper] INFO: Attempting recovery on "state-reset" 11:19:02.325 [helper.helper.device] WARNING: Error opening connection Traceback (most recent call last): File "helper/device.py", line 309, in ccid File "helper/device.py", line 293, in _create_connection File "ykman/device.py", line 257, in open_connection ValueError: Unsupported Connection type 11:19:02.598 [helper.helper.device] WARNING: Error opening connection Traceback (most recent call last): File "helper/device.py", line 309, in ccid File "helper/device.py", line 293, in _create_connection File "ykman/device.py", line 257, in open_connection ValueError: Unsupported Connection type 11:19:02.598 [helper] INFO: Attempting recovery on "state-reset" 11:19:03.002 [helper.helper.device] WARNING: Error opening connection Traceback (most recent call last): File "helper/device.py", line 309, in ccid File "helper/device.py", line 293, in _create_connection File "ykman/device.py", line 257, in open_connection ValueError: Unsupported Connection type 11:19:03.004 [helper.helper.device] WARNING: Error opening connection Traceback (most recent call last): File "helper/device.py", line 309, in ccid File "helper/device.py", line 293, in _create_connection File "ykman/device.py", line 257, in open_connection ValueError: Unsupported Connection type ```

The yubioath-flutter app requires access to the Yubikey hardware (via ykman & pcscd), which can conflict with other apps running in the background such as gpg-agent or scdaemon. It will wait indefinitely and just show a screen saying "Failed to open smartcard connection", and "Make sure pcscd is installed and running." (See screenshot below)

swappy-20240823_113157

I have solved that issue in a custom PKGBUILD by installing a wrapper script that first kills all GPG processes (gpgconf kill --all), and stops all SystemD user units including .sockets, so gpg-agent doesn't get triggered to start again while Yubikey Authenticator (yubioath-flutter) is running. After Yubikey Authenticator exits, these are restarted & commands are run to reset the state of gpg-agent so it can be used with the Yubikey again.

Not sure if it helps with your slow startup problem... but maybe it's worth a try?

# To checkout & build:
mkdir -p ~/src/pub/pkgbuild && cd ~/src/pub/pkgbuild
git clone https://gitlab.archlinux.org/trinitronx/yubioath-desktop-beta-bin.git
cd yubioath-desktop-beta-bin

# --sign is optional, but if you have Yubikey + GPG... why not?
# Just set GPGKEY="$YOUR_KEY_ID" in ~/.makepkg.conf, ensure gpg --card-status is showing your Yubikey
makepkg --cleanbuild --sign -f

# To install the locally-built package
sudo pacman -U ./yubioath-desktop-beta-bin-7.0.0-5-x86_64.pkg.tar.xz

Then, launch either via /usr/local/share/applications/com.yubico.authenticator.desktop OR /opt/yubioath-desktop-beta/linux_support/yubioath-authenticator-start.sh to use the wrapper script.