Error when convert container image

Hi, Mender team

I’m currently have a Mini PC at home, and I want to deploy use Mender to deploy some service (such as web server) on it, but I have some difficulties on converting Debian container image.

It would be great if I can have your’s support.

1. Mini PC
I have a fresh Centos 7 netinstall with docker installed, I have connected this OS with my mender account.

2. Virtualbox
I am using Virtualbox to install a Debian 9 with nginx for testing web service.
This OS contain 2 disk:

  • 1 for OS
  • 1 for create file.img and converting

I have create a golden image with this command
$ dd if=/dev/sda of=/home/tel4vn/golden-image-1.img bs=1M conv=fdatasync

But when I run command to convert image there is some error and it stop converting

When I install mender-convert I’m using branch 2.2.x because there is no branch 2.2.0 arcording to this document.

Please help me with this, I’ll be much appreciated.

@M.Tuan welcome to the mender hub. How was original image generated? What os type do you use for rootfs. Currently olyn btrfs + ext4 are supported (AFAIK Centos by default use lvm). Thanks.

I build a Debian 9 netinstall on Virtualbox and then create a golden image from there, with this command
$ dd if=/dev/sda of=/home/tel4vn/golden-image-1.img bs=1M conv=fdatasync
Does it answer your question?

About the CentOS on Mini PC problem, I’ll reinstall it into Debian 9, and use it to connect to Mender3, is it right?

I seem to recall having to explicitly disable the swap partition when I was working with CentOS earlier. You may want to give that a try and ensure there is just the one partition on the disk.

Drew

But I’m converting image on Debian 9 on Virtualbox on my laptop. On my Mini PC I’m just installing docker on it, and connect it to Mender

I also try to disable swap space on Debian 9

But then this error appear when converting

And this is error when converting with a new Debian 9 but without creating swap space

Please tell me what I’ve done wrong

Seems you cannot fetch package from internet. Does host machine have internet connection? Seems wget failed.

Thanks, I have pass that step, but now there is a different problem. I can’t install mender-client.

Installing from deb package or in mender convert? Did you use correct password?

I installing it from deb package. I did use the right password, if not it will said that there is no account.
image

It says such account doesn’t exists. Do you register on hosted mender ? Thanks.

Earlier, when I put in the right Hosted Mender account, there is an error

I’m sure I put in the right account because if I’m put in the wrong password, it would have said “We couldn’t find …”

@lluiscampos any idea what can be wrong here? Thanks.

Hi @MarekBelisko, I have work around this step and I have connected my Mini PC running Debian 9 to Hosted Mender by installing by this step.

And I have checked on hosted.mender.io


But my deployment have failed, this is the log, can you help me with this.
2020-10-08 07:15:19 +0000 UTC info: Running Mender client version: 2.4.0
2020-10-08 07:15:21 +0000 UTC info: State transition: update-fetch [Download_Enter] -> update-store [Download_Enter]
2020-10-08 07:15:21 +0000 UTC info: No public key was provided for authenticating the artifact
2020-10-08 07:15:21 +0000 UTC error: Fetching Artifact headers failed: installer: failed to read Artifact: readHeaderV3: handleHeaderReads: Artifact Payload type ‘rootfs-image’ is not supported by this Mender Client. Ensure that the Mender Client is fully integrated and that the RootfsPartA/B configuration variables are set correctly in ‘mender.conf’
2020-10-08 07:15:21 +0000 UTC info: State transition: update-store [Download_Enter] -> fetch-install-retry-wait [Download_Enter]
2020-10-08 07:15:21 +0000 UTC info: State transition: fetch-install-retry-wait [Download_Enter] -> update-error [ArtifactFailure]
2020-10-08 07:15:21 +0000 UTC info: State transition: update-error [ArtifactFailure] -> cleanup [Error]
2020-10-08 07:15:21 +0000 UTC info: State transition: cleanup [Error] -> update-status-report [none]

This is when I read the .mender file
$ mender-artifact read debian9-nginx-x86_64-mender.mender

I have noted all my installing, converting step, can you take a look at it for me? If possible, I’ll send this guideline to your email, is it okay?

Do you have create mender image (with dual rootfs) and data partition?

2020-10-08 07:15:21 +0000 UTC error: Fetching Artifact headers failed: installer: failed to read Artifact: readHeaderV3: handleHeaderReads: Artifact Payload type ‘rootfs-image’ is not supported by this Mender Client. Ensure that the Mender Client is fully integrated and that the RootfsPartA/B configuration variables are set correctly in ‘mender.conf’

I created mender image by running this command
$ dd if=/dev/sda of=/home/tuan/debian9-nginx-0.1.img bs=1M conv=fdatasync

This is my /dev/sda
image

And I use this image to create artifact with mender-convert
$ MENDER_ARTIFACT_NAME=debian9-nginx-release-0.1 ./docker-mender-convert --disk-image input/debian9-nginx-0.1.img --config configs/generic_x86-64_hdd_config --overlay rootfs_overlay_demo/
image

Is it the correct way?

Right mender convert output was flashed to device and you try to perform update and it’s not working right? How do you create artifact?

I try 2 ways:
1 is use the image in the deploy directory
2 is use this command to convert .ext4 in deploy directory
$ mender-artifact write rootfs-image
-t x86_64
-n debian9-nginx-0.1
-f /home/tuan/mender-convert/deploy/debian9-nginx-0.1-x86_64-mender.ext4
-o debian9-nginx-0.1.mender

And upload these 2 .mender file to Hosted Mender, and deploy it, both failed

If you try to use same artifact it won’t work because version will be same so you need to build other artifact with other release number and then try again.

The first one is debian9-nginx-0.1.mender created by command

$ mender-artifact write rootfs-image
-t x86_64
-n debian9-nginx-0.1
-f mender-convert/deploy/debian9-nginx-0.1-x86_64-mender.ext4
-o debian9-nginx-0.1.mender

The second one is debian9-nginx-0.1-x86_64-mender.mender created by command

$ MENDER_ARTIFACT_NAME=debian9-nginx-release-0.1 ./docker-mender-convert
–disk-image input/debian9-nginx-0.1.img
–config configs/generic_x86-64_hdd_config
–overlay rootfs_overlay_demo/

I’ve uploaded these 2 images to hosted.mender.io, but when I deployed it, both failed with the same error

2020-10-08 07:15:21 +0000 UTC error: Fetching Artifact headers failed: installer: failed to read Artifact: readHeaderV3: handleHeaderReads: Artifact Payload type ‘rootfs-image’ is not supported by this Mender Client. Ensure that the Mender Client is fully integrated and that the RootfsPartA/B configuration variables are set correctly in ‘mender.conf’

Can you explained what is the same artifact means? I haven’t get any artifact to deploy successfully, I just connected my mini pc to hosted.mender.io with this command