# Unable to convert images using mender convert

**URL:** <https://hub.mender.io/t/unable-to-convert-images-using-mender-convert/6826>\
**Category:** General Discussions\
**Created:** [May 17, 2024, 8:55am UTC](https://hub.mender.io/t/unable-to-convert-images-using-mender-convert/6826 "2024-05-17T08:55:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Athvaith2828](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/athvaith2828/32/2206_2.png) [@Athvaith2828](https://hub.mender.io/u/Athvaith2828)\
**Post date:** [May 17, 2024, 8:55am UTC](https://hub.mender.io/t/unable-to-convert-images-using-mender-convert/6826/1 "2024-05-17T08:55:14Z")

</div>

Hi All, I am new to mender and I am trying out mender convert docker image **mendersoftware/mender-convert:maste** for converting the image **agl-demo-platform-crosssdk-raspberrypi4-64.img**

I am running the command:  
**MENDER\_GRUB\_KERNEL\_IMAGETYPE=“vmlinuz” MENDER\_ARTIFACT\_NAME=“release-1” ./docker-mender-convert --disk-image input/agl-raspberry.img --config configs/raspberrypi4\_config**

and got the error dpkg failed with error code 127  
and stopped execution after  
sudo cp work/boot/kernel7l.img work/rootfs/boot/zImage  
cp: cannot stat ‘work/boot/kernel7l.img’: No such file or directory

when I checked log file , I found  
sudo chroot /mender-convert/work/rootfs/ /tmp/qemu-aarch64-static /usr/bin/env env DEBIAN\_FRONTEND=noninteractive DEVICE\_TYPE=raspberrypi4 dpkg --install /tmp/mender-snapshot\_1.0.0-1+debian+buster\_arm64.deb  
/usr/bin/env: ‘dpkg’: No such file or directory

It also throws an error VERSION\_CODENAME : unbound variable

But when I exec inside the container , i can see it has dpkg installed  
How to resolve this issue ?

---

<div class="post-metadata">

**Author:** ![Athvaith2828](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/athvaith2828/32/2206_2.png) [@Athvaith2828](https://hub.mender.io/u/Athvaith2828)\
**Post date:** [May 17, 2024, 9:06am UTC](https://hub.mender.io/t/unable-to-convert-images-using-mender-convert/6826/2 "2024-05-17T09:06:26Z")

</div>

Logs:  
using log file at: /home/athvaith/mender-convert/logs/convert.log.1715936181-10782  
Running mender-convert --disk-image input/agl-raspberry.img --config configs/raspberrypi4\_ubuntu\_ubuntu\_config  
Running mender-convert-extract: --config ./work/override\_compression\_config --disk-image input/agl-raspberry.img --config configs/raspberrypi4\_ubuntu\_ubuntu\_config  
2024-05-17 08:56:22 [INFO] [mender-convert-extract] Using configuration file: configs/mender\_convert\_config  
2024-05-17 08:56:22 [INFO] [mender-convert-extract] Using configuration file: ./work/override\_compression\_config  
2024-05-17 08:56:22 [INFO] [mender-convert-extract] Using configuration file: configs/raspberrypi4\_ubuntu\_ubuntu\_config  
modules/config.sh: line 20: configs/raspberrypi4\_ubuntu\_ubuntu\_config: No such file or directory  
mender-convert-extract has finished. Cleaning up…  
2024-05-17 08:56:22 [ERROR] [mender-convert] mender-convert failed  
2024-05-17 08:56:22 [INFO] [mender-convert-extract] Using configuration file: configs/mender\_convert\_config  
2024-05-17 08:56:22 [INFO] [mender-convert-extract] Using configuration file: ./work/override\_compression\_config  
2024-05-17 08:56:22 [INFO] [mender-convert-extract] Using configuration file: configs/raspberrypi4\_ubuntu\_ubuntu\_config  
2024-05-17 08:56:22 [ERROR] [mender-convert] mender-convert failed  
2024-05-17 08:56:22 [ERROR] [mender-convert] mender-convert exit code: 1  
Log file available at: /home/athvaith/mender-convert/logs/convert.log.1715936181-10782  
athvaith@athvaith:~/mender-convert$ MENDER\_GRUB\_KERNEL\_IMAGETYPE=“vmlinuz” MENDER\_ARTIFACT\_NAME=“release-1” ./docker-mender-convert --disk-image input/agl-raspberry.img --config configs/raspberrypi4\_ubuntu\_config  
using log file at: /home/athvaith/mender-convert/logs/convert.log.1715936191-10938  
Running mender-convert --disk-image input/agl-raspberry.img --config configs/raspberrypi4\_ubuntu\_config  
Running mender-convert-extract: --config ./work/override\_compression\_config --disk-image input/agl-raspberry.img --config configs/raspberrypi4\_ubuntu\_config  
2024-05-17 08:56:31 [INFO] [mender-convert-extract] Using configuration file: configs/mender\_convert\_config  
2024-05-17 08:56:31 [INFO] [mender-convert-extract] Using configuration file: ./work/override\_compression\_config  
2024-05-17 08:56:31 [INFO] [mender-convert-extract] Using configuration file: configs/raspberrypi4\_ubuntu\_config  
2024-05-17 08:56:31 [INFO] [mender-convert-extract] Validating disk image  
2024-05-17 08:56:31 [INFO] [mender-convert-extract] Disk parsed successfully  
2024-05-17 08:56:31 [INFO] [mender-convert-extract] NUMBER OF PARTS: 2 TYPE: dos  
2024-05-17 08:56:31 [INFO] [mender-convert-extract] PART 1: SIZE: 72.8M TYPE: 0xc  
2024-05-17 08:56:31 [INFO] [mender-convert-extract] PART 1: extracting to work/part-1.fs  
2024-05-17 08:56:32 [INFO] [mender-convert-extract] PART 2: SIZE: 8.1G TYPE: 0x83  
2024-05-17 08:56:32 [INFO] [mender-convert-extract] PART 2: extracting to work/part-2.fs  
mender-convert-extract has finished. Cleaning up…  
Running mender-convert-modify: --config ./work/override\_compression\_config --disk-image input/agl-raspberry.img --config configs/raspberrypi4\_ubuntu\_config  
2024-05-17 08:57:06 [INFO] [mender-convert-modify] Using configuration file: configs/mender\_convert\_config  
2024-05-17 08:57:06 [INFO] [mender-convert-modify] Using configuration file: ./work/override\_compression\_config  
2024-05-17 08:57:06 [INFO] [mender-convert-modify] Using configuration file: configs/raspberrypi4\_ubuntu\_config  
2024-05-17 08:57:09 [INFO] [mender-convert-modify] Creating state folder in the data partition for Mender add-ons  
2024-05-17 08:57:10 [INFO] [mender-convert-modify] Using root device A in mender.conf: /dev/mmcblk0p2  
2024-05-17 08:57:10 [INFO] [mender-convert-modify] Using root device B in mender.conf: /dev/mmcblk0p3  
2024-05-17 08:57:10 [INFO] [mender-convert-modify] Creating state scripts version file.  
2024-05-17 08:57:10 [INFO] [mender-convert-modify] Installing a custom /etc/fstab (see /mender-convert/logs/convert.log.1715936191-10938 for more info)  
2024-05-17 08:57:10 [INFO] [mender-convert-modify] Using boot partition device in fstab: /dev/mmcblk0p1  
2024-05-17 08:57:10 [INFO] [mender-convert-modify] Using data partition device in fstab: /dev/mmcblk0p4  
2024-05-17 08:57:10 [INFO] [mender-convert-modify] Installing Mender client and related files  
2024-05-17 08:57:10 [INFO] [mender-convert-modify] Installing Mender Auth and Mender Update version latest  
2024-05-17 08:57:12 [INFO] [mender-convert-modify] Successfully downloaded mender-auth\_4.0.2-1+debian+buster\_arm64.deb  
2024-05-17 08:57:13 [ERROR] [mender-convert-modify] dpkg returned unexpected return code: 127  
2024-05-17 08:57:19 [INFO] [mender-convert-modify] Successfully downloaded mender-update\_4.0.2-1+debian+buster\_arm64.deb  
2024-05-17 08:57:20 [ERROR] [mender-convert-modify] dpkg returned unexpected return code: 127  
2024-05-17 08:57:20 [INFO] [mender-convert-modify] Installing Mender Flash version latest  
2024-05-17 08:57:21 [INFO] [mender-convert-modify] Successfully downloaded mender-flash\_1.0.0-1+debian+buster\_arm64.deb  
2024-05-17 08:57:22 [ERROR] [mender-convert-modify] dpkg returned unexpected return code: 127  
2024-05-17 08:57:22 [INFO] [mender-convert-modify] Installing Mender Setup version latest  
2024-05-17 08:57:25 [INFO] [mender-convert-modify] Successfully downloaded mender-setup\_1.0.0-1+debian+buster\_arm64.deb  
2024-05-17 08:57:25 [ERROR] [mender-convert-modify] dpkg returned unexpected return code: 127  
2024-05-17 08:57:25 [INFO] [mender-convert-modify] Installing Mender Snapshot version latest  
2024-05-17 08:57:28 [INFO] [mender-convert-modify] Successfully downloaded mender-snapshot\_1.0.0-1+debian+buster\_arm64.deb  
2024-05-17 08:57:28 [ERROR] [mender-convert-modify] dpkg returned unexpected return code: 127  
2024-05-17 08:57:28 [INFO] [mender-convert-modify] Selinux is in enforcing mode. Enable autorelabel  
2024-05-17 08:57:28 [INFO] [mender-convert-modify] Performing platform specific modifications (if any)  
2024-05-17 08:57:28 [INFO] [mender-convert-modify] Running hook: platform\_modify  
mender-convert-modify has finished. Cleaning up…  
2024-05-17 08:57:29 [ERROR] [mender-convert] mender-convert failed  
2024-05-17 08:57:29 [DEBUG] [mender-convert-modify] When running: (configs/raspberrypi\_config:83): run\_and\_log\_cmd():

```
sudo cp work/boot/vmlinuz work/rootfs/boot/zImage
cp: cannot stat 'work/boot/vmlinuz': No such file or directory

```

2024-05-17 08:57:29 [ERROR] [mender-convert] mender-convert failed  
2024-05-17 08:57:29 [ERROR] [mender-convert] mender-convert exit code: 1  
Log file available at: /home/athvaith/mender-convert/logs/convert.log.1715936191-10938  
**Tried raspberrypi\_ubuntu\_config also**
