microsoft/azure-pipelines-ephemeral-agents

Error During Container Instance Creation

juteasl opened this issue · 4 comments

Receiving this error during CI creation in the Ephemeral agent step:

2020-10-07T16:42:41.3143033Z ##[error]Error Code: [1]
2020-10-07T16:42:41.3169513Z ##[debug]Processed: ##vso[task.issue type=error;]Error Code: [1]
2020-10-07T16:42:41.3171321Z ##[error]Error: Couldn't create Azure Container Instance
2020-10-07T16:42:41.3172481Z ##[debug]Processed: ##vso[task.issue type=error;]Error: Couldn't create Azure Container Instance
2020-10-07T16:42:41.3173219Z ##[debug]task result: Failed
2020-10-07T16:42:41.3181300Z ##[error]Script failed with error: UnexpectedError: The command failed with an unexpected error. Here is the traceback:
No module named 'azure.mgmt.network.v2018_08_01'
Traceback (most recent call last):
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-tuw8_17y\knack\cli.py", line 215, in invoke
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-v8nptj_b\azure\cli\core\commands\__init__.py", line 654, in execute
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-v8nptj_b\azure\cli\core\commands\__init__.py", line 718, in _run_jobs_serially
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-v8nptj_b\azure\cli\core\commands\__init__.py", line 711, in _run_job
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-cpn0gwyu\six.py", line 703, in reraise
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-v8nptj_b\azure\cli\core\commands\__init__.py", line 688, in _run_job
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-v8nptj_b\azure\cli\core\commands\__init__.py", line 325, in __call__
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-v8nptj_b\azure\cli\core\__init__.py", line 784, in default_command_handler
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-s56abhv8\azure\cli\command_modules\container\custom.py", line 190, in create_container
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-s56abhv8\azure\cli\command_modules\container\custom.py", line 286, in _get_vnet_network_profile
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-v0h_67b1\azure\mgmt\network\_network_management_client.py", line 5336, in subnets
ModuleNotFoundError: No module named 'azure.mgmt.network.v2018_08_01'
To open an issue, please run: 'az feedback'

Pipeline consists of two agents:
image

I have tried using values in each filed and variables in each field, the same error is the result.

May be related to these two issues with the Azure CLI.

Azure/azure-cli#15391
Azure/azure-cli#15431

@juteasl What's the agent specification for Provision Ephemeral Agent Job? I have switched the agent to VS2017-win2016 and it seems to work. It also works on ubuntu-20.04

Thank you! That is what it was.

OK, so this is bizarre... It worked ONCE after changing it to VS2017-win2016 and running the pipeline. It then failed on the next run with this same message again:

2020-10-15T16:09:57.9703291Z ##[error]Script failed with error: UnexpectedError: The command failed with an unexpected error. Here is the traceback: No module named 'azure.mgmt.network.v2018_08_01' Traceback (most recent call last): File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-tuw8_17y\knack\cli.py", line 215, in invoke File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-v8nptj_b\azure\cli\core\commands\__init__.py", line 654, in execute File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-v8nptj_b\azure\cli\core\commands\__init__.py", line 718, in _run_jobs_serially File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-v8nptj_b\azure\cli\core\commands\__init__.py", line 711, in _run_job File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-cpn0gwyu\six.py", line 703, in reraise File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-v8nptj_b\azure\cli\core\commands\__init__.py", line 688, in _run_job File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-v8nptj_b\azure\cli\core\commands\__init__.py", line 325, in __call__ File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-v8nptj_b\azure\cli\core\__init__.py", line 784, in default_command_handler File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-s56abhv8\azure\cli\command_modules\container\custom.py", line 190, in create_container File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-s56abhv8\azure\cli\command_modules\container\custom.py", line 286, in _get_vnet_network_profile File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-unpacked-wheel-v0h_67b1\azure\mgmt\network\_network_management_client.py", line 5336, in subnets ModuleNotFoundError: No module named 'azure.mgmt.network.v2018_08_01' To open an issue, please run: 'az feedback'

Edit:

I'm not sure what was happening or why it worked once with VS2017-win2016, but I switched it to 20.04 and it is working as I expected and hoped!! I will go ahead and close this issue, but leave the information for others to reference.