Example provided in classic image definition doesn't build

Bug #2064121 reported by Damian Zaręba
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Image
Fix Committed
Low
Paul Mars

Bug Description

OS: Ubuntu Unity 24.04
Ubuntu-image version: 3.4+snap1

When using example provided under this link: https://github.com/canonical/ubuntu-image/blob/main/internal/imagedefinition/README.rst

Image doesn't build at all.

Error:

```yaml
Error: yaml: unmarshal errors:
  line 8: cannot unmarshal !!map into string
```

When editing this like from

```yaml
kernel:
  name: linux-raspi
```

to:
```yaml
kernel: linux-raspi
```

Then ubuntu-image returns following error:

```
WARNING: rootfs.sources-list-deb822 was not set. Please explicitly set the format desired for sources list in your image definition.
WARNING: rootfs.sources-list-deb822 is set to false. The deprecated format will be used to manage sources list. Please if possible adopt the new format.
Error: Schema validation failed: [ModelAssertion: Does not match format 'uri']
```

Revision history for this message
Damian Zaręba (khazakar) wrote :
description: updated
Revision history for this message
Paul Mars (upils) wrote :

Hey Damian,

Thank you for reporting the bug. I confirm it appears we completely forgot to keep this example up-to-date.

I will fix this. Meanwhile, feel free to look at https://git.launchpad.net/ubuntu-images/tree/ to get working and up-to-date examples to help you get started.

You can also read the current doc https://canonical-subiquity.readthedocs-hosted.com/en/latest/reference/ubuntu-image.html

Changed in ubuntu-image:
importance: Undecided → Low
assignee: nobody → Paul Mars (upils)
status: New → In Progress
tags: added: foundations-todo
Revision history for this message
Paul Mars (upils) wrote :
Changed in ubuntu-image:
status: In Progress → Fix Committed
Revision history for this message
Damian Zaręba (khazakar) wrote :

Thanks, it went further but still cannot build it locally. Output in attachments.

Revision history for this message
Paul Mars (upils) wrote :

That is definitely a different issue because if you use the configuration from the (now current) documentation, it should build fine. To be sure I tested it on my machine and it worked.

Were you able to reproduce this error? Did you make any change in the image definition?

Revision history for this message
Damian Zaręba (khazakar) wrote :

I used configuration straight from documentation. Now it works fine, I was missing... git command. Then debootstrap complained about missing root privileges, but sudo did the trick... until not working chroot.

Got this error:
```
W: Failure trying to run: chroot "/tmp/ubuntu-image-1253d431-7842-4612-90c5-38e443233758/chroot" /bin/true
W: See /tmp/ubuntu-image-1253d431-7842-4612-90c5-38e443233758/chroot/debootstrap/debootstrap.log for details
```
When trying to find that log, it's not there:
```
> cat /tmp/ubuntu-image-1253d431-7842-4612-90c5-38e443233758/chroot/debootstrap/debootstrap.log
cat: /tmp/ubuntu-image-1253d431-7842-4612-90c5-38e443233758/chroot/debootstrap/debootstrap.log: No such file or directory
```

Revision history for this message
Paul Mars (upils) wrote (last edit ):

Is your Ubuntu Unity 24.04 a fresh install or did you upgrade? I would like to reproduce so I will install a fresh ubuntu unity 24.04 VM.

I think you were the first one to run the tool on a host without git, so we never noticed it was missing from the snap. We should add that.

We should also make it more clear that the tool should always be run with sudo or as root because underlying tools require it.

Revision history for this message
Damian Zaręba (khazakar) wrote (last edit ):

1. It was a fresh install, no upgrade :)
2. I was just simply trying to hack stuff around to build slightly customized image on a fresh PC not meant initially for development - I'm glad that it will be worked on.
3. Sure, it would be great.

BTW. I just would want to appreciate your patience and willingness to help my poor soul :)

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.