Issues with Docker Update Module

Mender Management server for production throwing following error, When i was trying to upload the Artifact…
Seems to be My mender server not supporting version 3…

Artifact couldn’t be uploaded. unsupported version: 3; supported versions are: 1, 2 [Request ID: 3f00876f]

Looks like you are not running 2.0.0 version of the server.

My Mender Server version : 2.0
Mender-artifact tool version : 3.0
I created the mender artifact for Hello-world docker image with Mender-artifact 3.0 tool. But when I want to deploy above docker image to device, mender client on the device throwing below error. I think there is version mismatch …
My meta-mender version is thud-v2019.02-4-gdb6b761

May 23 12:54:37 imx6 mender[743]: level=error msg=“update install failed: installer: failed to read and install update: reader: unsupported version: 3” module=state
May 23 12:54:37 imx6 mender[743]: level=info msg=“State transition: update-store [Download] -> fetch-install-retry-wait [Download]” module=mender

It seems that you are not running Mender client 2.0.0,

It is not the default and you have to actively enable that version, take a look here

https://hub.mender.io/t/mender-2-0-released-extending-update-capability/536/15

for more information

I updated thud branch and now the version is thud-v2019.05-2-gae00ee7 and added below stuff in local.conf and i see mender_client 2.0.0 in logs from my device…

PREFERRED_VERSION_pn-mender = "2.%"
PREFERRED_VERSION_pn-mender-artifact = "3.%"
PREFERRED_VERSION_pn-mender-artifact-native = "3.%"
  1. Now I created mender artifact for hello-world docker and uploaded this artifact i.e my-container-update-1.0 into server.This artifact size is 6kb and showing its type as rootfs-image in the server.
  2. Downloaded the docker updated module in device @ /usr/share/mender/modules/v3.
  3. After downloading this artifact into device, the device is getting rebooted and inventory shows current software as my-container-update-1.0.

Why the board is rebooting when we download the application software image on to device?

Why the board is rebooting when we download the application software image on to device?

Unclear, the Docker update module does not do a reboot, is it possible that it is triggered by something else?

Hope below steps i followed are correct… Initially my docker is not running on the board and board have a /usr/share/module/v3/docker script…

  • I have created mender artifact for hello-world docker and uploaded this artifact i.e my-container-update-1.0 into server.This artifact size is 6kb and showing its type as rootfs-image in the server.
  • Downloaded the docker updated module in device @ /usr/share/mender/modules/v3.
  • After downloading this artifact into device, the device is getting rebooted and inventory data on the server shows current software as my-container-update-1.0

Hi @ramu,

How are you creating the Artifact? Using the docker-artifact-get script the resulting Artifact must be module-image, not rootfs-image. Can you copy here the commands you are using to create the Artifact?

I think that somehow you are creating a rootfs-image Artifact probably containing only the Docker metadata (6kb?), but then the device will try to install it as if it was an actual full image update.

Exported below stuff…
ARTIFACT_NAME=“my-container-update-1.0”
DEVICE_TYPE=“imx6”
OUTPUT_PATH=my-container-update-1.0.mender
DOCKER_IMAGES=“hello-world”

./docker-artifact-gen -n {ARTIFACT_NAME} -t {DEVICE_TYPE} -o {OUTPUT_PATH} {DOCKER_IMAGES}
Using default tag: latest
latest: Pulling from library/hello-world
Digest: sha256:6f744a2005b12a704d2608d8070a494ad1145636eeb74a570c56b94d94ccdbfc
Status: Image is up to date for hello-world:latest

Thanks. Okey, so what is the output of: mender-artifact read my-container-update-1.0.mender ? It cannot be rootfs-image.

Iam seeing type as “rootfs-image” under “Releases” link on the mender server page running on my laptop…

Here is the o/p of "mender-artifact read " …

~/workspace/mender/mender-artifact read my-container-update-1.0.mender
Mender artifact:
  Name: my-container-update-1.0
  Format: mender
  Version: 3
  Signature: no signature
  Compatible devices: '[tcs-imx6]'
  Provides group: 
  Depends on one of artifact(s): []
  Depends on one of group(s): []
  State scripts:

Updates:
    0:
    Type:   docker
    Provides: Nothing
    Depends: Nothing
    Metadata:
	{
	  "containers": [
	    "hello-world@sha256:6f744a2005b12a704d2608d8070a494ad1145636eeb74a570c56b94d94ccdbfc"
	  ]
	}

But signed mender artifact giving following o/p …

~/workspace/mender/mender-artifact read my-container-update-1.0-sign.mender 
Mender artifact:
  Name: my-container-update-1.0
  Format: mender
  Version: 3
  Signature: signed; verification using provided key failed
  Compatible devices: '[tcs-imx6]'
  Provides group: 
  Depends on one of artifact(s): []
  Depends on one of group(s): []
  State scripts:

Updates:
    0:
    **Type:   rootfs-image**
    Provides: Nothing
    Depends: Nothing
    Metadata: Nothing
    Files:
      name:     mender-repack287398683
      size:     0
      modified: 2019-05-22 15:31:52 +0530 IST
      checksum: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

Edit: @mirzak: prettify output

Okey! Now I understand it.

We have a bug that does not allow signing module-image artifacts, see MEN-2573. Try this workaround suggested by @kacf .

Thank you…
I have tried with out signing the mender articraft for hello-world docker… Now Docker Update module
able to download and start the docker. But mender server showing the current software for device as
my-container-update-1.0 (This is docker release) …

I will try with signed one now…

That is expected. The “current software” reports the last Artifact installed in the device.

But it suppose to show the rootfs-image version right??

No, it will show the last update on your device regardless of the type (rootfs-image or module-image).

Thank you… I am able to upload the signed docker with docker-artifact-gen from 2.0.x

You are welcomed :+1:

Thanks for reporting back.

A post was merged into an existing topic: Docker