Open quilter-AndrewWilde opened 3 years ago
Is there any output before the line "File is not a zip file"? If so, could you add it?
The only output is The command failed with an unexpected error. Here is the traceback:
If you add --debug
to your command line, we may get more information
Before doing that, let's try clearing out any bad state by deleting %userprofile%\.azure\cli\tools\artifacttool
(%userprofile%
is very likely c:\users\<username>\
)
@jmyersmsft we get this periodically in ADO pipelines - I've added the "debug" flag, and the callstacks that we get are:
...
DEBUG: urllib3.connectionpool: https://vsblob.dev.azure.com:443 "GET /EDT/_apis/clienttools/ArtifactTool/release?osName=Windows&arch=AMD64&distroName=msys_nt-10.0-20348&distroVersion=3.3.3 HTTP/1.1" 200 440
DEBUG: azext_devops.devops_sdk.client: Response content: b'{"name":"ArtifactTool","rid":"win10-x64","version":"0.2.236","uri":"https://0psvsblobprodwus2145.vsblob.vsassets.io/artifacttool/artifacttool-win10-x64-Release_0.2.236.zip?sv=2019-07-07&sr=b&sig=BR%2FU7OyJ8htI2rV6zfWijyD6n1Bz9fiPIx9rPUhUOi0%3D&spr=https&se=2022-05-16T15%3A44%3A02Z&sp=r&P1=1652715542&P2=11&P3=2&P4=0Ge7t3LzHJnQB7u5dXytpAWhzbeRGR3GBLudh2mW3EI%3d"}'
DEBUG: cli.azext_devops.dev.common.artifacttool_updater: Checking if we already have ArtifactTool release 'ArtifactTool_win10-x64_0.2.236'
DEBUG: cli.azext_devops.dev.common.artifacttool_updater: Updating to ArtifactTool release ArtifactTool_win10-x64_0.2.236 since it doesn't exist at C:\Users\VssAdministrator\.azure\azuredevops\cli\tools\artifacttool\ArtifactTool_win10-x64_0.2.236
DEBUG: cli.azext_devops.dev.common.artifacttool_updater: Downloading ArtifactTool from https://0psvsblobprodwus2145.vsblob.vsassets.io/artifacttool/artifacttool-win10-x64-Release_0.2.236.zip?sv=2019-07-07&sr=b&sig=BR%2FU7OyJ8htI2rV6zfWijyD6n1Bz9fiPIx9rPUhUOi0%3D&spr=https&se=2022-05-16T15%3A44%3A02Z&sp=r&P1=1652715542&P2=11&P3=2&P4=0Ge7t3LzHJnQB7u5dXytpAWhzbeRGR3GBLudh2mW3EI%3d
DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): 0psvsblobprodwus2145.vsblob.vsassets.io:443
DEBUG: urllib3.connectionpool: https://0psvsblobprodwus2145.vsblob.vsassets.io:443 "GET /artifacttool/artifacttool-win10-x64-Release_0.2.236.zip?sv=2019-07-07&sr=b&sig=BR%2FU7OyJ8htI2rV6zfWijyD6n1Bz9fiPIx9rPUhUOi0%3D&spr=https&se=2022-05-16T15%3A44%3A02Z&sp=r&P1=1652715542&P2=11&P3=2&P4=0Ge7t3LzHJnQB7u5dXytpAWhzbeRGR3GBLudh2mW3EI%3D HTTP/1.1" 200 65282397
DEBUG: cli.azext_devops.dev.common.artifacttool_updater: Extracting ArtifactTool to C:\Users\VssAdministrator\.azure\azuredevops\cli\tools\artifacttool\4bff4dde-8943-4d2f-a802-ddf42372528c
DEBUG: cli.azext_devops.dev.common.exception_handler: handling generic error
DEBUG: cli.azure.cli.core.util: azure.cli.core.util.handle_exception is called with an exception:
DEBUG: cli.azure.cli.core.util: Traceback (most recent call last):
DEBUG: cli.azext_devops.dev.common.artifacttool_updater: Extracting ArtifactTool to C:\Users\VssAdministrator\.azure\azuredevops\cli\tools\artifacttool\4bff4dde-8943-4d2f-a802-ddf42372528c
DEBUG: cli.azext_devops.dev.common.exception_handler: handling generic error
DEBUG: cli.azure.cli.core.util: azure.cli.core.util.handle_exception is called with an exception:
DEBUG: cli.azure.cli.core.util: Traceback (most recent call last):
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 658, in execute
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 713, in _run_job
File "C:\Program Files\Common Files\AzureCliExtensionDirectory\azure-devops\azext_devops\dev\common\exception_handler.py", line 31, in azure_devops_exception_handler
reraise(*sys.exc_info())
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\six.py", line 703, in reraise
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 692, in _run_job
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 328, in __call__
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
File "C:\Program Files\Common Files\AzureCliExtensionDirectory\azure-devops\azext_devops\dev\artifacts\universal.py", line 98, in download_package
return artifact_tool.download_universal(organization, project, feed, name, version, path, file_filter)
File "C:\Program Files\Common Files\AzureCliExtensionDirectory\azure-devops\azext_devops\dev\common\artifacttool.py", line 42, in download_universal
return self.run_artifacttool(organization, args, "Downloading")
File "C:\Program Files\Common Files\AzureCliExtensionDirectory\azure-devops\azext_devops\dev\common\artifacttool.py", line 57, in run_artifacttool
artifacttool_dir = self._artifacttool_updater.get_latest_artifacttool(organization)
File "C:\Program Files\Common Files\AzureCliExtensionDirectory\azure-devops\azext_devops\dev\common\artifacttool_updater.py", line 43, in get_latest_artifacttool
artifacttool_binary_path = self._get_artifacttool(organization)
File "C:\Program Files\Common Files\AzureCliExtensionDirectory\azure-devops\azext_devops\dev\common\artifacttool_updater.py", line 74, in _get_artifacttool
_update_artifacttool(release_uri, release_id)
File "C:\Program Files\Common Files\AzureCliExtensionDirectory\azure-devops\azext_devops\dev\common\artifacttool_updater.py", line 114, in _update_artifacttool
f = zipfile.ZipFile(content)
File "zipfile.py", line 1267, in __init__
File "zipfile.py", line 1334, in _RealGetContents
zipfile.BadZipFile: File is not a zip file
ERROR: cli.azure.cli.core.azclierror: The command failed with an unexpected error. Here is the traceback:
ERROR: az_command_data_logger: The command failed with an unexpected error. Here is the traceback:
ERROR: cli.azure.cli.core.azclierror: File is not a zip file
Traceback (most recent call last):
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 658, in execute
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 713, in _run_job
File "C:\Program Files\Common Files\AzureCliExtensionDirectory\azure-devops\azext_devops\dev\common\exception_handler.py", line 31, in azure_devops_exception_handler
reraise(*sys.exc_info())
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\six.py", line 703, in reraise
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 692, in _run_job
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 328, in __call__
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
File "C:\Program Files\Common Files\AzureCliExtensionDirectory\azure-devops\azext_devops\dev\artifacts\universal.py", line 98, in download_package
return artifact_tool.download_universal(organization, project, feed, name, version, path, file_filter)
File "C:\Program Files\Common Files\AzureCliExtensionDirectory\azure-devops\azext_devops\dev\common\artifacttool.py", line 42, in download_universal
return self.run_artifacttool(organization, args, "Downloading")
File "C:\Program Files\Common Files\AzureCliExtensionDirectory\azure-devops\azext_devops\dev\common\artifacttool.py", line 57, in run_artifacttool
artifacttool_dir = self._artifacttool_updater.get_latest_artifacttool(organization)
File "C:\Program Files\Common Files\AzureCliExtensionDirectory\azure-devops\azext_devops\dev\common\artifacttool_updater.py", line 43, in get_latest_artifacttool
artifacttool_binary_path = self._get_artifacttool(organization)
File "C:\Program Files\Common Files\AzureCliExtensionDirectory\azure-devops\azext_devops\dev\common\artifacttool_updater.py", line 74, in _get_artifacttool
_update_artifacttool(release_uri, release_id)
File "C:\Program Files\Common Files\AzureCliExtensionDirectory\azure-devops\azext_devops\dev\common\artifacttool_updater.py", line 114, in _update_artifacttool
f = zipfile.ZipFile(content)
File "zipfile.py", line 1267, in __init__
File "zipfile.py", line 1334, in _RealGetContents
zipfile.BadZipFile: File is not a zip file
ERROR: az_command_data_logger: File is not a zip file
...
(I've truncated the initial logs since they are the same between successful & failed runs, so I doubt will be much use in debugging what's causing this)
Our pipeline uses Microsoft Hosted Agents, and the VMs that run the build should be fresh each time, so there shouldn't be any differences in the machine configuration between successful and failed runs.
Late to the party but I leave this here for anyone looking for an explanation.
We encountered the same error in our corporate environment and, in our case, we tracked down the problem to Zscaler which was blocking the request to get the ArtifactTool zip file (on the log above see the line _Downloading ArtifactTool from https://0psvsblobprodwus2145.vsblob.vsassets.io/artifacttool/artifacttool-win10-x64-Release_0.2.236.zip......_)
The
az artifacts universal download
is failing to download a universal package with error "File is not a zip file"Command Name
az artifacts universal download Extension Name: azure-devops. Version: 0.19.0.
Errors:
To Reproduce:
az artifacts universal download --organization "https://dev.azure.com/AndrewWilde0938/" --project "5863fe84-1344-4d79-b86a-ab4e41f3a8bc" --scope project --feed "uni" --name "blah" --version "0.0.6" --path .
Expected Behavior
Succesfully downloads artifact
Environment Summary
Additional Context