flathub / com.mojang.Minecraft

https://flathub.org/apps/details/com.mojang.Minecraft
33 stars 13 forks source link

Microsoft account doesn't remain logged in on non-GNOME systems #116

Open vulongm opened 2 years ago

vulongm commented 2 years ago

When signing in with a Microsoft account I notice a warning that something went wrong and it would not automatically sign in the next session. The message links to https://help.minecraft.net/hc/en-us/articles/4408668374925-Secure-Token-Storage-Failure-on-Linux. image

iamWing commented 1 year ago

Using the latest version installed from flatpak on Steam Deck and still seeing the same issue (as expected, but hoping for a workaround). Please lemme know if there's anything I can test to help fix this issue. Thanks

AngryAnt commented 1 year ago

@iamWing FYI we ended up switching to org.prismlauncher.PrismLauncher. It's a bit more involved to work with (by design), but persisted login works. Just needs re-authenticating with your MS/Xbox account every once in a while.

AsciiWolf commented 1 year ago

@iamWing You can file the xdg-desktop-portal-kde bug tracker ticket for adding org.freedesktop.portal.Secret interface support to the portal. See this comment (and my reply): https://github.com/flathub/com.mojang.Minecraft/pull/132#issuecomment-1280878891

Thanks!

zhsj commented 1 year ago

FWIW, the only needed override is

flatpak override --user --talk-name=org.freedesktop.secrets com.mojang.Minecraft
busctl --user status org.freedesktop.secrets ``` PID=2350 PPID=885 TTY=n/a UID=1000 EUID=1000 SUID=1000 FSUID=1000 OwnerUID=1000 GID=1000 EGID=1000 SGID=1000 FSGID=1000 SupplementaryGIDs=24 25 27 29 30 44 46 106 109 113 120 1000 Comm=kwalletd5 Exe=/usr/bin/kwalletd5 CommandLine=/usr/bin/kwalletd5 Label=unconfined CGroup=/user.slice/user-1000.slice/user@1000.service/session.slice/dbus.service Unit=user@1000.service Slice=user-1000.slice UserUnit=dbus.service UserSlice=session.slice Session=n/a AuditLoginUID=1000 AuditSessionID=4 UniqueName=:1.59 EffectiveCapabilities= PermittedCapabilities= InheritableCapabilities= BoundingCapabilities=cap_chown cap_dac_override cap_dac_read_search cap_fowner cap_fsetid cap_kill cap_setgid cap_setuid cap_setpcap cap_linux_immutable cap_net_bind_service cap_net_broadcast cap_net_admin cap_net_raw cap_ipc_lock cap_ipc_owner cap_sys_module cap_sys_rawio cap_sys_chroot cap_sys_ptrace cap_sys_pacct cap_sys_admin cap_sys_boot cap_sys_nice cap_sys_resource cap_sys_time cap_sys_tty_config cap_mknod cap_lease cap_audit_write cap_audit_control cap_setfcap cap_mac_override cap_mac_admin cap_syslog cap_wake_alarm cap_block_suspend cap_audit_read cap_perfmon cap_bpf cap_checkpoint_restore ```
AsciiWolf commented 1 year ago

Thanks, but it does not matter if just a simple override is needed - this should not be merged. Implementing this in a portal is the only clean, proper solution. Currently, the only remaining thing is adding org.freedesktop.secrets support to xdg-desktop-portal-kde.

edit: Here are more details from my old comment.

AsciiWolf commented 1 year ago

As it turned out, there is a missing org.freedesktop.impl.portal.Secret interface that actually needs to be implemented on a KWallet side. I have filed an upstream ticket here: https://bugs.kde.org/show_bug.cgi?id=466197

K4LCIFER commented 1 year ago

FWIW, the only needed override is

flatpak override --user --talk-name=org.freedesktop.secrets com.mojang.Minecraft

this worked for me.

StaelensJarne commented 1 year ago

What is the status off this issue for SteamOS?

I tested this override for steamOS and it didn't output anything. Can I do any overrides in SteamOS? Because some parts of SteamOS are read-only. And it is not recommended to disable the read-only filesystem unless you really knows what you are doing.

JordanL2 commented 1 year ago

Can I do any overrides in SteamOS? Because some parts of SteamOS are read-only. And it is not recommended to disable the read-only filesystem unless you really knows what you are doing.

You can do overrides for your user account, because those overrides are stored in your home directory.

AsciiWolf commented 1 year ago

What is the status off this issue for SteamOS?

See this comment: https://github.com/flathub/com.mojang.Minecraft/pull/141#issuecomment-1609696763

After it is implemented in upstream, you will have to wait until SteamOS updates to the upstream version that has this fix included. Also, be prepared that it will most likely work only in the Desktop mode of SteamOS.

BubzyH commented 5 months ago

I got this issue on KDE Enable Kwallet resolve this.

StaelensJarne commented 5 months ago

I usinstalled the flatplak and started using the Prism Launcher

With the Prism Launcher it works out of the box and there is no change to SteamOS needed.

AsciiWolf commented 5 months ago

Yep, every (non-official) launcher that does not use the secret portal/api should work fine.

AsciiWolf commented 4 months ago

The issue has been fixed in KDE.

MilesBHuff commented 3 months ago

@AsciiWolf I'm actually still having this issue in KDE, on OpenSUSE Tumbleweed.

When starting the Flatpak version of the official Minecraft launcher, I get this error from the KDE Wallet Service: "There have been repeated failed attempts to gain access to a wallet. An application may be misbehaving."; I then have to sign in again, every single time I start the app. The native version works fine, but I don't like running proprietary software natively when I have the option not to.

Image 1 Image 2

The following workarounds aren't working for me, either:

Is it possible that these workarounds were broken by the fix that @AsciiWolf mentioned got merged to KDE?

EDIT: This is actually happening with all Flatpaks that attempt to use the wallet.

JordanL2 commented 3 months ago

If anyone is still having this issue, try resetting all changes you've made to the flatpak in Flatseal. I just did that and it fixed it, apparently the changes I'd made in the past to fix it were now breaking it.

AsciiWolf commented 3 months ago

Is it possible that these workarounds were broken by the fix that @AsciiWolf mentioned got merged to KDE?

EDIT: This is actually happening with all Flatpaks that attempt to use the wallet.

Yep, it sadly is the case. Fortunately, the fix for this fix is already merged and should be present in latest KDE update.

MilesBHuff commented 3 months ago

Fortunately, the fix for this fix is already merged and should be present in latest KDE update.

Can confirm; all of my non-Minecraft Flatpak apps that use the keyring are working again now, after the latest KDE update. Thanks for fixing that!

Unfortunately, although Minecraft now appears to be accessing the keyring, it is failing to complete the login process; I can't even log in manually. So I am now unable to play Minecraft, at least with the official launcher.

MilesBHuff commented 3 months ago

Ah, turns out Minecraft just randomly decided it didn't like my home network anymore for some reason? It lets me log in via mobile hotspot; and once I'm logged-in, it stays logged-in, even on my home network, thanks to the work you did upstream. Thanks for helping fix this bug for everyone!

vulongm commented 3 months ago

Working here with the newest KDE update and no overrides as well! image

John-Development commented 2 months ago

For me it keeps loosing session even if kdewallet is working and saving data. Each time I restart my computer the app seems to loose the login data, but not when i just reopen the app without reboot... someone having the same issue?

imagen

EDIT: using Plasma 6 in KDE Neon

JordanL2 commented 2 months ago

This recently broke again with a Plasma 6 update, on Arch. I have to log in manually every time I run Minecraft again.

AsciiWolf commented 2 months ago

Please, file a new KDE ticket if it worked correctly before and a recent Plasma update broke it.

Also, what KWallet version do you have? It should work correctly with 6.2.1 or newer.

JordanL2 commented 2 months ago

KWallet 6.2.1.

JordanL2 commented 2 months ago

Here are the logs I get when I re-open the Minecraft launcher, after logging in the first time:

[0612/181449.366317:INFO:main_context.cpp(131)] CEF initialized successfully.
[0612/181449.366367:INFO:main_context.cpp(133)] CEF version: 99.2.14+g3f796b8+chromium-99.0.4844.84
sh: line 1: orca: command not found
[0612/181449.411491:ERROR:object_proxy.cc(623)] Failed to call method: org.kde.KWallet.isEnabled: object_path= /modules/kwalletd: org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown
[0612/181449.411531:ERROR:kwallet_dbus.cc(100)] Error contacting kwalletd (isEnabled)
[0612/181449.411663:ERROR:object_proxy.cc(623)] Failed to call method: org.kde.KLauncher.start_service_by_desktop_name: object_path= /KLauncher: org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown
[0612/181449.411678:ERROR:kwallet_dbus.cc(72)] Error contacting klauncher to start kwalletd
[0612/181449.411690:WARNING:key_storage_linux.cc(209)] OSCrypt tried KWallet but couldn't initialise.
[0612/181449.411863:ERROR:object_proxy.cc(623)] Failed to call method: org.kde.KWallet.close: object_path= /modules/kwalletd: org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown
[0612/181449.411876:ERROR:kwallet_dbus.cc(418)] Error contacting kwalletd (close)
[0612/181449.412902:ERROR:simple_backend_impl.cc(735)] Simple Cache Backend: wrong file structure on disk: 2 path: /home/jordan/.var/app/com.mojang.Minecraft/data/../.minecraft/webcache2/Code Cache/js
[0612/181449.413010:ERROR:simple_backend_impl.cc(735)] Simple Cache Backend: wrong file structure on disk: 2 path: /home/jordan/.var/app/com.mojang.Minecraft/data/../.minecraft/webcache2/Code Cache/js
[0612/181449.413008:ERROR:simple_backend_impl.cc(735)] Simple Cache Backend: wrong file structure on disk: 2 path: /home/jordan/.var/app/com.mojang.Minecraft/data/../.minecraft/webcache2/Code Cache/wasm
[0612/181449.413031:ERROR:disk_cache.cc(185)] Unable to create cache
[0612/181449.413165:ERROR:simple_backend_impl.cc(735)] Simple Cache Backend: wrong file structure on disk: 2 path: /home/jordan/.var/app/com.mojang.Minecraft/data/../.minecraft/webcache2/Code Cache/wasm
[0612/181449.413202:ERROR:disk_cache.cc(185)] Unable to create cache
Created browser window for reuse: 0x1000003
Gtk-Message: 18:14:49.431: Failed to load module "colorreload-gtk-module"
Gtk-Message: 18:14:49.431: Failed to load module "window-decorations-gtk-module"
[0612/181449.433255:ERROR:browser_main_loop.cc(268)] Gdk: _gdk_frame_clock_freeze: assertion 'GDK_IS_FRAME_CLOCK (clock)' failed
[0612/181449.566950:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[0612/181450.538857:WARNING:value_store_frontend.cc(47)] Reading mhjfbmdgcfjbbpaeojofohoefgiehjai.alarms from  failed: IO error: .../LOCK: Access denied. (ChromeMethodBFE: 15::LockFile::5)
[0612/181453.662237:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
Created browser window for reuse: 0x1000015
[0612/181519.915386:ERROR:simple_backend_impl.cc(735)] Simple Cache Backend: wrong file structure on disk: 2 path: /home/jordan/.var/app/com.mojang.Minecraft/data/../.minecraft/webcache2/Cache/Cache_Data
[0612/181519.915584:ERROR:cache_util.cc(146)] Unable to move cache folder /home/jordan/.var/app/com.mojang.Minecraft/data/../.minecraft/webcache2/Cache/Cache_Data to /home/jordan/.var/app/com.mojang.Minecraft/data/../.minecraft/webcache2/Cache/old_Cache_Data_000
[0612/181519.915602:ERROR:disk_cache.cc(185)] Unable to create cache
JordanL2 commented 2 months ago

I just fixed it by adding "org.kde.KWallet" to the enabled System Bus names.

EDIT: Rebooted and it's broken again.

AsciiWolf commented 2 months ago

Even if it resolved the problem, it is a workaround, not a proper fix. It should work out-of-box and weird thing is that some users already confirmed that it does work fine for them. I personally do not use KDE, so I am sadly not able to help.

AsciiWolf commented 2 months ago

After/if you report the issue to the KDE Bugtracker, please share its url here. Thanks!

RokeJulianLockhart commented 1 month ago

https://github.com/flathub/com.mojang.Minecraft/issues/116#issuecomment-2163242279

@John-Development, might you be experiencing what https://bugzilla.redhat.com/show_bug.cgi?id=2276060 describes?

https://github.com/flathub/com.mojang.Minecraft/issues/116#issuecomment-2163561637

@JordanL2, how did you add it?

AsciiWolf commented 5 days ago

https://bugs.kde.org/show_bug.cgi?id=492541

RokeJulianLockhart commented 5 days ago

https://github.com/flathub/com.mojang.Minecraft/issues/116#issuecomment-2324579103

@AsciiWolf, should be fixed in KDE Plasma 6.2.1, per the https://bugs.kde.org/page.cgi?id=fields.html#cf_versionfixedin of https://bugs.kde.org/show_bug.cgi?id=487348.

AsciiWolf commented 5 days ago

If it still happens on Fedora 40 (with KWallet 6.5.0), it is not fixed.

(Note that KDE Plasma and KWallet version numbers do not appear to be the same.)

Justinzobel commented 5 days ago

This appears fixed for me, I'm running Plasma built from source!

RokeJulianLockhart commented 5 days ago

https://github.com/flathub/com.mojang.Minecraft/issues/116#issuecomment-2324797676

@Justinzobel, which version? (Not commit, just Plasma version.)

Justinzobel commented 5 days ago

#116 (comment)

@Justinzobel, which version? (Not commit, just Plasma version.)

6.1.80

Ruggii commented 2 days ago

I have the same issue on ChromeOS, but not on Fedora 35

I managed to solve it, finally. I run the minecraft launcher on Chrome OS. I installed gnome-keyring through the command sudo apt install gnome-keyring

AsciiWolf commented 2 days ago

Thanks for the workaround, Ruggii! It indeed is a different issue on ChromeOS (and can be worked around by installing gnome-keyring), not related to the KDE one.