Azure / draft-classic

A tool for developers to create cloud-native applications on Kubernetes.
https://draft.sh
MIT License
3.92k stars 395 forks source link

draft up error "panic: send on closed channel" when not logged into ACR #811

Open tomconte opened 6 years ago

tomconte commented 6 years ago

If I run draft up without previously logging into ACR, the error below is displayed, which does not clearly explains the problem.

After running az acr login -n myregistry the error goes away.

My ~/.draft/config.toml contains: registry = "myregistry.azurecr.io".

Draft Up Started: 'pisidplay': 01CF7H0ZMPZHT1XV4HB53CATCJ
pisidplay: Building Docker Image: SUCCESS ⚓  (28.0242s)
pisidplay: Pushing Docker Image /panic: send on closed channel

goroutine 103 [running]:
github.com/Azure/draft/pkg/builder/docker.(*Builder).Push.func1.1(0xc4209886c0, 0xc42069e020, 0x30520a0, 0xc4200120d0, 0xc420896580, 0x518, 0xc4200d40b0, 0xc4200e0150, 0xc420888000, 0x44)
    /go/src/github.com/Azure/draft/pkg/builder/docker/builder.go:127 +0x2af
created by github.com/Azure/draft/pkg/builder/docker.(*Builder).Push.func1
    /go/src/github.com/Azure/draft/pkg/builder/docker/builder.go:115 +0x149
exu commented 6 years ago

Same here

❯ draft up     
Draft Up Started: 'simple-api': 01CFCJS7A6E42DQ26JDK7BTW6W
simple-api: Building Docker Image: SUCCESS ⚓  (1.0004s)
simple-api: Pushing Docker Image \panic: send on closed channel

goroutine 52 [running]:
github.com/Azure/draft/pkg/builder/docker.(*Builder).Push.func1.1(0xc42030e100, 0xc420542020, 0x244dec0, 0xc420088048, 0xc4207be0a0, 0x98, 0xc4204ce030, 0xc4202d7b20, 0xc42001c310, 0x69)
    /go/src/github.com/Azure/draft/pkg/builder/docker/builder.go:127 +0x2af
created by github.com/Azure/draft/pkg/builder/docker.(*Builder).Push.func1
    /go/src/github.com/Azure/draft/pkg/builder/docker/builder.go:115 +0x149
exu commented 6 years ago

The same is happening for example repository from draft so IMO it's not an app issue.

dalekurt commented 6 years ago

Same is happening to my deploy using draft.

> draft up --debug
Draft Up Started: 'sema4app': 01CMFHYH0P75CEB0ATTMVFFC5C
demoapp: Building Docker Image: SUCCESS ⚓  (41.0366s)
demoapp: Pushing Docker Image \panic: send on closed channel

goroutine 97 [running]:
github.com/Azure/draft/pkg/builder/docker.(*Builder).Push.func1.1(0xc424e41190, 0xc4204be880, 0x30520a0, 0xc4200160d0, 0xc421cbe8d0, 0x24, 0xc4211d2178, 0xc424de4150, 0xc420924000, 0x44)
    /go/src/github.com/Azure/draft/pkg/builder/docker/builder.go:127 +0x2af
created by github.com/Azure/draft/pkg/builder/docker.(*Builder).Push.func1
    /go/src/github.com/Azure/draft/pkg/builder/docker/builder.go:115 +0x149

I'm running the following version

> draft version
&version.Version{SemVer:"v0.15.0", GitCommit:"9d73889a1318a435d126bc5df846610d30cfbe7f", GitTreeState:"clean"}

My repository is on GCP (gcr.io)

ranjeeth-ap commented 5 years ago

same issue:

bi-v-r81e2g8wm:example-python Ranjeeth$ draft up --debug hello world Error: failed to download "mysql" (hint: running helm repo update may help) Draft Up Started: 'example-python': 01CVR5337Y8976NG9WDSYWBVYW example-python: Building Docker Image: SUCCESS ⚓ (1.0012s) example-python: Pushing Docker Image -panic: send on closed channel

goroutine 23 [running]: github.com/Azure/draft/pkg/builder/docker.(Builder).Push.func1.1(0xc420aacda0, 0xc420ad6010, 0x30520a0, 0xc4200140a0, 0xc4204023dc, 0x4, 0xc42000c0b8, 0xc4202ba310, 0xc4200183c0, 0x4c) /go/src/github.com/Azure/draft/pkg/builder/docker/builder.go:127 +0x2af created by github.com/Azure/draft/pkg/builder/docker.(Builder).Push.func1 /go/src/github.com/Azure/draft/pkg/builder/docker/builder.go:115 +0x149

ofekih commented 5 years ago

Same issue. What operating system are you all using, I'm using linux (ubuntu)

ofekih commented 5 years ago

I managed to fix this issue by just reinstalling draft:

I deleted my 'draft home' directory I deleted my draft binary

I got the same release binary from the releases page, and then went again from scratch with draft init, draft create (I removed the previous files made with draft create), and then draft up worked

chris-hailstorm commented 5 years ago

Same issue whether the repo already exists on docker.io (with Public permissions), or not.

Is there some protocol for providing the docker.io password to draft config set registry?