Abort update if artifact name is missing

Description

If `/etc/mender/artifact_info` is missing, the client continues the update process but the server API requires the artifact name (which is in this file), so it will give an error response.

Basically this is what happens:
1) artifact_info is missing
2) client proceeds as it says knowing current artifact is not needed
3) update fails because server says it needs to know current artifact

Acceptance criteria

  • Client aborts update if it does not have the artifact name before it checks for update

  • Appropriate client log messages on how to resolve the issue

Relevant log messages seen today:

Mar 03 19:31:37 artik mender[8811]: level=error msg="Cannot determine current artifact. Update will continue anyways: /var/lib/mender/device_type : open /etc/mender/artifact_info: no such file or directory" module=mender Mar 03 19:31:37 artik mender[8811]: time="2018-03-03T19:31:37Z" level=error msg="Cannot determine current artifact. Update will continue anyways: /var/lib/mender/device_type : open /etc/mender/artifact_info: no such file or directory" module=mender Mar 03 19:31:37 artik mender[8811]: level=info msg="State transition: inventory-update [Sync] -> check-wait [Idle]" module=mender Mar 03 19:31:37 artik mender[8811]: time="2018-03-03T19:31:37Z" level=info msg="State transition: inventory-update [Sync] -> check-wait [Idle]" module=mender Mar 03 19:31:37 artik mender[8811]: level=info msg="State transition: check-wait [Idle] -> update-check [Sync]" module=mender Mar 03 19:31:37 artik mender[8811]: level=error msg="could not get the current artifact name" module=mender Mar 03 19:31:37 artik mender[8811]: time="2018-03-03T19:31:37Z" level=info msg="State transition: check-wait [Idle] -> update-check [Sync]" module=mender Mar 03 19:31:37 artik mender[8811]: time="2018-03-03T19:31:37Z" level=error msg="could not get the current artifact name" module=mender Mar 03 19:31:37 artik mender[8811]: level=warning msg="Client recieved invalid response status code: 400" module="client_update" Mar 03 19:31:37 artik mender[8811]: level=error msg="Error receiving scheduled update data: Invalid response received from server" module=mender Mar 03 19:31:37 artik mender[8811]: time="2018-03-03T19:31:37Z" level=warning msg="Client recieved invalid response status code: 400" module="client_update"

Affects versions

None

Environment

None

Checklist

Activity

Show:

Ole Petter Orhagen March 27, 2018 at 6:53 AM

Marcin Pasinski March 21, 2018 at 8:31 AM

done. This should be an easy one.

eystein.maloy.stenberg March 20, 2018 at 6:01 PM

Related to this is if artifact_name is missing from a new Artirfact. The client should roll back the new Artifact if this is missing because then we cannot deploy another update.

can you check the state of this and review & estimate this task pls?

Fixed

Details

Assignee

Reporter

Labels

Story Points

Priority

Sprint

Backlog

yes

Zendesk Support

Checklist

Created March 20, 2018 at 5:48 PM
Updated April 17, 2018 at 8:36 AM
Resolved April 17, 2018 at 8:36 AM