Bug 2244876 - authentication is required to update metadata
Summary: authentication is required to update metadata
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: flatpak
Version: 40
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: David King
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-10-18 17:19 UTC by Martin Rixham
Modified: 2025-05-16 07:45 UTC (History)
10 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-05-16 07:45:40 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Martin Rixham 2023-10-18 17:19:43 UTC
When I switch users after authenticating in GDM I get a dialog that says "authentication is required to update metadata".

I have to give my password to two of these dialogs in succession for it to go away.

This happens when switching between to admin accounts in either direction, haven't tried with non-admin account.

Reproducible: Always

Steps to Reproduce:
1. create two admin accounts
2. log in to one account
3. switch users and log in to the other
4. switch back to see the authentication dialog
Actual Results:  
two dialogs in succession asking for admin password

Expected Results:  
having just authenticated in GDM I wouldbn't expect to be asked for the same password twice again

Comment 1 Jan Rybar 2023-10-19 12:20:25 UTC
Hello, this is usually PackageKit requesting authentization to get authorization for updating repository metadata.  
Can you please confirm by running `journalctl -S -2m -u polkit.service` in terminal right after this happens and copying the output lines here?  

Thank you.

Comment 2 Martin Rixham 2023-10-19 21:17:18 UTC
thanks, here's the log:

[martin@localhost-live ~]$ journalctl -S -2m -u polkit.service
Oct 19 22:15:19 fedora polkitd[27417]: Operator of unix-session:19 successfully authenticated as unix-user:martin to >
Oct 19 22:15:21 fedora polkitd[27417]: Operator of unix-session:19 successfully authenticated as unix-user:martin to >
Oct 19 22:15:26 fedora polkitd[27417]: Unregistered Authentication Agent for unix-session:c19 (system bus name :1.368>

Comment 3 thomas 2024-03-11 12:04:38 UTC
Hi, I have hit a similar issue on a new box where I'm segregating accounts. I have one unprivileged account ($UNPRIVUSER) with user flatpaks from the flathub repo and one privileged account ($PRIVUSER) to install system flatpaks from the fedora repo. 

With Fedora 39, switching between sessions with ctrl + alt + # throws up the authentication request: "authentication is required to update metadata" when switching from privileged account => unprivileged and again when switching back. I've reproduced it onto a clean install in a VM using one --user flatpak (flatseal) and one system flatpak (epiphany).

When switching to unprivileged user
Operator of unix-session:9 FAILED to authenticate to gain authorization for action org.freedesktop.Flatpak.metadata-update for system-bus-name:: 1.733 [/usr/bin/gnome-software --gapplication-service] (owned by unix-user:$UNPRIVUSER).
Or
Operator of unix-session:1 successfully authenticated as unix-user:$PRIVUSER to gain ONE-SHOT authorization for action org.freedesktop.Flatpak.metadata-update for system-bus-name::1.87 [/usr/bin/gnome-software --gapplication-service] (owned by unix-user:$UNPRIVUSER)

When switching back to privileged user
Operator of unix-session:9 FAILED to authenticate to gain authorization for action org.freedesktop.Flatpak.metadata-update for system-bus-name:: 1.189 [/usr/bin/gnome-software --gapplication-service] (owned by unix-user:$PRIVUSER).
Or 
Operator of unix-session:4 successfully authenticated as unix-user:$PRIVUSER to gain ONE-SHOT authorization for action org.freedesktop.Flatpak.metadata-update for system-bus-name::1.194 [/usr/bin/gnome-software --gapplication-service] (owned by unix-user:$PRIVUSER)

Prompt does not appaer when switching back if I authenticated during the initial privileged => unprivileged switch. It's probably possible to resolve it with polkit rules. It may need to be reported upstream? Unsure of the "problematic" component between polkit, flatpak, gnome-software or something else altogether.

I don't have the time to learn about it so for now I "fixed" it removing gnome-software since I do everything on the command line anyway. I had another issue where all user platpaks refs where temporarily broken and I could not update at all, but I could not reproduce it after a reboot of my main box.

Some posts which are likely related: 
https://discussion.fedoraproject.org/t/authentication-is-required-to-update-metadata/78226
https://discussion.fedoraproject.org/t/authentication-is-required-to-update-metadata/78226

And bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=2055956

Comment 4 Jan Rybar 2024-03-11 15:40:09 UTC
Hello,

here it is in the [report](https://bugzilla.redhat.com/show_bug.cgi?id=2244876#c3) provided by Thomas. Thanks!
I suspected packagekitd, but it's generally gnome-software and the repository backend it uses.  

You know, apps and services define their actions and rulesets to polkit so it can authentize/authorize users (whether automatically or not) to execute those actions accordingly to the rules.  
These kinds of information are defined in files vendored within that app/service itself, because they're the ones to know best what they want (their users) to do.  
It is out of hands of polkit. Polkit just takes the information, interprets it and executes it when needed.  

This issue can be resolved by Flatpak maintainers by extending file /usr/share/polkit-1/rules.d/org.freedesktop.Flatpak.rules with the new action rule (or merge the followin if-block in the existing rules):
```
polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.Flatpak.metadata-update") {
            return polkit.Result.YES;
    }

    return polkit.Result.NOT_HANDLED;
});
```

I don't know the details about Flatpak, but I guess updating metadata should be a safe operation for all users.

Comment 5 Aoife Moloney 2024-05-31 08:47:50 UTC
Fedora Linux 38 entered end-of-life (EOL) status on 2024-05-21.

Fedora Linux 38 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 6 Juan Orti 2024-09-14 08:48:48 UTC
This is still happening in Fedora 40 and is very annoying.

Comment 7 Morgan Timney 2024-10-20 13:25:32 UTC
This was not happening for me on 38, but since I upgraded to 40 it seems to happen often.
Here"s my `journalctl -S -2m -u polkit.service` output:
journalctl -S -2m -u polkit.service
Oct 20 08:13:45 fedora polkitd[1161]: Registered Authentication Agent for unix-session:c3 (system bus name :1.492 [/usr/bin/gnom>
Oct 20 08:13:55 fedora polkitd[1161]: Operator of unix-session:2 successfully authenticated as unix-user:morgan to gain ONE-SHOT>
Oct 20 08:13:57 fedora polkitd[1161]: Operator of unix-session:2 successfully authenticated as unix-user:morgan to gain ONE-SHOT>
Oct 20 08:14:01 fedora polkitd[1161]: Unregistered Authentication Agent for unix-session:c3 (system bus name :1.492, object path>

I see someone saying that it is due to how a flatpack is coded, but that is not terribly helpful to an end user. Is there a way of identifying whick flatpak is the issue?

Comment 8 Aoife Moloney 2025-04-25 10:09:04 UTC
This message is a reminder that Fedora Linux 40 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 40 on 2025-05-13.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '40'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 40 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 9 Aoife Moloney 2025-05-16 07:45:40 UTC
Fedora Linux 40 entered end-of-life (EOL) status on 2025-05-13.

Fedora Linux 40 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.