Azure / caf-terraform-landingzones-accelerator

Starter project for Applications (level 4) Cloud Adoption Framework for Azure landing zones on Terraform
MIT License
206 stars 230 forks source link

Rover login command fails when running in VS Code container #97

Open paolosalvatori opened 3 years ago

paolosalvatori commented 3 years ago

Describe the bug The rover login command fails when trying to login after following the instructions at Getting started with Azure Cloud Adoption Framework landing zones for Terraform

vscode@f912543adaf1:/tf/caf$ rover login

  /$$$$$$   /$$$$$$  /$$$$$$$$       /$$$$$$$
 /$$__  $$ /$$__  $$| $$_____/      | $$__  $$
| $$  \__/| $$  \ $$| $$            | $$  \ $$  /$$$$$$  /$$    /$$/$$$$$$   /$$$$$$
| $$      | $$$$$$$$| $$$$$         | $$$$$$$/ /$$__  $$|  $$  /$$/$$__  $$ /$$__  $$
| $$      | $$__  $$| $$__/         | $$__  $$| $$  \ $$ \  $$/$$/ $$$$$$$$| $$  \__/
| $$    $$| $$  | $$| $$            | $$  \ $$| $$  | $$  \  $$$/| $$_____/| $$
|  $$$$$$/| $$  | $$| $$            | $$  | $$|  $$$$$$/   \  $/ |  $$$$$$$| $$
 \______/ |__/  |__/|__/            |__/  |__/ \______/     \_/   \_______/|__/

              version: aztfmod/rover:1.0.1-2106.3012

@calling verify_azure_session

Checking existing Azure session
ERROR: Please ensure you have network connection. Error detail: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /common/oauth2/devicecode?api-version=1.0 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fb6d23e4e50>: Failed to establish a new connection: [Errno -5] No address associated with hostname'))
Error on or near line 206; exiting with status 1
Error on or near line 206; exiting with status 1

@calling clean_up_variables
cleanup variables
clean_up backend_files

Even az login command fails, ore better, I can successfully login via browser, but the command fails with the following error:

vscode@f912543adaf1:/tf/caf$ az login 
The default web browser has been opened at https://login.microsoftonline.com/common/oauth2/authorize. Please continue the login in the web browser. If no web browser is available or if the web browser fails to open, use device code flow with `az login --use-device-code`.
Please ensure you have network connection. Error detail: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /common/oauth2/token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fc94e5c0130>: Failed to establish a new connection: [Errno -5] No address associated with hostname'))

Also, note that the folder name shown close to the green button in VS Code lower bar is not Azure CAF rover, but CAF Starter Terraform landing zones.

To Reproduce 1.I cloned the repo as shown in the instructions using git clone https://github.com/Azure/caf-terraform-landingzones-starter.git 2.Opened the folder in VS Code 3.Clicked the green button and selected Open folder in container... 4.Run rover login in the prompt command

Expected behavior I would expect to successfully login.

Screenshots See the text above.

Configuration (please complete the following information):

LaurentLesle commented 3 years ago

Hi @paolosalvatori we also noticed this issue with latest update of Docker Desktop on windows. See the issue here - https://github.com/Azure/caf-terraform-landingzones/issues/250

From now you have to downgrade docker desktop to 3.5.2.

paolosalvatori commented 3 years ago

Let's keep the issue open for a while just to keep track of any progress. When the bug gets fixed, and the rover works as expected with Docker DE 4.0.0 you can write here and close the issue 😃

jasonpanggit commented 2 years ago

Able to resolve it by exiting vscode. Then stopping and deleting the container in Docker Desktop (v4.01) and open vscode to let it recreate again. Able to do rover login and also logout and login again.