Skip to content

dir: Succeed ensure_repo with allow_empty when system helper fails - #6621

Merged
swick merged 1 commit into
flatpak:mainfrom
swick:wip/non-existant-system-install
Apr 16, 2026
Merged

swick merged 1 commit into
flatpak:mainfrom
swick:wip/non-existant-system-install

Conversation

@swick

@swick swick commented Apr 13, 2026

Copy link
Copy Markdown
Collaborator

If _flatpak_dir_ensure_repo is called with allow_empty=true, it is allowed to fail to create the repo, and is supposed to return success in that case.

The system helper handles this correctly, but we then call to ensure_repo_opened no matter if the repo actuall exists and return an error when it does not, no matter if allow_empty is set or not.

Closes: #6618

If _flatpak_dir_ensure_repo is called with allow_empty=true, it is
allowed to fail to create the repo, and is supposed to return success in
that case.

The system helper handles this correctly, but we then call to
ensure_repo_opened no matter if the repo actuall exists and return an
error when it does not, no matter if allow_empty is set or not.

Closes: flatpak#6618

@smcv smcv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is right. I was a bit worried that returning from this function with repo not opened would break callers' assumptions, but the behaviour after this change is to return with self->repo still null, and we were already doing that in the allow_empty && !flatpak_dir_use_system_helper code path if ostree_repo_create() failed, so presumably it must be OK.

@swick
swick added this pull request to the merge queue Apr 16, 2026
Merged via the queue into flatpak:main with commit 5314d8c Apr 16, 2026
11 checks passed
@swick
swick deleted the wip/non-existant-system-install branch April 16, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: flatpak commands fail with "opening repo: openat(config): No such file or directory"

2 participants