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

Empty (blank) page on launch. Console output on refresh: flatpak-spawn: Invalid byte sequence in conversion input #29

Closed
travier opened this issue Jun 30, 2023 · 16 comments · Fixed by cockpit-project/cockpit#19063

Comments

@travier
Copy link
Member

travier commented Jun 30, 2023

Launching Cockpit client gives me an empty (blank) page on launch.

Pressing the refresh button generated the following output in console logs:

flatpak-spawn: Invalid byte sequence in conversion input

Fedora Kinoite 38, Wayland.

@travier
Copy link
Member Author

travier commented Jun 30, 2023

Looks like the client assumes that some parts of Cockpits are installed on the host: https://github.com/cockpit-project/cockpit/blob/main/src/client/cockpit-client-ssh#L57

My bad, miss-read that.

@allisonkarlitskaya
Copy link
Collaborator

@travier thanks for the report. Just to confirm: "on launch" means "immediately on startup" and not "after trying to press the connect button"?

Are you a new user of Cockpit Client or is this a regression that was observed after you upgraded to the latest version?

@travier
Copy link
Member Author

travier commented Jul 3, 2023

Yes, it was stuck on a blank page before connecting to a server, directly on launch.

I've re-tried today, clearing all Flatpak data and it works now so I'm not sure where the issue was.

@travier travier closed this as completed Jul 3, 2023
@travier travier reopened this Jul 3, 2023
@travier
Copy link
Member Author

travier commented Jul 3, 2023

OK, I've re-tried again and now the client is stuck again on a blank page.

@travier
Copy link
Member Author

travier commented Jul 3, 2023

This happens when I launch Cockpit from the KDE menu but not always when I launch from the command line.

@travier
Copy link
Member Author

travier commented Jul 3, 2023

OK, clearing the data again, I can consistently reproduce that. Launching from the KDE menu give me a blank page, when launching from the command line gives me the window as expected.

@travier
Copy link
Member Author

travier commented Jul 3, 2023

They are not launched using the same parameters (first is command line, second is desktop entry):

$ ps aux | grep cockpit
tim        39000  0.3  0.0   3492  1920 pts/1    S+   15:34   0:00 /usr/bin/bwrap --args 38 cockpit-client
tim        39010  0.1  0.0   3604  1168 pts/1    S+   15:34   0:00 /usr/bin/bwrap --args 38 cockpit-client
tim        39011  3.7  0.4 91494292 147208 pts/1 Sl+  15:34   0:00 python3 /app/bin/cockpit-client
tim        39031  0.0  0.0 160052  6784 pts/1    Sl+  15:34   0:00 /app/libexec/cockpit-ws --address=127.0.0.90 --port=9090
tim        39419  0.0  0.0 222548  2432 pts/3    S+   15:35   0:00 grep --color=auto cock
$ ps aux | grep cockpit
tim        39463  0.2  0.0   3492  1920 ?        Ss   15:35   0:00 /usr/bin/bwrap --args 38 cockpit-client --gapplication-service
tim        39473  0.2  0.0   3584  1280 ?        S    15:35   0:00 /usr/bin/bwrap --args 38 cockpit-client --gapplication-service
tim        39474  3.8  0.3 107930872 129136 ?    Sl   15:35   0:00 python3 /app/bin/cockpit-client --gapplication-service

@travier
Copy link
Member Author

travier commented Jul 3, 2023

Looks like KDE shows the second one only in the menu:

$ cat /var/lib/flatpak/exports/share/applications/org.cockpit_project.CockpitClient.desktop
[Desktop Entry]
Type=Application
Name=Cockpit Client
Comment=Connect via ssh to servers running Cockpit
Icon=org.cockpit_project.CockpitClient
DBusActivatable=true
Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=cockpit-client org.cockpit_project.CockpitClient
Categories=Network;RemoteAccess
X-Flatpak=org.cockpit_project.CockpitClient
$ cat /var/lib/flatpak/exports/share/dbus-1/services/org.cockpit_project.CockpitClient.service
[D-BUS Service]
Name=org.cockpit_project.CockpitClient
Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=cockpit-client org.cockpit_project.CockpitClient --gapplication-service

@travier
Copy link
Member Author

travier commented Jul 3, 2023

Starting the application "in a loop", I see a lot of IBus errors in the journal logs:

Jul 03 15:41:11 phoenix systemd[1570]: Started app-flatpak-org.cockpit_project.CockpitClient-40872.scope.
Jul 03 15:41:15 phoenix systemd[1570]: Started app-flatpak-org.cockpit_project.CockpitClient-40908.scope.
Jul 03 15:41:15 phoenix xdg-desktop-portal-kde[1886]: xdp-kde-settings: Namespace  "org.gnome.desktop.a11y.interface"  is not supported
Jul 03 15:41:15 phoenix systemd[1570]: Started app-flatpak-org.cockpit_project.CockpitClient-40945.scope.
Jul 03 15:41:16 phoenix systemd[1570]: Started dbus-:1.2-org.freedesktop.portal.IBus@33.service.
Jul 03 15:41:16 phoenix ibus-portal[40970]: Not connected to the ibus bus
Jul 03 15:41:16 phoenix systemd[1570]: dbus-:1.2-org.freedesktop.portal.IBus@33.service: Main process exited, code=exited, status=1/FAILURE
Jul 03 15:41:16 phoenix systemd[1570]: dbus-:1.2-org.freedesktop.portal.IBus@33.service: Failed with result 'exit-code'.
Jul 03 15:41:28 phoenix systemd[1570]: Started app-flatpak-org.cockpit_project.CockpitClient-40996.scope.
Jul 03 15:41:28 phoenix xdg-desktop-portal-kde[1886]: xdp-kde-settings: Namespace  "org.gnome.desktop.a11y.interface"  is not supported
Jul 03 15:41:28 phoenix systemd[1570]: Started app-flatpak-org.cockpit_project.CockpitClient-41058.scope.
Jul 03 15:41:29 phoenix systemd[1570]: Started dbus-:1.2-org.freedesktop.portal.IBus@34.service.
Jul 03 15:41:29 phoenix ibus-portal[41083]: Not connected to the ibus bus
Jul 03 15:41:29 phoenix systemd[1570]: dbus-:1.2-org.freedesktop.portal.IBus@34.service: Main process exited, code=exited, status=1/FAILURE
Jul 03 15:41:29 phoenix systemd[1570]: dbus-:1.2-org.freedesktop.portal.IBus@34.service: Failed with result 'exit-code'.
Jul 03 15:41:36 phoenix systemd[1570]: Started app-flatpak-org.cockpit_project.CockpitClient-41101.scope.
Jul 03 15:41:36 phoenix xdg-desktop-portal-kde[1886]: xdp-kde-settings: Namespace  "org.gnome.desktop.a11y.interface"  is not supported
Jul 03 15:41:36 phoenix systemd[1570]: Started app-flatpak-org.cockpit_project.CockpitClient-41138.scope.
Jul 03 15:41:36 phoenix systemd[1570]: Started dbus-:1.2-org.freedesktop.portal.IBus@35.service.
Jul 03 15:41:36 phoenix ibus-portal[41165]: Not connected to the ibus bus

@allisonkarlitskaya
Copy link
Collaborator

This appears to be a problem with the way KDE is trying to D-Bus-activate the application. If you're feeling up to it, can you please try the following?

  1. Uninstall all existing versions of the flatpak from your computer
  2. Get a source checkout of the main branch of https://github.com/cockpit-project/cockpit
  3. Edit src/client/org.cockpit_project.CockpitClient.desktop and remove the DBusActivatable=true line
  4. Build the flatpak locally by running containers/flatpak/install --user --install-deps-from=flathub

and then see if the problem is solved?

Thanks

@travier
Copy link
Member Author

travier commented Jul 3, 2023

Doing the above fixes the issue:

$ cat ~/.local/share/flatpak/exports/share/applications/org.cockpit_project.CockpitClient.desktop  
[Desktop Entry]
Type=Application
Name=Cockpit Client
Comment=Connect via ssh to servers running Cockpit
Icon=org.cockpit_project.CockpitClient
Exec=/usr/bin/flatpak run --branch=devel --arch=x86_64 --command=cockpit-client org.cockpit_project.CockpitClient
Categories=Network;RemoteAccess
X-Flatpak=org.cockpit_project.CockpitClient

@travier
Copy link
Member Author

travier commented Jul 3, 2023

OK, this looks like https://bugzilla.redhat.com/show_bug.cgi?id=1869108 or flatpak/flatpak#3342 as I did:

$ sudo systemctl reload dbus-broker.service 

and now it works. This is also likely why it worked after a reboot.

@travier
Copy link
Member Author

travier commented Jul 3, 2023

Hum, it's not working anymore again, so it must be something else 🤔

@allisonkarlitskaya
Copy link
Collaborator

I think we may as well disable D-Bus activation by default. We use it from the test cases, but that should still work even if we don't have it in the desktop file.

allisonkarlitskaya added a commit to allisonkarlitskaya/cockpit that referenced this issue Jul 4, 2023
This doesn't seem to be particularly well supported in all flatpak
environments, particularly under KDE.

Fixes flathub/org.cockpit_project.CockpitClient#29
@allisonkarlitskaya
Copy link
Collaborator

@travier just to be extra-sure, can you please try and build the branch that I just pushed at cockpit-project/cockpit#19063 and confirm that it fixes the issue for you?

allisonkarlitskaya added a commit to cockpit-project/cockpit that referenced this issue Jul 4, 2023
This doesn't seem to be particularly well supported in all flatpak
environments, particularly under KDE.

Fixes flathub/org.cockpit_project.CockpitClient#29
@travier travier mentioned this issue Jul 24, 2023
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

Successfully merging a pull request may close this issue.

2 participants