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

Policykit issue when launching fapolicy-analyzer a second time #284

Closed
jw3 opened this issue Oct 1, 2021 · 8 comments · Fixed by #306
Closed

Policykit issue when launching fapolicy-analyzer a second time #284

jw3 opened this issue Oct 1, 2021 · 8 comments · Fixed by #306
Assignees
Labels
bug Something isn't working

Comments

@jw3
Copy link
Member

jw3 commented Oct 1, 2021

From fc34 vm

  1. Run fapolicy-analyzer
  2. Close and run again
[vagrant@fedora ~]$ fapolicy-analyzer 
Error executing command as another user: No authentication agent found.
Terminating pkttyagent.
@jw3 jw3 added the bug Something isn't working label Oct 1, 2021
@jw3 jw3 added this to the 4 - Policy Analysis (read-only) milestone Oct 1, 2021
@scholarsmate
Copy link
Member

scholarsmate commented Oct 1, 2021

Possibly related, but I'm now seeing many Connection refused errors when starting up in RHEL8.

[vagrant@rhel8 fapolicy-analyzer]$ pipenv run python -m fapolicy_analyzer.ui
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
loaded system in 10 seconds
loaded system in 5 seconds

(__main__.py:42922): dconf-WARNING **: 14:46:51.989: failed to commit changes to dconf: Could not connect: Connection refused

(__main__.py:42922): dconf-WARNING **: 14:46:52.043: failed to commit changes to dconf: Could not connect: Connection refused

(__main__.py:42922): dconf-WARNING **: 14:46:52.056: failed to commit changes to dconf: Could not connect: Connection refused
...

@tparchambault
Copy link
Contributor

It appears that pkttyagent started because that output text Terminating pkttyagent. is conditional and will only run if pkttyagent started and has a pid. Whether it then immediately failed/terminated or did not fully complete it's initialization needs to be determined.

@tparchambault
Copy link
Contributor

Re: Scholarsmate's comment:

[vagrant@rhel8 fapolicy-analyzer]$ pipenv run python -m fapolicy_analyzer.ui
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
loaded system in 10 seconds
loaded system in 5 seconds

Since the app was started directly and not through the wrapper script this is not pkexec/polkit related. It could be permission related but since the system was loaded w/o complaint, I don't think that's the issue either.

I have seen these WARNING messages previously during general dev work but unfortunately don't remember the underlying issues.

jw3 added a commit that referenced this issue Oct 6, 2021
@tparchambault tparchambault self-assigned this Oct 12, 2021
@tparchambault
Copy link
Contributor

I have duplicated the OP's symptom. It is inconsistent but on my system occurs ~50% of the time.

I also see the following complaints:
dbind-WARNING **: 18:39:28.001: Couldn't connect to accessibility bus: ...

@tparchambault
Copy link
Contributor

The above warning messages do not occur when pkexec is not the authenticating parent invoking "python -m fapolicy_analyzer.ui."

@tparchambault
Copy link
Contributor

The pkttyagent appears to be not consistently starting and/or does not stay up when the issue occurs. Next step is to enable verbosity in the polkitd daemon to determine what end of the client/server connection is not playing nice. I believe it's available via an env var. Will also look at client code to see if enabling verbosity is available.

@tparchambault
Copy link
Contributor

pkttyagent authorization agent does not complete its registration on the dbus prior to the pkexec call that execs the fapolicy-analyzer.

Next step: Leverage the pkttyagent's fd callback mechanism to signal the fapolicy-analyzer wrapper script that it can proceed to the pkexec.

@tparchambault
Copy link
Contributor

Let's leave this open a bit longer, while this PR is being banged on by the limited user base, since it only get exercised on rpm installations. The following PR has been mergeed into master, tested on the release 0.3.0 branch, and as of the merge into master, dev work has been effectively completed.
Restore PolicyKit integration #308

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants