Skip to content

[BUG] "Failed to copy read stream" when importing multiple images #1020

Closed
@kuritka

Description

What did you do

Seems k3d doesn't properly close streams. The usecase is to create several clusters in pipeline and import images to them. k3d is radnomly (but with high occurence) failing when importing docker images.

  • How was the clusters created?
    • k3d cluster create test-gslb1 --wait -c k3d/test-gslb1.yaml
    • k3d cluster create test-gslb2 --wait -c k3d/test-gslb2.yaml
apiVersion: k3d.io/v1alpha3
kind: Simple
name: test-gslb1
image: docker.io/rancher/k3s:v1.21.2-k3s1
agents: 1
network: k3d-action-bridge-network
ports:
  - port: 80:80
    nodeFilters:
      - agent:0:direct
  - port: 443:443
    nodeFilters:
      - agent:0:direct
  - port: 3000:30030
    nodeFilters:
      - agent:0:direct
  - port: 9080:30090
    nodeFilters:
      - agent:0:direct
  - port: 5053:53/udp
    nodeFilters:
      - agent:0:direct
options:
  k3d:
    disableLoadbalancer: true
  k3s:
    extraArgs:
      - arg: --no-deploy=traefik,servicelb,metrics-server,local-storage
        nodeFilters:
          - server:*

here is problematic code (running multiple imports):

    k3d image import absaoss/k8gb:v0.8.8-f4a561e-amd64 -c test-gslb1
    k3d image import absaoss/k8gb:v0.8.8-f4a561e-amd64 -c test-gslb2

Output Error

test-gslb1:
INFO[0000] Importing image(s) into cluster 'test-gslb1' 
INFO[0000] Loading 1 image(s) from runtime into nodes... 
INFO[0000] Importing images '[absaoss/k8gb:v0.8.8-f4a561e-amd64]' into node 'k3d-test-gslb1-server-0'... 
INFO[0000] Importing images '[absaoss/k8gb:v0.8.8-f4a561e-amd64]' into node 'k3d-test-gslb1-agent-0'... 
INFO[0003] Successfully imported image(s)               
INFO[0003] Successfully imported 1 image(s) into 1 cluster(s) 

test-gslb2:
INFO[0000] Importing image(s) into cluster 'test-gslb2' 
INFO[0000] Loading 1 image(s) from runtime into nodes... 
INFO[0000] Importing images '[absaoss/k8gb:v0.8.8-f4a561e-amd64]' into node 'k3d-test-gslb2-agent-0'... 
INFO[0000] Importing images '[absaoss/k8gb:v0.8.8-f4a561e-amd64]' into node 'k3d-test-gslb2-server-0'... 
ERRO[0000] Failed to copy read stream. write unix @->/run/docker.sock: use of closed network connection 
Error: The operation was canceled.

Which OS & Architecture

  • MacOS / amd64

Which version of k3d

k3d version v5.3.0 instable
k3d version v5.2.2 instable
k3d version v5.1.0 very stable

Which version of docker

Cloud integration: v1.0.22
Version: 20.10.11
API version: 1.41
Go version: go1.16.10
Git commit: dea9396
Built: Thu Nov 18 00:36:09 2021
OS/Arch: darwin/amd64
Context: default
Experimental: true

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions