bootc-dev / bootc-dev/bootc

Symlink from /etc/<dir> to /usr/etc/<dir> breaks install to-filesystem

Open
#942 8 comments 0 reactions 0 assignees View on GitHub
area/client area/install bug triaged
Dominant language
Rust
Stars
2.3k
Forks
230
Avg merge
3d 12h
Merged PRs (30d)
38

Description

I've installed an RPM that includes a symlink from a path under `/etc` to a path under `/usr/etc`. In the container image:

```
# ls -l /etc/ | grep podman
lrwxrwxrwx 1 root root 21 Nov 12 2023 podman_hpc -> ../usr/etc/podman_hpc

# bootc --version
bootc 1.1.2
```

Attempting to run `bootc install to-filesystem` with this image ([Containerfile](https://github.com/user-attachments/files/18043513/Containerfile.txt)) fails. Using https://github.com/osbuild/bootc-image-builder, the error is:

```
# podman run --rm -it --privileged --pull=newer --security-opt label=type:unconfined_t -v ./output:/output -v /var/lib/containers/storage:/var/lib/containers/storage quay.io/centos-bootc/bootc-image-builder:latest --local --rootfs ext4 localhost/broken:4
...
ERROR Installing to filesystem: Creating ostree deployment: Pulling: Importing: Parsing layer blob sha256:0c79447a149538e009ebe92da56b5fb54c07de502c82f69683cf8ac5136e6ac9: **
OSTree:ERROR:src/ostree/ot-main.c:324:ostree_run: assertion failed: (success || error): Processing tar: Failed to commit tar: ExitStatus(unix_wait_status(134))
Traceback (most recent call last):
...
subprocess.CalledProcessError: Command '['bootc', 'install', 'to-filesystem', '--source-imgref', 'containers-storage:[overlay@/run/osbuild/containers/storage+/run/containers/storage]4ce67502d3e958860e4c9541e4cd375da6a9833d43df3d6389f8eaf33a22dca4', '--skip-fetch-check', '--generic-image', '--karg', 'rw', '--karg', 'console=tty0', '--karg', 'console=ttyS0', '--target-imgref', 'localhost/broken:4', '/run/osbuild/mounts']' returned non-zero exit status 1.
```
[log.txt](https://github.com/user-attachments/files/18043530/log.txt) is the complete log.

This comes from [ostree-ext/src/container/store.rs](https://github.com/containers/bootc/blob/3ead1457f0a6b99ece84769587e9f95f8dbcb942/ostree-ext/src/container/store.rs#L929-L931) and [ostree-ext/src/tar/write.rs](https://github.com/containers/bootc/blob/3ead1457f0a6b99ece84769587e9f95f8dbcb942/ostree-ext/src/tar/write.rs#L466-L472) AFAICT.

Building from an image without the link ([Containerfile](https://github.com/user-attachments/files/18043525/Containerfile-fixed.txt)) succeeds.

This looks a bit similar to https://github.com/containers/bootc/issues/637 and https://github.com/containers/bootc/issues/856, but with a symlink rather than a hard link.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.