AGL compositor "couldn't commit new state: Permission denied"

Not a Bug

Description

Sometimes (but always when booting system for the first time after flashing) I can agl-compositor failures

Environment

None

Attachments

1

Activity

Show:

Marius Vlad 
November 2, 2022 at 3:21 PM

Awesome, thanks for the investigation

Vasyl Vavrychuk 
November 1, 2022 at 11:31 AM

Apparently this was configuration issue on my side. I have local changes to psplash configuration to use DRM for rendering boot animation.

The problem was that I did not stopped psplash properly before starting AGL compositor.

Marius, sorry for disturbing.

Marius Vlad 
October 22, 2022 at 8:04 AM

Maybe in weston service we need "After=polkit.service"

I think you meant here Before, rather than After, right?

How is VY change related to DRM commit?

I believe systemd-logind doesn't change to graphics model the tty, in case polkit doesn't
change the VT. Weston relies on systemd-logind to have everything set-up, and before actually
doing DRM operations we need the tty to be in what we call graphics mode (different that text mode).

Either that, or not owning that current VT (so you're stating on tty1, but weston is made to start on tty7, rather than tty1) to make this mishap happen. Or maybe both?

I wonder if there's a race between systemd-logind, polkit and weston when starting up. Weston depends on systemd-logind to set-up the session, but it doesn't wait for that graphical change to happen, but instead it finishes and then weston takes over. But the graphical mode is set no set-up, moment in which that commit fails. Not really sure if weston attempts to do any other commits or if the graphical session is indeed set-up after some time, but I guess that would be easy to check.

Is that patch you mentioned basically added automatically when not compiling polkit into the image basically, or is added
always?

I just remembered now I had to add polkit deliberately in some AGL demo images, when we switched to flutter/cluster-demo image as without it I would be seeing the same issue.

On tty1 pslash was setting up the graphic mode, and when weston attempt to start it failed. Manually changing to the tty that weston had to start, and then manually attempting to start weston on it worked. Had to do some dbus-monitor debug to make sense why systemd-logind wasn't able to change to that vt and it proved to be the fact that polkit wasn't installed at all in those images.

Vasyl Vavrychuk 
October 21, 2022 at 10:52 PM

Apparently, with poky this was configuration issue on my side. Adding

but not adding

so polkit service was not running.

What I don't get is why not running polkit results in failure

How is VT change related to DRM commit?

If systemd is not compiled with polkit, this helps https://github.com/systemd/systemd/pull/17494/commits/79f3988517cf40e05cedc40ec7c6e49d9a23298a

Maybe in weston service we need "After=polkit.service".

Marius Vlad 
October 21, 2022 at 11:15 AM

> Don't know I am not familiar with polkit. Somehow it works all fine in poky.

Polkit is used to change the VT, as normal users doesn't have that ability. We require having it when running weston as user. What probably happens in poky is that something else changes the VT, if weston still runs as as user. Or maybe there's a patch for weston that that does that? 

I vaguely remember that poky had some specific stuff doing to allow running as a normal user, as that wasn't really easy. 

> Yep. This suggest that this issue is maybe different from what I get with AGL because with AGL it is not 100% reproducible.

Yeah, this bit a quite weird, so there's definitely something different the two. 

Details

Assignee

Reporter

Hardware Platform(s) Affected

Renesas H3

Components

Affects versions

Priority

Created October 6, 2022 at 9:45 AM
Updated November 14, 2022 at 11:15 PM
Resolved November 1, 2022 at 11:31 AM