goldwarden icon indicating copy to clipboard operation
goldwarden copied to clipboard

Polkit setup failing (AUR install)

Open kre9 opened this issue 9 months ago • 12 comments

Hello, my Goldwarden instance crashes on polkit setup. I installed with AUR the newest version 0.2.15-1. Terminal output attached below.

==== AUTHENTICATING FOR org.freedesktop.policykit.exec ====
Authentication is needed to run `/usr/bin/chown root:root /usr/share/po ... actions/com.quexten.goldwarden.policy' as the super user
Authenticating as: kre
Password:
==== AUTHENTICATION FAILED ====
panic: exit status 127

goroutine 1 [running]:
github.com/quexten/goldwarden/cmd.setupPolkit()
	github.com/quexten/goldwarden/cmd/setup_linux.go:55 +0x466
github.com/quexten/goldwarden/cmd.init.func24(0xc0000ed200?, {0x56c4f3b0747a?, 0x4?, 0x56c4f3b07352?})
	github.com/quexten/goldwarden/cmd/setup_linux.go:81 +0xf
github.com/spf13/cobra.(*Command).execute(0x56c4f3f8dd60, {0x56c4f402a420, 0x0, 0x0})
	github.com/spf13/[email protected]/command.go:987 +0xab1
github.com/spf13/cobra.(*Command).ExecuteC(0x56c4f3f8c940)
	github.com/spf13/[email protected]/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/[email protected]/command.go:1039
github.com/quexten/goldwarden/cmd.Execute({{0x0, 0x0}, 0x0, {0xc00002ebd0, 0x2c}, 0x0, 0x0, {0x0, 0x0}, {0x0, ...}, ...})
	github.com/quexten/goldwarden/cmd/root.go:29 +0xe6
main.main()
	github.com/quexten/goldwarden/main.go:54 +0x618

kre9 avatar Apr 29 '24 08:04 kre9

Thanks, seems like the same issue as #156, and also seems that 0.2.15 did not fix it. What does pkexec whoami output for you?

quexten avatar Apr 29 '24 12:04 quexten

it returns root

kre9 avatar Apr 29 '24 15:04 kre9

Just to make sure, if you re-run it does it still occur? (The ==== AUTHENTICATION FAILED ==== suggests that it could just be bad password)

quexten avatar Apr 29 '24 20:04 quexten

Yes I ran it multiple times and tried a reinstall and it still occurs. Will ask a friend of mine to try it out tomorrow, maybe my install is just borked.

kre9 avatar Apr 29 '24 20:04 kre9

I'd been experiencing this continuously under 0.2.13, and again after upgrading to 0.2.16 from AUR. pkexec was also failing for me , returning this error:

 polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie

==== AUTHENTICATION FAILED ====

Error executing command as another user: Not authorized

This incident has been reported. 

Solution for me was needing to install a graphical authentication agent. I'm running on Sway currently and was able to find this mention of my issue in the NixOS project. Installing and adding mate-polkit to my config has allowed me to get through the polkit setup.

bjhuot avatar Apr 30 '24 02:04 bjhuot

I feel like we should catch this error and give a better error message, even though a polkit agent is described in the wiki as required.

quexten avatar Apr 30 '24 08:04 quexten

If I'm understanding it correctly, the bug is related to polkit & pkttyagent itself. https://gitlab.freedesktop.org/polkit/polkit/-/issues/17

bjhuot avatar Apr 30 '24 14:04 bjhuot

Solution for me was needing to install a graphical authentication agent. I'm running on Sway currently and was able to find this mention of my issue in the NixOS project. Installing and adding mate-polkit to my config has allowed me to get through the polkit setup.

seconded. for some reason, I was having an issue running the KDE polkit agent (which is graphical). I switched to the MATE polkit agent and everything is working fine now.

blackthorne7 avatar Apr 30 '24 17:04 blackthorne7

same here

goldwarden setup polkit
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ====
Authentication is needed to run `/usr/bin/chown root:root /usr/share/po ... actions/com.quexten.goldwarden.policy' as the super user
Authenticating as: Andres David Ortiz (zany130)
Password:
==== AUTHENTICATION FAILED ====
panic: exit status 127

goroutine 1 [running]:
github.com/quexten/goldwarden/cmd.setupPolkit()
	github.com/quexten/goldwarden/cmd/setup_linux.go:55 +0x466
github.com/quexten/goldwarden/cmd.init.func24(0xc000139200?, {0x581e3ed8147a?, 0x4?, 0x581e3ed81352?})
	github.com/quexten/goldwarden/cmd/setup_linux.go:81 +0xf
github.com/spf13/cobra.(*Command).execute(0x581e3f207d60, {0x581e3f2a4480, 0x0, 0x0})
	github.com/spf13/[email protected]/command.go:987 +0xab1
