Azure / draft-classic

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

draft up hangs upon "unauthorized: authentication required" #839

Open lastcoolnameleft opened 5 years ago

lastcoolnameleft commented 5 years ago

The issue I'm encountering is that when using Draft + ACR, if I need to login to ACR, then if I run "draft up", then instead of exiting (due to the auth error), draft will hang:

For example:

➜  duckiehunt git:(k8s) ✗ draft up
Draft Up Started: 'duckiehunt': 01CJ7N0KBZV48MGH7M917GWBXJ
duckiehunt: Building Docker Image: SUCCESS ⚓  (1.0003s)
duckiehunt: Pushing Docker Image -^C  <Waiting for ~10 minutes)

I try to push the docker image manually:

➜  duckiehunt git:(k8s) ✗ docker push duckiehunt.azurecr.io/duckiehunt:k8s
The push refers to repository [duckiehunt.azurecr.io/duckiehunt]
766601f87e53: Preparing
28b5355938c0: Preparing
f55578036391: Preparing
1967eacfc8e4: Preparing
b1e2bc9b0083: Preparing
b2336d640b10: Waiting
d22c21d06b5e: Waiting
46945b531694: Waiting
e98d4a05d598: Waiting
51d129fb8cc9: Waiting
16a8dbe36e73: Waiting
ff855d4efdbd: Waiting
f7dc68d0140a: Waiting
b7b45276eab1: Waiting
bca93b504abd: Waiting
de0633edd635: Waiting
0c8e3eadebad: Waiting
d8e63a6eb30e: Waiting
c1ab3a964f08: Waiting
8fad67424c4e: Waiting
unauthorized: authentication required

I see that Authentication is needed.

➜  duckiehunt git:(k8s) ✗ az acr login -n duckiehunt -g <resource group>

Login Succeeded

Now I try to run "draft up" again:

➜  duckiehunt git:(k8s) ✗ draft up
Draft Up Started: 'duckiehunt': 01CJ7NZ2A7YQ7S76PMX862A0BS
duckiehunt: Building Docker Image: SUCCESS ⚓  (1.0010s)
duckiehunt: Pushing Docker Image: SUCCESS ⚓  (5.7273s)
duckiehunt: Releasing Application: SUCCESS ⚓  (5.8915s)
Inspect the logs with `draft logs 01CJ7NZ2A7YQ7S76PMX862A0BS`
bacongobbler commented 5 years ago

thanks for the write-up. Sounds like there's a few asks in this ticket:

Does that sound like a decent summary of the issues listed here?

lastcoolnameleft commented 5 years ago

@bacongobbler Yes, that's a correct summary of the issues. Addressing the first issue would be more valuable as a user, because then I would understand why Draft wasn't working as expected (e.g. hanging vs fail quick and fail hard).

The 2nd Issue might involve adding Azure specific code, which would be valuable, but is a lower priority issue (IMHO).