Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot convert: panic: archive/tar: invalid tar header #210

Closed
steren opened this issue Jan 15, 2024 · 3 comments
Closed

cannot convert: panic: archive/tar: invalid tar header #210

steren opened this issue Jan 15, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@steren
Copy link
Contributor

steren commented Jan 15, 2024

Using c2w version v0.6.1 on WSL Ubuntu with latest Docker desktop:

As I try to convert an image I have built locally:

FROM alpine:3.14
RUN apk add inkscape
ENTRYPOINT ["inkscape"]

I now get this error

#29 [bundle-dev 5/7] RUN mkdir -p /out/oci/rootfs /out/oci/bundle &&     IS_WIZER=false &&     if test "wizer" = "wizer" ; then IS_WIZER=true ; fi &&     NO_VMTOUCH_F=false &&     if test "wizer" = "native" ; then NO_VMTOUCH_F=true ; fi &&     if test "" != "" ; then NO_VMTOUCH_F="" ; fi &&     EXTERNAL_BUNDLE_F=false &&     if test "" = "true" ; then EXTERNAL_BUNDLE_F=true ; fi &&     create-spec --debug=false --debug-init=${IS_WIZER} --no-vmtouch=${NO_VMTOUCH_F} --external-bundle=${EXTERNAL_BUNDLE_F}                 --image-config-path=/oci/image.json                 --runtime-config-path=/oci/spec.json                 --rootfs-path=/oci/rootfs                 /oci "linux/amd64" /out/oci/rootfs
#29 0.316 Trying to unpack image as an OCI image
#29 0.316 nested manifest: processing [{application/vnd.oci.image.manifest.v1+json sha256:afb32e6e1d58ffc85e2c2310dd22cee8a1b9b0db50b405e3db900c232bc1e2ac 566 [] map[vnd.docker.reference.digest:sha256:1621dc67fa1ef10281df47eef725170c6d7caf103cae442f1084e8344c3f3325 vnd.docker.reference.type:attestation-manifest] [] 0xc00006e3c0 }]
#29 0.318 panic: archive/tar: invalid tar header
#29 0.318
#29 0.318 goroutine 1 [running]:
#29 0.318 main.main()
#29 0.318       /work/cmd/create-spec/main.go:58 +0x5ac
#29 ERROR: process "/bin/sh -c mkdir -p /out/oci/rootfs /out/oci/bundle &&     IS_WIZER=false &&     if test \"${OPTIMIZATION_MODE}\" = \"wizer\" ; then IS_WIZER=true ; fi &&     NO_VMTOUCH_F=false &&     if test \"${OPTIMIZATION_MODE}\" = \"native\" ; then NO_VMTOUCH_F=true ; fi &&     if test \"${NO_VMTOUCH}\" != \"\" ; then NO_VMTOUCH_F=\"${NO_VMTOUCH}\" ; fi &&     EXTERNAL_BUNDLE_F=false &&     if test \"${EXTERNAL_BUNDLE}\" = \"true\" ; then EXTERNAL_BUNDLE_F=true ; fi &&     create-spec --debug=${INIT_DEBUG} --debug-init=${IS_WIZER} --no-vmtouch=${NO_VMTOUCH_F} --external-bundle=${EXTERNAL_BUNDLE_F}                 --image-config-path=/oci/image.json                 --runtime-config-path=/oci/spec.json                 --rootfs-path=/oci/rootfs                 /oci \"${TARGETPLATFORM}\" /out/oci/rootfs" did not complete successfully: exit code: 2
------
 > [bundle-dev 5/7] RUN mkdir -p /out/oci/rootfs /out/oci/bundle &&     IS_WIZER=false &&     if test "wizer" = "wizer" ; then IS_WIZER=true ; fi &&     NO_VMTOUCH_F=false &&     if test "wizer" = "native" ; then NO_VMTOUCH_F=true ; fi &&     if test "" != "" ; then NO_VMTOUCH_F="" ; fi &&     EXTERNAL_BUNDLE_F=false &&     if test "" = "true" ; then EXTERNAL_BUNDLE_F=true ; fi &&     create-spec --debug=false --debug-init=${IS_WIZER} --no-vmtouch=${NO_VMTOUCH_F} --external-bundle=${EXTERNAL_BUNDLE_F}                 --image-config-path=/oci/image.json                 --runtime-config-path=/oci/spec.json                 --rootfs-path=/oci/rootfs                 /oci "linux/amd64" /out/oci/rootfs:
0.316 Trying to unpack image as an OCI image
0.316 nested manifest: processing [{application/vnd.oci.image.manifest.v1+json sha256:afb32e6e1d58ffc85e2c2310dd22cee8a1b9b0db50b405e3db900c232bc1e2ac 566 [] map[vnd.docker.reference.digest:sha256:1621dc67fa1ef10281df47eef725170c6d7caf103cae442f1084e8344c3f3325 vnd.docker.reference.type:attestation-manifest] [] 0xc00006e3c0 }]
0.318 panic: archive/tar: invalid tar header
0.318
0.318 goroutine 1 [running]:
0.318 main.main()
0.318   /work/cmd/create-spec/main.go:58 +0x5ac
------
container2wasm1996446593:59
--------------------
  58 |     # <vm-rootfs>/oci/initconfig.json : configuration file for init
  59 | >>> RUN mkdir -p /out/oci/rootfs /out/oci/bundle && \
  60 | >>>     IS_WIZER=false && \
  61 | >>>     if test "${OPTIMIZATION_MODE}" = "wizer" ; then IS_WIZER=true ; fi && \
  62 | >>>     NO_VMTOUCH_F=false && \
  63 | >>>     if test "${OPTIMIZATION_MODE}" = "native" ; then NO_VMTOUCH_F=true ; fi && \
  64 | >>>     if test "${NO_VMTOUCH}" != "" ; then NO_VMTOUCH_F="${NO_VMTOUCH}" ; fi && \
  65 | >>>     EXTERNAL_BUNDLE_F=false && \
  66 | >>>     if test "${EXTERNAL_BUNDLE}" = "true" ; then EXTERNAL_BUNDLE_F=true ; fi && \
  67 | >>>     create-spec --debug=${INIT_DEBUG} --debug-init=${IS_WIZER} --no-vmtouch=${NO_VMTOUCH_F} --external-bundle=${EXTERNAL_BUNDLE_F} \
  68 | >>>                 --image-config-path=/oci/image.json \
  69 | >>>                 --runtime-config-path=/oci/spec.json \
  70 | >>>                 --rootfs-path=/oci/rootfs \
  71 | >>>                 /oci "${TARGETPLATFORM}" /out/oci/rootfs
  72 |     RUN if test -f image.json; then mv image.json /out/oci/ ; fi && \
--------------------
ERROR: failed to solve: process "/bin/sh -c mkdir -p /out/oci/rootfs /out/oci/bundle &&     IS_WIZER=false &&     if test \"${OPTIMIZATION_MODE}\" = \"wizer\" ; then IS_WIZER=true ; fi &&     NO_VMTOUCH_F=false &&     if test \"${OPTIMIZATION_MODE}\" = \"native\" ; then NO_VMTOUCH_F=true ; fi &&     if test \"${NO_VMTOUCH}\" != \"\" ; then NO_VMTOUCH_F=\"${NO_VMTOUCH}\" ; fi &&     EXTERNAL_BUNDLE_F=false &&     if test \"${EXTERNAL_BUNDLE}\" = \"true\" ; then EXTERNAL_BUNDLE_F=true ; fi &&     create-spec --debug=${INIT_DEBUG} --debug-init=${IS_WIZER} --no-vmtouch=${NO_VMTOUCH_F} --external-bundle=${EXTERNAL_BUNDLE_F}                 --image-config-path=/oci/image.json                 --runtime-config-path=/oci/spec.json                 --rootfs-path=/oci/rootfs                 /oci \"${TARGETPLATFORM}\" /out/oci/rootfs" did not complete successfully: exit code: 2
exit status 1
@ktock
Copy link
Owner

ktock commented Jan 16, 2024

Thanks for reporting the issue. #212 is trying to fix this. You can try that patch using c2w --build-arg SOURCE_REPO_VERSION=indeximages <IMAGE> <OUTPUT>.

@ktock ktock added the bug Something isn't working label Jan 16, 2024
@ktock
Copy link
Owner

ktock commented Jan 17, 2024

Merged the patch and tagged it as v0.6.2. Please try v0.6.2 https://github.com/ktock/container2wasm/releases/tag/v0.6.2

@steren
Copy link
Contributor Author

steren commented Jan 20, 2024

I confirm it worked

@steren steren closed this as completed Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants