bluerobotics / bluerobotics/BlueOS

bug: local docker build fails intermittently in the frontend-builder step

Open
#4,326 1 comment 0 reactions 1 assignee Claimed by @nukelet View on GitHub
bug core investigate triage
Dominant language
Vue
Stars
453
Forks
151
Avg merge
1d 3h
Merged PRs (30d)
174

Description

### Bug description

Sometimes a local build of the BlueOS Docker image will fail in the `frontend-builder` step with an error message similar to this:

```
#32 [frontend-builder 4/4] RUN <<-EOF (set -e...)
#32 1.865 bun install v1.3.14 (0d9b296a)
#32 6.522 error: Fail extracting tarball for "vuetify"
#32 ...
```

Note that currently I've only tested this on local armv7 runners. Here's my system info:

```bash
$ cat /etc/os-release
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo
```

### Steps to reproduce

1. Prepare a local armv7 cross-arch runner:
```
$ docker buildx create --use --platform=linux/arm/v7 --buildkitd-flags '--allow-insecure-entitlement network.host --allow-insecure-entitlement security.insecure' --name arm-builder
```
2. Start a local build of the BlueOS Docker image, e.g. by running
```
$ docker buildx build --allow security.insecure --platform linux/arm/v7 ./core -t nukelet/blueos-core:$(git rev-parse --abbrev-ref HEAD) --build-arg VITE_APP_GIT_DESCRIBE=$(git describe --long --always --dirty --all) --progress=plain --output type=docker
```
3. The build will intermittently fail on the `frontend-builder` step with the error mentioned above

### Primary pain point(s)

_No response_

### Additional context

Complete logs from an example of a flaky build:

```
➜ BlueOS git:(configurable-vehicle-id) ✗ docker buildx build --allow security.insecure --platform linux/arm/v7 ./core -t nukelet/blueos-core:$(git rev-parse --abbrev-ref HEAD) --build-arg VITE_APP_GIT_DESCRIBE=$(git describe --long --always --dirty --all) --progress=plain --output type=docker,dest=- | ssh pi@192.168.15.6 "docker load"
** WARNING: connection is not using a post-quantum key exchange algorithm.
** This session may be vulnerable to "store now, decrypt later" attacks.
** The server may need to be upgraded. See https://openssh.com/pq.html
#0 building with "arm-builder" instance using docker-container driver

#1 [internal] load build definition from Dockerfile
#1 DONE 0.0s

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 5.40kB done
#1 DONE 0.1s

#2 [internal] load metadata for docker.io/bluerobotics/blueos-base:0.2.6
#2 ...

#3 [auth] bluerobotics/blueos-base:pull token for registry-1.docker.io
#3 DONE 0.0s

#4 [auth] oven/bun:pull token for registry-1.docker.io
#4 DONE 0.0s

#5 [internal] load metadata for docker.io/oven/bun:1.3.14-slim
#5 ...

#2 [internal] load metadata for docker.io/bluerobotics/blueos-base:0.2.6
#2 DONE 1.3s

#5 [internal] load metadata for docker.io/oven/bun:1.3.14-slim
#5 DONE 1.3s

#6 [internal] load .dockerignore
#6 transferring context:
#6 transferring context: 197B done
#6 DONE 0.6s

#7 [internal] load build context
#7 DONE 0.0s

#8 [frontend-builder 1/4] FROM docker.io/oven/bun:1.3.14-slim@sha256:d56a2534ffd262e92c12fd3249d3924d296d97086da773f821d7d0477435ea04
#8 resolve docker.io/oven/bun:1.3.14-slim@sha256:d56a2534ffd262e92c12fd3249d3924d296d97086da773f821d7d0477435ea04
#8 resolve docker.io/oven/bun:1.3.14-slim@sha256:d56a2534ffd262e92c12fd3249d3924d296d97086da773f821d7d0477435ea04 0.2s done
#8 DONE 0.3s

#9 [base 1/1] FROM docker.io/bluerobotics/blueos-base:0.2.6@sha256:c1779858c0fa1dca5e510077e19a42fbd47dbbba1dff84608b0d14d7a022af7f
#9 resolve docker.io/bluerobotics/blueos-base:0.2.6@sha256:c1779858c0fa1dca5e510077e19a42fbd47dbbba1dff84608b0d14d7a022af7f 0.2s done
#9 DONE 0.2s

#7 [internal] load build context
#7 ...

#10 [install-services-and-libs 2/13] ADD https://astral.sh/uv/install.sh /uv-installer.sh
#10 DONE 0.9s

#7 [internal] load build context
#7 transferring context: 497.91MB 1.3s done
#7 DONE 1.8s

#11 [download-binaries 2/3] RUN apt update && apt install -y --no-install-recommends binutils
#11 CACHED

#12 [download-binaries 1/3] COPY tools /home/pi/tools
#12 CACHED

#13 [stage-4 3/13] RUN /home/pi/tools/install-system-tools.sh
#13 CACHED

#14 [stage-4 2/13] COPY tools /home/pi/tools
#14 CACHED

#15 [stage-4 1/13] RUN <<-EOF (set -e...)
#15 CACHED

#16 [download-binaries 3/3] RUN /home/pi/tools/install-static-binaries.sh
#16 CACHED

#17 [install-services-and-libs 1/13] RUN apt update && apt install -y --no-install-recommends g++
#17 CACHED

#18 [install-services-and-libs 3/13] RUN sh /uv-installer.sh && rm /uv-installer.sh
#18 CACHED

#19 [install-services-and-libs 2/13] ADD https://astral.sh/uv/install.sh /uv-installer.sh
#19 CACHED

#20 [install-services-and-libs 4/13] COPY ./uv.lock /home/pi/uv.lock
#20 CACHED

#21 [install-services-and-libs 5/13] COPY ./pyproject.toml /home/pi/pyproject.toml
#21 CACHED

#22 [install-services-and-libs 6/13] COPY ./.python-version /home/pi/.python-version
#22 CACHED

#23 [install-services-and-libs 7/13] COPY ./libs /home/pi/libs
#23 CACHED

#24 [stage-4 4/13] COPY libs /home/pi/libs
#24 CACHED

#25 [frontend-builder 2/4] RUN <<-EOF (set -e...)
#25 CACHED

#26 [frontend-builder 3/4] COPY frontend /home/pi/frontend
#26 DONE 1.7s

#27 [install-services-and-libs 8/13] COPY ./services /home/pi/services
#27 ...

#28 [stage-4 5/13] COPY services /home/pi/services
#28 DONE 1.8s

#27 [install-services-and-libs 8/13] COPY ./services /home/pi/services
#27 DONE 1.9s

#29 [install-services-and-libs 9/13] COPY ./tools /home/pi/tools
#29 ...

#30 [stage-4 6/13] COPY configuration/tmux.conf /etc/tmux.conf
#30 DONE 1.6s

#29 [install-services-and-libs 9/13] COPY ./tools /home/pi/tools
#29 DONE 1.7s

#31 [stage-4 7/13] COPY configuration/motd /etc/motd
#31 DONE 6.5s

#32 [frontend-builder 4/4] RUN <<-EOF (set -e...)
#32 1.865 bun install v1.3.14 (0d9b296a)
#32 6.522 error: Fail extracting tarball for "vuetify"
#32 ...

#33 [install-services-and-libs 10/13] WORKDIR /home/pi
#33 DONE 6.4s

#34 [install-services-and-libs 11/13] RUN uv venv && uv sync --frozen --no-default-groups
#34 ...

#32 [frontend-builder 4/4] RUN <<-EOF (set -e...)
#32 9.244 error: Fail extracting tarball from vuetify
#32 ERROR: process "/bin/sh -c set -e\n\n bun install --frozen-lockfile --cwd /home/pi/frontend\n NODE_OPTIONS=--max-old-space-size=8192 bun run --cwd /home/pi/frontend build\n\n" did not complete successfully: exit code: 1

#35 [stage-4 8/13] COPY start-blueos-core /usr/bin/start-blueos-core
#35 DONE 1.6s

#34 [install-services-and-libs 11/13] RUN uv venv && uv sync --frozen --no-default-groups
#34 CANCELED
------
> [frontend-builder 4/4] RUN <<-EOF (set -e...):
1.865 bun install v1.3.14 (0d9b296a)
6.522 error: Fail extracting tarball for "vuetify"
9.244 error: Fail extracting tarball from vuetify
------
Dockerfile:21
--------------------
20 | COPY frontend /home/pi/frontend
21 | >>> RUN <<-EOF
22 | >>> set -e
23 | >>>
24 | >>> bun install --frozen-lockfile --cwd /home/pi/frontend
25 | >>> NODE_OPTIONS=--max-old-space-size=8192 bun run --cwd /home/pi/frontend build
26 | >>>
27 | >>> EOF
28 |
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c set -e\n\n bun install --frozen-lockfile --cwd /home/pi/frontend\n NODE_OPTIONS=--max-old-space-size=8192 bun run --cwd /home/pi/frontend build\n\n" did not complete successfully: exit code: 1
open /var/lib/docker/tmp/docker-import-1429812647/repositories: no such file or directory
```

### Prerequisites

- [x] I have checked to make sure that a similar request has not already been filed or fixed.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.