github.com/spf13/cobra.(*Command).ExecuteC(0x581e3f206940)
	github.com/spf13/[email protected]/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/[email protected]/command.go:1039
github.com/quexten/goldwarden/cmd.Execute({{0x0, 0x0}, 0x0, {0xc00002ec00, 0x30}, 0x0, 0x0, {0x0, 0x0}, {0x0, ...}, ...})
	github.com/quexten/goldwarden/cmd/root.go:29 +0xe6
main.main()
	github.com/quexten/goldwarden/main.go:54 +0x618
	

but polkit setup seems to be working as it does correctly bring up a polkit prompt whenever goldwarden needs my password.

this seems to be an issue with kde's polkit agent? FWIW:

pacman -Qi polkit-kde-agent
Name            : polkit-kde-agent
Version         : 6.0.4-1

it should be noted that even though it "fails" to setup polkit goldwarden still successfully gives a polkit prompt whenever it needs my users password and it seems to work fine.

no idea how to switch polkit agents so don't know if that eliminates the "issue"

pkexec whoami also returns root for me

zany130 avatar May 04 '24 20:05 zany130

same here

goldwarden setup polkit
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ====
Authentication is needed to run `/usr/bin/chown root:root /usr/share/po ... actions/com.quexten.goldwarden.policy' as the super user
Authenticating as: Andres David Ortiz (zany130)
Password:
==== AUTHENTICATION FAILED ====
panic: exit status 127

goroutine 1 [running]:
github.com/quexten/goldwarden/cmd.setupPolkit()
	github.com/quexten/goldwarden/cmd/setup_linux.go:55 +0x466
github.com/quexten/goldwarden/cmd.init.func24(0xc000139200?, {0x581e3ed8147a?, 0x4?, 0x581e3ed81352?})
	github.com/quexten/goldwarden/cmd/setup_linux.go:81 +0xf
github.com/spf13/cobra.(*Command).execute(0x581e3f207d60, {0x581e3f2a4480, 0x0, 0x0})
	github.com/spf13/[email protected]/command.go:987 +0xab1
github.com/spf13/cobra.(*Command).ExecuteC(0x581e3f206940)
	github.com/spf13/[email protected]/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/[email protected]/command.go:1039
github.com/quexten/goldwarden/cmd.Execute({{0x0, 0x0}, 0x0, {0xc00002ec00, 0x30}, 0x0, 0x0, {0x0, 0x0}, {0x0, ...}, ...})
	github.com/quexten/goldwarden/cmd/root.go:29 +0xe6
main.main()
	github.com/quexten/goldwarden/main.go:54 +0x618
	

but polkit setup seems to be working as it does correctly bring up a polkit prompt whenever goldwarden needs my password.

this seems to be an issue with kde's polkit agent? FWIW:

pacman -Qi polkit-kde-agent
Name            : polkit-kde-agent
Version         : 6.0.4-1

it should be noted that even though it "fails" to setup polkit goldwarden still successfully gives a polkit prompt whenever it needs my users password and it seems to work fine.

no idea how to switch polkit agents so don't know if that eliminates the "issue"

pkexec whoami also returns root for me

Are you using Plasma? I'm sure there's a way to change the polkit agent there, but it's possible that it would break something else in your DE.

it might be worth opening a bug report on the plasma desktop gitlab.

blackthorne7 avatar May 05 '24 01:05 blackthorne7

same here, Manjaro Unstable branch

KweezyCode avatar May 16 '24 03:05 KweezyCode

I'm getting something quite different and unexpected but still an issue with the polkit setup:

panic: exec: "pkexec": executable file not found in $PATH

goroutine 1 [running]:
github.com/quexten/goldwarden/cli/cmd.setupPolkit()
	/home/runner/work/goldwarden/goldwarden/cli/cmd/setup_linux.go:49 +0x46f
github.com/quexten/goldwarden/cli/cmd.init.func24(0xc0000ef300?, {0x937142?, 0x4?, 0x93701a?})
	/home/runner/work/goldwarden/goldwarden/cli/cmd/setup_linux.go:81 +0xf
github.com/spf13/cobra.(*Command).execute(0xced320, {0xd8a080, 0x0, 0x0})
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:987 +0xab1
github.com/spf13/cobra.(*Command).ExecuteC(0xcebf00)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1039
github.com/quexten/goldwarden/cli/cmd.Execute({{0x0, 0x0}, 0x0, {0xc000030230, 0x41}, 0x0, 0x0, {0x0, 0x0}, {0x0, ...}, ...})
	/home/runner/work/goldwarden/goldwarden/cli/cmd/root.go:29 +0xe6
main.main()
	/home/runner/work/goldwarden/goldwarden/main.go:54 +0x618

Yet I have extra/polkit installed which provides pkexec, running pkexec whoami returns root, and I even tried adding /usr/bin/pkexec to my PATH but I still get the same thing.

peterc-s avatar Jul 15 '24 14:07 peterc-s