Mender 2.2 ArtifactFailure State Script Documentation Unclear

Hi there,

I’m looking into handling errors better during an over the air update using Mender 2.2, and I have a question about something that’s vague on the documentation.

The documentation contradicts itself about where exactly in the process this state occurs. Towards the top, it says this, which is consistent with the diagrams on the page:

ArtifactFailure : if any of the “Artifact” states are failing, the device enters and executes this state. This state always runs after the ArtifactRollback and ArtifactRollbackReboot states.

However, at the end of the page it shows an example of the state transitions for if an error occurred during the ArtifactCommit state. This example seems to contradict the above quote since the ArtifactFailure state happens before the ArtifactRollback and ArtifactRollbackReboot states. It shows the following order:

  • [ArtifactCommit_Enter] ArtifactCommit
  • (error while committing)
  • [ArtifactCommit_Error]
  • [ArtifactFailure_Enter] ArtifactFailure [ArtifactFailure_Leave]
  • [ArtifactRollback_Enter] ArtifactRollback [ArtifactRollback_Leave]
  • [ArtifactRollbackReboot_Enter] ArtifactRollbackReboot
  • (device reboot)
  • [ArtifactRollbackReboot_Leave]

So is the top quote correct and the ArtifactFailure state scripts would run after the rollback reboot in the example, or is the example correct?

Hi @amorgan, welcome to Mender Hub.

I think you are referring to the sequencing specifically in right?

@kacf can you comment? This link does seem to show that ArtifactFailure happens before Rollback in this case.


Hi @drewmoseley,

Yes that is what I’m referring to, which is also present on the corresponding page for version 2.2.

You are correct, this is a mistake in the documentation. The actual behavior is “documented” in our tests. There are in fact several mistakes in the state script order on that page; here is a pull request to fix them.

1 Like

Great, thanks for the quick reply and fix!