Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manifest-db: make all UUIDs unique #124

Closed
wants to merge 1 commit into from
Closed

Conversation

mvo5
Copy link
Contributor

@mvo5 mvo5 commented May 2, 2024

We get regular failures in the manifest-db run. With the extra
visibility from #123
it seems the errors we get (sometimes) are related to an xfs mount

mount/- (org.osbuild.xfs): mounting /dev/98302bc3-1aa3-4eab-96e9-9f1c6eb539ce/rootlv -> /var/lib/osbuild/store/tmp/buildroot-tmp-3y2wyhos/mounts/
mount/- (org.osbuild.xfs): already unmounted: /var/lib/osbuild/store/tmp/buildroot-tmp-3y2wyhos/mounts/

which looks similar the UUID clashes we observed in
osbuild/osbuild#1641

Upon inspecting the manifests it seems we have quite a few UUIDs in
our manifests. Those might explain the issues that we sometimes
see because the UUIDs is global to the host so running multiple tests
in parallel can lead to clashes when xfs/btrfs assume that the
mount is already done when in fact it was a different loopdevice
that just happend to clash with the UUID.

This commit creates a new UUID for each file where a duplicated
UUID is found (but keeps that UUID inside the same file stable).

We could make this smaller by limiting this to only xfs/btfs which
(AFAIK) are the only systems affected by UUID clashes but my
script is not smart enough for this.

Fwiw, the script found the following duplicated uuids:

0194fdc2-fa2f-4cc0-81d3-ff12045b73c8
6e4ff95f-f662-45ee-a82a-bdf44a2d0b75
D209C89E-EA5E-4FBD-B161-B461CCE297E0
68B2905B-DF3E-4FB3-80FA-49D1E773AA33
6264D520-3FB9-423F-8AB8-7A0A8E3D3562
FAC7F1FB-3E8D-4137-A512-961DE09A5549
CB07C243-BC44-4717-853E-28852021225B
2fe99653-f7ff-44fd-bea8-fa70107524fb
fb180daf-48a7-4ee0-b10d-394651850fd4
4a3096bf-521c-4921-96ab-b0dd0092d180
308f6813-e223-438d-a043-a32c3a016c05
0bd700f8-090f-4556-b797-b340297ea1bd
a178892e-e285-4ce1-9114-55780875d64e
4f3cefaf-79f9-474f-b12d-bf318d217e4d
4f4f13ec-0417-482b-8a83-6ae8b485fbc1
425fc6b7-c636-4b22-8480-6a96b309a958
f0e6d9c9-dd23-4648-953d-2d7d1c0fa5d4
8ce5fc9e-f74f-4a75-b0f2-033f837f6e86
4584c0d1-532e-42b4-b5f5-e9e306f746a0
fe42c456-dc6e-405a-9188-ccf39cb5d9b1
8bd74b2a-132d-4079-9bb9-60da30456fe2
0d635191-50b7-4ae7-a0ca-a76fbdeda539
4a2a5335-262e-4497-8e00-3eafa934098d
4A2A5335-262E-4497-8E00-3EAFA934098D
e2d3d0d0-de6b-48f9-b44c-e85ff044c6b1
f83b8e88-3bbf-457a-ab99-c5b252c7429c
A178892E-E285-4CE1-9114-55780875D64E
8DFDFF87-C96E-EA48-A3A6-9408F1F6B1EF

[edit: draft because this would also need a regression test to ensure we do not add clashing uuids again]

@mvo5 mvo5 changed the title Uniq UUID manifest-db: make all UUIDs unique May 2, 2024
We get regular failures in the manifest-db run. With the extra
visibility from osbuild#123
it seems the errors we get (sometimes) are related to an xfs mount
```
mount/- (org.osbuild.xfs): mounting /dev/98302bc3-1aa3-4eab-96e9-9f1c6eb539ce/rootlv -> /var/lib/osbuild/store/tmp/buildroot-tmp-3y2wyhos/mounts/
mount/- (org.osbuild.xfs): already unmounted: /var/lib/osbuild/store/tmp/buildroot-tmp-3y2wyhos/mounts/
```
which looks similar the UUID clashes we observed in
osbuild/osbuild#1641

Upon inspecting the manifests it seems we have quite a few UUIDs in
our manifests. Those *might* explain the issues that we sometimes
see because the UUIDs is global to the host so running multiple tests
in parallel can lead to clashes when xfs/btrfs assume that the
mount is already done when in fact it was a different loopdevice
that just happend to clash with the UUID.

This commit creates a new UUID for each file where a duplicated
UUID is found (but keeps that UUID inside the same file stable).

We could make this smaller by limiting this to only xfs/btfs which
(AFAIK) are the only systems affected by UUID clashes but my
script is not smart enough for this.
mvo5 added a commit to mvo5/osbuild-composer that referenced this pull request May 2, 2024
To ensure that manifests get random(ish) and stable UUIDs we set
the seed arg based on the filename and the environment
(`OSBUILD_GEN_MANIFEST_RNG_SEED`).

This should fix the issue discovered in
osbuild/manifest-db#124

that duplicated UUIDs for xfs/btrfs can trigger random(ish) and
hard to diagnose errors.
mvo5 added a commit to mvo5/images that referenced this pull request May 6, 2024
To ensure that manifests get random(ish) and stable UUIDs we set
the rng seed arg based on the filename.

This should fix the issue discovered in
osbuild/manifest-db#124

that duplicated UUIDs for xfs/btrfs can trigger random(ish) and
hard to diagnose errors.

This is the same as
osbuild/osbuild-composer#4124
hopefully for the right place this time.
mvo5 added a commit to mvo5/images that referenced this pull request May 6, 2024
To ensure that manifests get random(ish) and stable UUIDs we set
the rng seed arg based on the filename.

This should fix the issue discovered in
osbuild/manifest-db#124

that duplicated UUIDs for xfs/btrfs can trigger random(ish) and
hard to diagnose errors.

This is the same as
osbuild/osbuild-composer#4124
hopefully for the right place this time.
mvo5 added a commit to mvo5/images that referenced this pull request May 8, 2024
To ensure that manifests get random(ish) and stable UUIDs we set the rng seed arg based on the filename.

This should fix the issue discovered in
osbuild/manifest-db#124

that duplicated UUIDs for xfs/btrfs can trigger random(ish) and hard to diagnose errors.

This is the same as
osbuild/osbuild-composer#4124 hopefully for the right place this time.
mvo5 added a commit to mvo5/images that referenced this pull request May 14, 2024
To ensure that manifests get random(ish) and stable UUIDs we set
the rng seed arg based on the filename.

This should fix the issue discovered in
osbuild/manifest-db#124

that duplicated UUIDs for xfs/btrfs can trigger random(ish) and
hard to diagnose errors.

This is the same as
osbuild/osbuild-composer#4124
hopefully for the right place this time.
mvo5 added a commit to mvo5/images that referenced this pull request May 14, 2024
To ensure that manifests get random(ish) and stable UUIDs we set the rng seed arg based on the filename.

This should fix the issue discovered in
osbuild/manifest-db#124

that duplicated UUIDs for xfs/btrfs can trigger random(ish) and hard to diagnose errors.

This is the same as
osbuild/osbuild-composer#4124 hopefully for the right place this time.
github-merge-queue bot pushed a commit to osbuild/images that referenced this pull request May 14, 2024
To ensure that manifests get random(ish) and stable UUIDs we set the rng seed arg based on the filename.

This should fix the issue discovered in
osbuild/manifest-db#124

that duplicated UUIDs for xfs/btrfs can trigger random(ish) and hard to diagnose errors.

This is the same as
osbuild/osbuild-composer#4124 hopefully for the right place this time.
@mvo5
Copy link
Contributor Author

mvo5 commented May 29, 2024

Closing for now as I'm not sure if the next manifest-db generation wouldn't just override it again and also it seems the producer side of this should get fixed (i.e. images and osbuild-composer(?))

@mvo5 mvo5 closed this May 29, 2024
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.

None yet

1 participant