You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
With multiple remotes having the same collection ID, flatpak can fail to pull ostree-metadata #1832
In Endless, the default /ostree/repo/config, which is shared by flatpak and ostree, has two remotes configured that point to the same repository, eos and eos-runtimes. The former is used for OS updates and has xa.disable=true so flatpak is supposed to ignore it, and the latter is used by flatpak for legacy runtimes. When collection IDs are enabled, both have the same one, com.endlessm.Os. This leads to a problem when flatpak tries to pull the ostree-metadata ref for eos-runtimes.
Specifically _flatpak_dir_fetch_remote_state_metadata_branch tries to fetch eos-runtimes:ostree-metadata and it's successful but the pull code actually fetches it from the eos remote. The libostree API used by flatpak, ostree_repo_find_remotes_async/ostree_repo_pull_from_remotes_async ignores xa.disable=true (as it should, otherwise OS updates would be disabled). So in _flatpak_dir_get_remote_state after the successful pull into refs/remotes/eos/ostree-metadata, flatpak_dir_read_latest is called which looks in refs/remotes/eos-runtimes and fails to find the ostree-metadata, which eventually leads to eos-updater failing with the message Fetch: failed to pull necessary new flatpaks for update: Refspec 'eos-runtimes:ostree-metadata' not found. (because eos-updater uses libflatpak to autoinstall flatpaks).
One solution to this would be to communicate to libostree which remotes are disabled, but per #1447 (comment) having multiple remotes with the same collection ID is a valid configuration, and then the issue would remain.
A better solution would be for flatpak to use refs/mirrors instead of refs/remotes for ostree-metadata, appstream refs, and perhaps everything coming from a remote with a collection ID. This way you have to worry less about constantly translating between collection IDs and remote names, and you're able to disambiguate staging and prod refs from the same remote, e.g. (com.endlessm.Os, ostree-metadata) vs (com.endlessm.Dev.Os, ostree-metadata), which would also fix #1477. However this requires invasive changes to flatpak (basically, making more liberal use of ostree_repo_resolve_collection_ref and OSTREE_REPO_PULL_FLAGS_MIRROR), and this might change the behavior with respect to, for example, updating apps from prod to dev.
Replace ostree_repo_list_refs() with ostree_repo_list_collection_refs() or a wrapper around the two across the codebase, similar to the use of flatpak_repo_resolve_rev() in Use the correct keyring to verify P2P pulls #2705
This is still a limitation of the libostree API (ostree_repo_find_remotes_async/ostree_repo_pull_from_remotes_async) but flatpak no longer uses that after #3476
Activity
dir: Fix an edge case of resolving collection-refs
dir: Fix an edge case of resolving collection-refs
dir: Fix an edge case of resolving collection-refs
dir: Fix an edge case of resolving collection-refs
dir: Fix an edge case of resolving collection-refs
Made wider use of flatpak_repo_resolve_rev()
dir: Fix an edge case of resolving collection-refs
Made wider use of flatpak_repo_resolve_rev()
mwleeds commentedon Feb 25, 2019
I think what's left to do here which would fix this and #1477 is:
ostree_repo_list_refs()withostree_repo_list_collection_refs()or a wrapper around the two across the codebase, similar to the use offlatpak_repo_resolve_rev()in Use the correct keyring to verify P2P pulls #2705dir: Fix an edge case of resolving collection-refs
Made wider use of flatpak_repo_resolve_rev()
dir: Fix an edge case of resolving collection-refs
Made wider use of flatpak_repo_resolve_rev()
dir: Fix an edge case of resolving collection-refs
Made wider use of flatpak_repo_resolve_rev()
dir: Fix an edge case of resolving collection-refs
Made wider use of flatpak_repo_resolve_rev()
dir: Fix an edge case of resolving collection-refs
Made wider use of flatpak_repo_resolve_rev()
dir: Fix an edge case of resolving collection-refs
Made wider use of flatpak_repo_resolve_rev()
dir: Fix an edge case of resolving collection-refs
Made wider use of flatpak_repo_resolve_rev()
Made wider use of flatpak_repo_resolve_rev()
mwleeds commentedon Mar 26, 2020
This is still a limitation of the libostree API (
ostree_repo_find_remotes_async/ostree_repo_pull_from_remotes_async) but flatpak no longer uses that after #3476FlatpakRemote: Disable P2P distribution for eos-runtimes
FlatpakRemote: Disable P2P distribution for eos-runtimes