Closed bergkvist closed 7 months ago
Hi @bergkvist, thanks for reporting your issue.
TLDR; It's likely your containerd is not configured correctly. It needs to run with a few config settings for cri
, unpack_config
and proxy_plugins.nix
:
https://github.com/pdtpartners/nix-snapshotter/blob/6eb21bd3429535646da4aa396bb0c1f81a9b72c6/script/rootless/create-containerd-config.sh#L17-L19
Unpack platforms are defined here: https://github.com/pdtpartners/nix-snapshotter/blob/6eb21bd3429535646da4aa396bb0c1f81a9b72c6/pkg/nix2container/load.go#L29-L33
Which on unix platforms defaults to runtime.GOOS
and runtime.GOARCH
:
https://github.com/containerd/containerd/blob/v1.7.2/platforms/defaults_unix.go#L27-L35
nix-snapshotter.default.buildImage
is running code in pkg/nix2container/load.go
inside the Nix sandbox, so that's where runtime.GOOS
and runtime.GOARCH
will get its values from.
The error site on the containerd site will be down this code path:
This means either iu.UnpackPlatforms() or ts.config.UnpackPlatforms is missing the nix snapshotter platform.
iu.UnpackPlatforms()
is traced down to:
That's defined by us so that's not going to be incorrect one. So it must be ts.config.UnpackPlatforms
which is traced down to:
@bergkvist Do you mind confirming if it's indeed a configuration issue?
I did try editing the containerd config, and managed to get rid of this particular error - but in so doing I also somehow managed to corrupt my microk8s instance in a way where the Kubernetes API kept being constantly killed even after removing the config again, and rebooting the server microk8s was running on.
I ended up just creating a new server, and I haven't reinstalled microk8s yet, or had time to look more at this since then. Unfortunately that also means I don't have those new logs/error messages right now.
Please re-open if you were able to reproduce this issue with the suggested containerd config changes.
Error message:
Source of error:
https://github.com/pdtpartners/nix-snapshotter/blob/6eb21bd3429535646da4aa396bb0c1f81a9b72c6/pkg/nix2container/load.go#L51
Environment
Starting nix-snapshotter:
We deploy to microk8s using: