runwasi icon indicating copy to clipboard operation
runwasi copied to clipboard

"no unpack platforms defined: invalid argument" happens when `make load`

Open keisku opened this issue 9 months ago • 2 comments

This error happens during the Demo.

Env

uname -a
Linux keisuke-ubuntu-desktop 6.5.0-1016-aws #16~22.04.1-Ubuntu SMP Wed Mar 13 18:54:49 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

# Self build
ctr --version
ctr github.com/containerd/containerd/v2 v2.0.0-beta.2-452-gb6ffa2794

Error

make load
[ -f /home/ubuntu/Workspace/runwasi/dist/img.tar ] || make target/wasm32-wasi/debug/img.tar
[ -f /home/ubuntu/Workspace/runwasi/dist/img.tar ] || cp target/wasm32-wasi/debug/img.tar "dist/img.tar"
sudo ctr -n default image import --all-platforms dist/img.tar
ctr: rpc error: code = InvalidArgument desc = unable to initialize unpacker: no unpack platforms defined: invalid argument
make: *** [Makefile:195: load] Error 1

Workaround: Add --local flag since v1.7+ and run ctr image import directly.

Ref:

  • https://github.com/containerd/containerd/issues/7592
  • https://github.com/containerd/containerd/blob/a26c686ea2671dbdba0c1b6fd2320ca0693fa936/cmd/ctr/commands/images/import.go#L90-L93
sudo ctr -n default image import --local --all-platforms dist/img.tar
unpacking ghcr.io/containerd/runwasi/wasi-demo-app:latest (sha256:540abaea9e27f1d5f150358fffc3b4ed7dd72a732864d78917e99d6241744ad8)...done

I wanted to add --local flag to Makefile but I've noticed runwasi supports ctr 1.6.25+ that doesn't support --local flag.

https://github.com/containerd/runwasi/blob/73df3507171080f5146e5464f29f2aca29dd9ce6/Makefile#L196-L200

keisku avatar May 05 '24 00:05 keisku

Thanks for raising this issue and I am glad that you found a workaround.

This seems like a breaking change from the ctr CLI in v2.0.0. Perhaps, we can add a condition in Makefile to check if CTR_VERSION is v2.0.0 and above, we add --local flag.

Mossaka avatar May 13 '24 19:05 Mossaka

Any change is likely unintended. We should report in containerd/containerd.

cpuguy83 avatar May 14 '24 05:05 cpuguy83