Closed tsukaby closed 3 months ago
Thanks for reporting, can you re-run failed job in debug and give full logs or a link to your repo please? That would help figure out your issue. Thanks
If someone else can give a link to his repo with this issue please do! thanks!
I have same issue in my workflow. https://github.com/VirtualLiveLab/Mikubot/actions/runs/10283711021
I have same issue in my workflow. https://github.com/VirtualLiveLab/Mikubot/actions/runs/10283711021
Thanks I'm taking a look.
I have same issue in my workflow. https://github.com/VirtualLiveLab/Mikubot/actions/runs/10283711021
Wonder if this linked to this special char in https://github.com/VirtualLiveLab/Mikubot/blob/4a9b43a46f0a20358a504eb14d2781130022c68d/Dockerfile#L12
FROM python:3.11-bookworm as builder
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONUSERBASE=/app/__pypackages__
COPY requirements.lock ./
RUN pip install --user --no-cache-dir -r requirements.lock
# https://github.com/GoogleContainerTools/distroless/blob/main/python3/BUILD
# distroless/python3-debian12のPythonは3.11
FROM gcr.io/distroless/python3-debian12:nonroot as runner
WORKDIR /app
ENV PYTHONUSERBASE=/app/__pypackages__
USER nonroot
COPY --from=builder /app/__pypackages__ /app/__pypackages__
COPY --chown=nonroot:nonroot . ./
CMD ["main.py"]
Edit: Ok that's it, was able to repro:
InvalidCharacterError: Invalid character
at btoa (node:buffer:1255:11)
This can also happen if the file contains a byte order mark:
$ file Dockerfile
Dockerfile: Unicode text, UTF-8 (with BOM) text
$ head -n1 Dockerfile | hexdump -C
00000000 ef bb bf 46 52 4f 4d 20 2d 2d 70 6c 61 74 66 6f |...FROM --platfo|
...
The job logs showed:
...
#40 writing config sha256:8007b27a324fdb90c5c2101b7448ed667ba201138fce281f776fe4d3b9cadd33
#40 preparing build cache for export 47.2s done
#40 writing config sha256:8007b27a324fdb90c5c2101b7448ed667ba201138fce281f776fe4d3b9cadd33 done
#40 writing cache manifest sha256:51dbba7a93f69fa3d5762c5c8adb7ec9248de6f5fde6c4ded4187e1ef5772 done
#40 DONE 47.2s
#41 resolving provenance for metadata file
#41 DONE 0.0s
ImageID
Digest
Metadata
Reference
Error: Invalid character
So both the build and the push were successful, as well as the write to cache. It failed after everything except the job summary write finished.
Removing the BOM fixed it:
$ file Dockerfile
Dockerfile: ASCII text
$ head -n1 Dockerfile | hexdump -C
00000000 46 52 4f 4d 20 2d 2d 70 6c 61 74 66 6f 72 6d 3d |FROM --platform=|
...
Should be fixed with latest patch release: https://github.com/docker/build-push-action/releases/tag/v6.6.1
Should be fixed with latest patch release
Can confirm my BOM file no longer crashes on build. Thanks!
I used version 6.6.1 and it worked fine.
Thank you!
Contributing guidelines
I've found a bug, and:
Description
Version 6.6.0 is probably broken. Since this version was released I have observed an error in GitHub Action.
It seems to be pushed to my docker repository(AWS ECR), so the build and push are successful, but it is an error for my workflow.
Run docker/setup-buildx-action@v3
Run docker/build-push-action@v6
Expected behaviour
Successful build and push without an error.
Actual behaviour
Build and push failed.
Repository URL
No response
Workflow run URL
No response
YAML workflow
Workflow logs
No response
BuildKit logs
No response
Additional info
No response