Error converting to codepage 850 Invalid argument with ubuntu-image from snap

Bug #1814762 reported by Maciej Borzecki
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ubuntu Image
Fix Released
Undecided
Unassigned

Bug Description

I have ubuntu-image installed as a classic snap on Arch. Version 1.6+snap1, rev 135.

Using ubuntu-image to build an image for RPi3 fails, when populating the boot partition:

$ ubuntu-image snap -w $PWD/image-home rpi3.model --channel edge --extra-snaps ../snapd-snap/snapd_2.37.1+git367.g6ab5c6e_armhf.snap
Fetching snapd
Fetching core18
Fetching pi-kernel
Fetching pi
snapd already prepared, skipping
WARNING: "snapd" were installed from local snaps disconnected from a store and cannot be refreshed subsequently!
COMMAND FAILED: mcopy -s -i /home/maciek/work/canonical/image/image-home/volumes/pi/part0.img /home/maciek/work/canonical/image/image-home/volumes/pi/part0/uboot.env /home/maciek/work/canonical/image/image-home/volumes/pi/part0/config.txt /home/maciek/work/canonical/image/image-home/volumes/pi/part0/fixup.dat /home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2708-rpi-cm.dtb /home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2708-rpi-b-plus.dtb /home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2835-rpi-zero.dtb /home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2710-rpi-cm3.dtb /home/maciek/work/canonical/image/image-home/volumes/pi/part0/pi-kernel_21.snap /home/maciek/work/canonical/image/image-home/volumes/pi/part0/start_x.elf /home/maciek/work/canonical/image/image-home/volumes/pi/part0/bootcode.bin /home/maciek/work/canonical/image/image-home/volumes/pi/part0/cmdline.txt /home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2708-rpi-b.dtb /home/maciek/work/canonical/image/image-home/volumes/pi/part0/start.elf /home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2708-rpi-0-w.dtb /home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2710-rpi-3-b.dtb /home/maciek/work/canonical/image/image-home/volumes/pi/part0/fixup_cd.dat /home/maciek/work/canonical/image/image-home/volumes/pi/part0/start_db.elf /home/maciek/work/canonical/image/image-home/volumes/pi/part0/fixup_db.dat /home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2835-rpi-b.dtb
/home/maciek/work/canonical/image/image-home/volumes/pi/part0/COPYING.linux /home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2835-rpi-a-plus.dtb /home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2835-rpi-zero-w.dtb /home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2835-rpi-b-rev2.dtb /home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2835-rpi-b-plus.dtb /home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2835-rpi-a.dtb /home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2837-rpi-3-b.dtb /home/maciek/work/canonical/image/image-home/volumes/pi/part0/psplash.img /home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2836-rpi-2-b.dtb /home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2709-rpi-2-b.dtb /home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2710-rpi-3-b-plus.dtb /home/maciek/work/canonical/image/image-home/volumes/pi/part0/LICENCE.broadcom /home/maciek/work/canonical/image/image-home/volumes/pi/part0/overlays /home/maciek/work/canonical/image/image-home/volumes/pi/part0/start_cd.elf /home/maciek/work/canonical/image/image-home/volumes/pi/part0/uboot3.bin /home/maciek/work/canonical/image/image-home/volumes/pi/part0/fixup_x.dat /home/maciek/work/canonical/image/image-home/volumes/pi/part0/uboot2.bin ::

Error converting to codepage 850 Invalid argument
Cannot initialize '::'
Bad target ::

Crash in state machine
Traceback (most recent call last):
  File "/snap/ubuntu-image/135/lib/python3/site-packages/ubuntu_image/__main__.py", line 349, in main
    list(state_machine)
  File "/snap/ubuntu-image/135/lib/python3/site-packages/ubuntu_image/state.py", line 82, in __next__
    step()
  File "/snap/ubuntu-image/135/lib/python3/site-packages/ubuntu_image/common_builder.py", line 408, in populate_filesystems
    self._populate_one_volume(name, volume)
  File "/snap/ubuntu-image/135/lib/python3/site-packages/ubuntu_image/common_builder.py", line 398, in _populate_one_volume
    env=env)
  File "/snap/ubuntu-image/135/lib/python3/site-packages/ubuntu_image/helpers.py", line 122, in run
    proc.check_returncode()
  File "/snap/ubuntu-image/135/usr/lib/python3.5/subprocess.py", line 659, in check_returncode
    self.stderr)
subprocess.CalledProcessError: Command '['mcopy', '-s', '-i', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0.img', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/uboot.env', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/config.txt', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/fixup.dat', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2708-rpi-cm.dtb', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2708-rpi-b-plus.dtb', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2835-rpi-zero.dtb', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2710-rpi-cm3.dtb', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/pi-kernel_21.snap', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/start_x.elf', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/bootcode.bin', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/cmdline.txt', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2708-rpi-b.dtb', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/start.elf', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2708-rpi-0-w.dtb', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2710-rpi-3-b.dtb', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/fixup_cd.dat', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/start_db.elf', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/fixup_db.dat', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2835-rpi-b.dtb', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/COPYING.linux', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2835-rpi-a-plus.dtb', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2835-rpi-zero-w.dtb', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2835-rpi-b-rev2.dtb', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2835-rpi-b-plus.dtb', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2835-rpi-a.dtb', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2837-rpi-3-b.dtb', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/psplash.img', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2836-rpi-2-b.dtb', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2709-rpi-2-b.dtb', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/bcm2710-rpi-3-b-plus.dtb', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/LICENCE.broadcom', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/overlays', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/start_cd.elf', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/uboot3.bin', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/fixup_x.dat', '/home/maciek/work/canonical/image/image-home/volumes/pi/part0/uboot2.bin', '::']' returned non-zero exit status 1

However, it is possible to build the image using ubuntu-image from source, rev 5ffcfad, tag 1.6+19.04ubuntu1. This would suggest there may be something missing in the snap.

Revision history for this message
Valentin David (valentin.david) wrote :

I have also the same issue with 2.2+snap9. The problem is that the snap provides glibc, but not the gconv modules. It tries to load the one from hosts which are not compatible if glibc on host is newer.

The solution would be to provide the gconv module `IBM850.so` as well as a gconv configuration with the right alias. And set GCONV_PATH to the directory they are provided.

Revision history for this message
Valentin David (valentin.david) wrote :

Sorry, libc is provided by core20. So everything is there. Just need to set GCONV_PATH. Adding "GCONV_PATH: /snap/core20/current/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/gconv" to the environment in snapcraft.yaml fixed it for me.

Paul Mars (upils)
Changed in ubuntu-image:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.