Repository navigation
dir: Try to delete the remote if we failed to add it entirely - #6547
Conversation
f8ffe74 to
1cebf01
Compare
|
There is an awkward thing remaining: if the gpg "key" has size of 0 (e.g. an empty file) then the system helper sees this as "no key was requested". I'll file that under future improvement because that has already been the case and doesn't impact the problem we want to solve here which is mainly failure to import a GPG key because of the time of the system being wrong. |
|
/cc @AdrianVovk. Don't know who else to ping. |
|
Unfortunately this doesn't seem to solve it for me: It seems like this patch doesn't fix the apply_new_flatpakrepo path, which is taken when the system helper auto-applies preconfigured remotes in /usr/share/flatpak/remotes.d/ (IIUC) I managed to come up with a patch that fixes this for me: When import fails, no repo config is added: idk if there's some helper function this patch could use to avoid doing some of the manual cleanup there... |
1cebf01 to
8020b81
Compare
|
Managed to add a test for that scenario as well, and fixed it with a slightly different approach. |
|
Oh yeah this is MUCH nicer, I'm clearly not familiar with libostree 😅 Thanks a lot for working on this, I'll test out this patch! |
|
@swick works great now! When the system date is wrong (e.g. first boot, RTC not correct, no inet), remotes in /usr/share/flatpak/remotes.d are not added at all by the helper. Once the system is online and date is ntp synced, helper adds remotes and everything works fine. No half-added broken remote config :) |
Ideally, we would be able to atomically add and remove remotes, but we're very far from that ideal state. The current behavior is really suboptimal and leaves the remotes in a inconsistent state if initialization failed. We can at least make it better by trying to clean up the half-initialized mess we're currently in. It does however not protect against SIGKILL-like aborts, as that would require it to be atomic. Closes: flatpak#6449 Co-authored-by: craftyguy "Clayton Craft" <[email protected]>
8020b81 to
84c7fe7
Compare
Ideally, we would be able to atomically add and remove remotes, but we're very far from that ideal state. The current behavior is really suboptimal and leaves the remotes in a inconsistent state if initialization failed. We can at least make it better by trying to clean up the half-initialized mess we're currently in. It does however not protect against SIGKILL-like aborts, as that would require it to be atomic.
Closes: #6449