ublue-os / image-template

Build your own custom Universal Blue Image!
Apache License 2.0
86 stars 17 forks source link

Initial build fails #10

Closed marcinjahn closed 2 months ago

marcinjahn commented 2 months ago

I just created my own repo based on image-template. That automatically triggered a build, and it fails on:

STEP 2/3: COPY build.sh /tmp/build.sh
STEP 3/3: RUN mkdir -p /var/lib/alternatives &&     /tmp/build.sh &&     ostree container commit
++ rpm -E %fedora
+ RELEASE=40
+ rpm-ostree install screen
Enabled rpm-md repositories: rpmfusion-nonfree rpmfusion-nonfree-updates-testing rpmfusion-free rpmfusion-nonfree-updates copr:copr.fedorainfracloud.org:ublue-os:akmods rpmfusion-free-updates-testing rpmfusion-free-updates updates fedora-cisco-openh264 fedora updates-archive
Updating metadata for 'rpmfusion-nonfree'...done
Updating metadata for 'rpmfusion-nonfree-updates-testing'...done
Updating metadata for 'rpmfusion-free'...done
Updating metadata for 'rpmfusion-nonfree-updates'...done
Updating metadata for 'copr:copr.fedorainfracloud.org:ublue-os:akmods'...done
Updating metadata for 'rpmfusion-free-updates-testing'...done
Updating metadata for 'rpmfusion-free-updates'...done
Updating metadata for 'updates'...done
Updating metadata for 'fedora-cisco-openh264'...done
Updating metadata for 'fedora'...done
Updating metadata for 'updates-archive'...done
Importing rpm-md...done
rpm-md repo 'rpmfusion-nonfree'; generated: 2024-04-20T12:18:23Z solvables: 194
rpm-md repo 'rpmfusion-nonfree-updates-testing'; generated: 2024-04-20T11:40:32Z solvables: 3
rpm-md repo 'rpmfusion-free'; generated: 2024-04-20T12:11:51Z solvables: 422
rpm-md repo 'rpmfusion-nonfree-updates'; generated: 2024-04-20T11:43:39Z solvables: 52
rpm-md repo 'copr:copr.fedorainfracloud.org:ublue-os:akmods'; generated: 2024-04-23T05:04:58Z solvables: 201
rpm-md repo 'rpmfusion-free-updates-testing'; generated: 2024-04-20T11:41:15Z solvables: 3
rpm-md repo 'rpmfusion-free-updates'; generated: 2024-04-20T11:41:35Z solvables: 1
rpm-md repo 'updates'; generated: 2024-04-23T01:10:22Z solvables: 5156
rpm-md repo 'fedora-cisco-openh264'; generated: 2023-12-11T14:43:50Z solvables: 4
rpm-md repo 'fedora'; generated: 2024-04-19T08:53:31Z solvables: 74873
rpm-md repo 'updates-archive'; generated: 2023-10-06T17:04:49Z solvables: 0
Resolving dependencies...done
Will download: 1 package (662.9?kB)
Downloading from 'fedora'...done
Installing 1 packages:
  screen-4.9.1-1.fc40.x86_64 (fedora)
Installing: screen-4.9.1-1.fc40.x86_64 (fedora)
+ sed -i 's/#DefaultTimeoutStopSec.*/DefaultTimeoutStopSec=15s/' /etc/systemd/user.conf
sed: can't read /etc/systemd/user.conf: No such file or directory
error building at STEP "RUN mkdir -p /var/lib/alternatives &&     /tmp/build.sh &&     ostree container commit": error while running runtime: exit status 2
time="2024-04-23T16:22:29Z" level=error msg="exit status 2"
Error: Error: buildah exited with code 2
noelmiller commented 2 months ago

Good catch. I will PR a fix now.

noelmiller commented 2 months ago

@bsherman when you have a minute...

Something is really odd here. F40 release shows that file does not exist, but 39 release does. image image

noelmiller commented 2 months ago

Thank you @Conan-Kudo for helping me figure this out!

Issue is upstream systemd moved these files out of /etc/systemd and into /usr/lib/systemd which is why the builds are broken on F40. I can make a simple change to the example to fix this up.

Upstream issues:

https://src.fedoraproject.org/rpms/systemd/c/29eb35530b29232eed65718d0cd96d67cd7ffd6b

https://github.com/systemd/systemd/commit/6495361c7d

bsherman commented 2 months ago

@noelmiller I suggest we remove this as an example and instead add something simple, like:

systemctl enable podman.socket

noelmiller commented 2 months ago

@noelmiller I suggest we remove this as an example and instead add something simple, like:

systemctl enable podman.socket

Sounds good. Do we make this change on any of our images by default? I would assume no given we haven't run into it.

marcinjahn commented 2 months ago

I actually liked the example of installing some package. It’s very typical thing to do, while enabling some service is a bit less clear why it’s there I think.

noelmiller commented 2 months ago

I actually liked the example of installing some package. It’s very typical thing to do, while enabling some service is a bit less clear why it’s there I think.

We would be removing the example of changing a default systemd behavior from it. The install packages example will stay.

bsherman commented 2 months ago

@noelmiller I suggest we remove this as an example and instead add something simple, like: systemctl enable podman.socket

Sounds good. Do we make this change on any of our images by default? I would assume no given we haven't run into it.

Only bazzite still uses the sed method to modify DefaultTimeoutStopSec . And bazzite switched to the new path already.

I'm indifferent... we can fix by correcting the path, or we can fix by using some other mostly benign change, or leave a commented out # systemctl enable podman.socket .

I don't think the example needs to be active to be useful.

I was hesitant with the DefaultTimeoutStopSec example originally because it's a bit more invasive than enabling a service. :shrug:

marcinjahn commented 2 months ago

Yeah, you’re right, somehow I thought the error was a part of screen installation, I missed the last two commands there. Good idea to replace it with the systemctl command