k3d icon indicating copy to clipboard operation
k3d copied to clipboard

[BUG] `k3d image import`: prints out success message even if it fails

Open Dentrax opened this issue 1 year ago • 1 comments

What did you do

  • How was the cluster created?

    • -
  • What did you do afterwards?

    • k3d commands? k3d image import <IMAGE>
    • docker commands? -
    • OS operations (e.g. shutdown/reboot)? -

What did you expect to happen

It should exit with 1 and should not print out Successfully imported logs.

Related code line is here: https://github.com/k3d-io/k3d/blob/ef937a0aeff176a4f6b12ba7baecf11454e85097/pkg/client/tools.go#L143

Screenshots or terminal output

Screenshot 2024-08-10 at 14 47 42

Which OS & Architecture

arch: aarch64
cgroupdriver: cgroupfs
cgroupversion: "2"
endpoint: /var/run/docker.sock
filesystem: extfs
infoname: docker-desktop
name: docker
os: Docker Desktop
ostype: linux
version: 27.0.3

Which version of k3d

k3d version v5.7.2
k3s version v1.29.6-k3s2 (default)

Which version of docker

27.0.3

Dentrax avatar Aug 10 '24 11:08 Dentrax

Might be related to https://github.com/k3d-io/k3d/issues/1538

rrmistry avatar Dec 19 '24 00:12 rrmistry

I also hit this error - in repeated testing of some automation, this happens maybe one time in ten. I've worked around the issue by using --mode=direct

INFO[0000] Importing image(s) into cluster 'demo'                                                                                                                                                                               
INFO[0000] Starting new tools node...                   
INFO[0001] Starting Node 'k3d-demo-tools'         
INFO[0001] Saving 1 image(s) from runtime...            
INFO[0001] Importing images into nodes...               
INFO[0001] Importing images from tarball '/k3d/images/k3d-demo-images-20250827150654.tar' into node 'k3d-demo-server-0'... 
ERRO[0002] failed to import images in node 'k3d-demo-server-0': Exec process in node 'k3d-demo-server-0' failed with exit code '1': Logs from failed access process:
 tr: open /k3d/images/k3d-demo-images-20250827150654.tar: no such file or directory
INFO[0002] Removing the tarball(s) from image volume... 
INFO[0003] Removing k3d-tools node...                   
INFO[0004] Successfully imported image(s)               
INFO[0004] Successfully imported 1 image(s) into 1 cluster(s)

andybrown668 avatar Aug 27 '25 14:08 andybrown668