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

Fix writing of corrupt Artifact: type-info is missing type for rootfs… #330

Closed
wants to merge 1 commit into from

Conversation

kacf
Copy link
Member

@kacf kacf commented Feb 23, 2021

…-image.

Changelog: Fix regression which caused the "write rootfs-image"
command to produce a corrupt Artifact. The same versions that write
such an Artifact will also accept it, but both issues have been fixed:
A corrupt Artifact is not written anymore, nor will corrupt Artifacts
be accepted. If you have produced an Artifact using a version of
mender-artifact prior to 3.5.1, you may have to recreate it.

Signed-off-by: Kristian Amlie kristian.amlie@northern.tech

@kacf kacf requested a review from oleorhagen February 23, 2021 08:32
@mender-test-bot
Copy link

Hello 😸 I created a pipeline for you here: Pipeline-260289028

Build Configuration Matrix

Key Value
AUDITLOGS_REV origin/master
BUILD_BEAGLEBONEBLACK true
BUILD_CLIENT true
BUILD_QEMUX86_64_BIOS_GRUB true
BUILD_QEMUX86_64_BIOS_GRUB_GPT true
BUILD_QEMUX86_64_UEFI_GRUB true
BUILD_VEXPRESS_QEMU true
BUILD_VEXPRESS_QEMU_FLASH true
BUILD_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
CREATE_ARTIFACT_WORKER_REV origin/master
DEPLOYMENTS_ENTERPRISE_REV origin/master
DEPLOYMENTS_REV origin/master
DEVICEAUTH_REV origin/master
DEVICECONFIG_REV origin/master
DEVICECONNECT_REV origin/master
GUI_REV origin/master
INTEGRATION_REV master
INVENTORY_ENTERPRISE_REV origin/master
INVENTORY_REV origin/master
MENDER_ARTIFACT_REV pull/330/head
MENDER_CLI_REV origin/master
MENDER_CONNECT_REV origin/master
MENDER_REV origin/master
MTLS_AMBASSADOR_REV origin/master
RUN_INTEGRATION_TESTS true
TENANTADM_REV origin/master
TEST_QEMUX86_64_BIOS_GRUB true
TEST_QEMUX86_64_BIOS_GRUB_GPT true
TEST_QEMUX86_64_UEFI_GRUB true
TEST_VEXPRESS_QEMU true
TEST_VEXPRESS_QEMU_FLASH true
TEST_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
USERADM_ENTERPRISE_REV origin/master
USERADM_REV origin/master
WORKFLOWS_ENTERPRISE_REV origin/master
WORKFLOWS_REV origin/master

…-image.

Changelog: Fix regression which caused the "write rootfs-image"
command to produce a corrupt Artifact. The same versions that write
such an Artifact will also accept it, but both issues have been fixed:
A corrupt Artifact is not written anymore, nor will corrupt Artifacts
be accepted. If you have produced an Artifact using a version of
mender-artifact prior to 3.5.1, you may have to recreate it.

Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
@mender-test-bot
Copy link

Hello 😸 I created a pipeline for you here: Pipeline-260294102

Build Configuration Matrix

Key Value
AUDITLOGS_REV origin/master
BUILD_BEAGLEBONEBLACK true
BUILD_CLIENT true
BUILD_QEMUX86_64_BIOS_GRUB true
BUILD_QEMUX86_64_BIOS_GRUB_GPT true
BUILD_QEMUX86_64_UEFI_GRUB true
BUILD_VEXPRESS_QEMU true
BUILD_VEXPRESS_QEMU_FLASH true
BUILD_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
CREATE_ARTIFACT_WORKER_REV origin/master
DEPLOYMENTS_ENTERPRISE_REV origin/master
DEPLOYMENTS_REV origin/master
DEVICEAUTH_REV origin/master
DEVICECONFIG_REV origin/master
DEVICECONNECT_REV origin/master
GUI_REV origin/master
INTEGRATION_REV master
INVENTORY_ENTERPRISE_REV origin/master
INVENTORY_REV origin/master
MENDER_ARTIFACT_REV pull/330/head
MENDER_CLI_REV origin/master
MENDER_CONNECT_REV origin/master
MENDER_REV origin/master
MTLS_AMBASSADOR_REV origin/master
RUN_INTEGRATION_TESTS true
TENANTADM_REV origin/master
TEST_QEMUX86_64_BIOS_GRUB true
TEST_QEMUX86_64_BIOS_GRUB_GPT true
TEST_QEMUX86_64_UEFI_GRUB true
TEST_VEXPRESS_QEMU true
TEST_VEXPRESS_QEMU_FLASH true
TEST_VEXPRESS_QEMU_UBOOT_UEFI_GRUB true
USERADM_ENTERPRISE_REV origin/master
USERADM_REV origin/master
WORKFLOWS_ENTERPRISE_REV origin/master
WORKFLOWS_REV origin/master

Copy link
Contributor

@lluiscampos lluiscampos left a comment

Choose a reason for hiding this comment

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

Sneaky bug. The fix looks good to me, but last word is on @oleorhagen

@lluiscampos
Copy link
Contributor

And very good Changelog tag also 👍

Copy link
Contributor

@oleorhagen oleorhagen left a comment

Choose a reason for hiding this comment

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

This was worrying! Nice find though

cli/mender-artifact/write.go Show resolved Hide resolved
if img.typeInfoV3 == nil || img.typeInfoV3.Type != img.updateType {
return errors.New("Type in type-info header does not match header-info: " +
"Corrupt Artifact. " +
"This was a known bug in some versions of mender-artifact prior to 3.5.1. " +
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: How about: is a known bug?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, I will change that.

@@ -184,6 +191,10 @@ func MakeAnyImageArtifact(version int, signed bool,
ArtifactName: []string{"mender-1.0"},
CompatibleDevices: []string{"vexpress"},
},
TypeInfoV3: &artifact.TypeInfoV3{
Copy link
Contributor

Choose a reason for hiding this comment

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

Ouch

@oleorhagen
Copy link
Contributor

@kacf did you forget about this one? 😸

@kacf
Copy link
Member Author

kacf commented Mar 4, 2021

No, but I want to take a bit more time to think about this. As we discussed, maybe it's better to remove the field altogether. I'll return to it once I have fewer things on my plate! :-)

@stale
Copy link

stale bot commented May 3, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label May 3, 2021
@stale stale bot closed this May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants