question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Error on artifacts publish: "Failed to hash a page of files. Exception listed below"

See original GitHub issue

Describe the bug When I try to upload a file to Azure Artifacts Universal feed, I receive the error “Failed to hash a page of files. Exception listed below”. No exception is listed below.

To Reproduce Azure Cli Version: 2.0.70

Azure-Devops extension version: 0.12.0

Steps to reproduce the behavior:

  1. login using az devops login --organization <org> + input Personal Access Token
  2. execute command az artifacts universal publish --organization "<org>" --feed "Installers" --name "txt.tmp" --version "0.0.1" --description "Test upload" --path .\txt.tmp
  3. See error Failed to hash a page of files. Exception listed below...

Expected behavior The file is uploaded to the feed. Or a clear error telling why it failed.

Debug logs

PS C:\Users\Developer\Documents\RAM> az artifacts universal publish --organization "https://dev.azure.com/my-org" -
-feed "Installers" --name "txt.tmp" --version "0.0.1" --description "Test upload" --path .\txt.tmp --debug
Command arguments: ['artifacts', 'universal', 'publish', '--organization', 'https://dev.azure.com/my-org', '--feed', 'Installers', '--name', 'txt.tmp', '--version', '0.0.1', '--description', 'Test upload', '--path', '.\\txt.tmp', '--debug']
Event: Cli.PreExecute []
Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x036D8078>, <function OutputProducer.on_global_arguments at 0x0359EC90>, <function CLIQuery.on_global_arguments at 0x035C1D68>]
Event: CommandInvoker.OnPreCommandTableCreate []
Installed command modules ['acr', 'acs', 'advisor', 'ams', 'appconfig', 'appservice', 'backup', 'batch', 'batchai', 'billing', 'botservice', 'cdn', 'cloud', 'cognitiveservices', 'configure', 'consumption', 'container', 'cosmosdb', 'deploymentmanager', 'dla', 'dls', 'dms', 'eventgrid', 'eventhubs', 'extension', 'feedback', 'find', 'hdinsight', 'interactive', 'iot', 'iotcentral', 'keyvault', 'kusto', 'lab', 'managedservices', 'maps', 'monitor', 'natgateway', 'netappfiles', 'network', 'policyinsights', 'privatedns', 'profile', 'rdbms', 'redis', 'relay', 'reservations', 'resource', 'role', 'search', 'security', 'servicebus', 'servicefabric', 'signalr', 'sql', 'sqlvm', 'storage', 'vm']
Loaded module 'acr' in 0.005 seconds.
Loaded module 'acs' in 0.007 seconds.
Loaded module 'advisor' in 0.002 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'ams' in 0.006 seconds.
Loaded module 'appconfig' in 0.003 seconds.
Loaded module 'appservice' in 0.008 seconds.
Loaded module 'backup' in 0.003 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'batch' in 0.009 seconds.
Loaded module 'batchai' in 0.003 seconds.
Loaded module 'billing' in 0.002 seconds.
Loaded module 'botservice' in 0.004 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'cdn' in 0.003 seconds.
Loaded module 'cloud' in 0.002 seconds.
Loaded module 'cognitiveservices' in 0.002 seconds.
Loaded module 'configure' in 0.001 seconds.
Loaded module 'consumption' in 0.003 seconds.
Loaded module 'container' in 0.002 seconds.
Loaded module 'cosmosdb' in 0.004 seconds.
Loaded module 'deploymentmanager' in 0.003 seconds.
Loaded module 'dla' in 0.005 seconds.
Loaded module 'dls' in 0.003 seconds.
Loaded module 'dms' in 0.005 seconds.
Loaded module 'eventgrid' in 0.003 seconds.
Loaded module 'eventhubs' in 0.004 seconds.
Loaded module 'extension' in 0.001 seconds.
Loaded module 'feedback' in 0.001 seconds.
Loaded module 'find' in 0.003 seconds.
Loaded module 'hdinsight' in 0.003 seconds.
Loaded module 'interactive' in 0.001 seconds.
Loaded module 'iot' in 0.004 seconds.
Loaded module 'iotcentral' in 0.002 seconds.
Loaded module 'keyvault' in 0.006 seconds.
Loaded module 'kusto' in 0.002 seconds.
Loaded module 'lab' in 0.004 seconds.
Loaded module 'managedservices' in 0.002 seconds.
Loaded module 'maps' in 0.002 seconds.
Loaded module 'monitor' in 0.005 seconds.
Loaded module 'natgateway' in 0.002 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'netappfiles' in 0.004 seconds.
Loaded module 'network' in 0.026 seconds.
Loaded module 'policyinsights' in 0.003 seconds.
Loaded module 'privatedns' in 0.005 seconds.
Loaded module 'profile' in 0.002 seconds.
Loaded module 'rdbms' in 0.006 seconds.
Loaded module 'redis' in 0.002 seconds.
Loaded module 'relay' in 0.003 seconds.
Loaded module 'reservations' in 0.003 seconds.
Loaded module 'resource' in 0.007 seconds.
Loaded module 'role' in 0.004 seconds.
Loaded module 'search' in 0.002 seconds.
Loaded module 'security' in 0.003 seconds.
Loaded module 'servicebus' in 0.005 seconds.
Loaded module 'servicefabric' in 0.002 seconds.
Loaded module 'signalr' in 0.002 seconds.
Loaded module 'sql' in 0.007 seconds.
Loaded module 'sqlvm' in 0.003 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'storage' in 0.040 seconds.
Loaded module 'vm' in 0.014 seconds.
Loaded all modules in 0.271 seconds. (note: there's always an overhead with the first module loaded)
Extensions directory: 'C:\Users\Developer\.azure\cliextensions'
Found 1 extensions: ['azure-devops']
Extensions directory: 'C:\Users\Developer\.azure\cliextensions'
Extension compatibility result: is_compatible=True cli_core_version=2.0.70 min_required=2.0.49 max_required=None
Extensions directory: 'C:\Users\Developer\.azure\cliextensions'
Loaded extension 'azure-devops' in 0.031 seconds.
Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x03761348>]
az_command_data_logger : command args: artifacts universal publish --organization {} --feed {} --name {} --version {} --description {} --path {} --debug
metadata file logging enabled - writing logs to 'C:\Users\Developer\.azure\commands'.
Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x03775930>]
Event: CommandInvoker.OnPostArgumentLoad []
Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x03717B70>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x03717C48>]
Event: CommandInvoker.OnCommandTableLoaded []
Event: CommandInvoker.OnPreParseArgs [<function _documentdb_deprecate at 0x04780078>]
Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x0359ECD8>, <function CLIQuery.handle_query_parameter at 0x035C1DB0>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x03717C00>, <function handler at 0x0482FFA8>, <function DevCommandsLoader.post_parse_args at 0x04D37A08>]
Extensions directory: 'C:\Users\Developer\.azure\cliextensions'
Extensions directory: 'C:\Users\Developer\.azure\cliextensions'
az_command_data_logger : extension name: azure-devops
az_command_data_logger : extension version: 0.12.0
Checking for a new ArtifactTool
Checking for ArtifactTool updates
Getting credential: azdevops-cli:https://dev.azure.com/my-org
keyring.backend : Loading KWallet
keyring.backend : Loading SecretService
keyring.backend : Loading Windows
keyring.backend : Loading chainer
keyring.backend : Loading macOS
Keyring backend : keyring.backends.Windows.WinVaultKeyring (priority: 5)
PAT is present which can be used against this instance
Current cloud config:
AzureCloud
az login is not present
There are no active accounts.
Traceback (most recent call last):
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-rtk110ve\azure-cli-core\azure\cli\core\_profile.py", line 475, in get_current_account_user
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-rtk110ve\azure-cli-core\azure\cli\core\_profile.py", line 484, in get_subscription
knack.util.CLIError: Please run 'az login' to setup account.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Developer\.azure\cliextensions\azure-devops\azext_devops\dev\common\services.py", line 61, in _get_credentials
    token_from_az_login = get_token_from_az_logins(organization, pat_token_present)
  File "C:\Users\Developer\.azure\cliextensions\azure-devops\azext_devops\dev\common\services.py", line 118, in get_token_from_az_logins
    dummy_user = profile.get_current_account_user()     # noqa: F841
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-rtk110ve\azure-cli-core\azure\cli\core\_profile.py", line 477, in get_current_account_user
knack.util.CLIError: There are no active accounts.
Getting credential: azdevops-cli:https://dev.azure.com/my-org
Keyring backend : keyring.backends.Windows.WinVaultKeyring (priority: 5)
Creating connection with personal access token.
msrest.universal_http.requests : Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
Current cloud config:
AzureCloud
Azure devops telemetry enabled.
Logging telemetry to azure devops server.
msrest.universal_http.requests : Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.devops_sdk._file_cache : Loading cache file: C:\Users\Developer\.azure-devops\python-sdk\cache\options.json
azext_devops.devops_sdk._file_cache : attempting to read file C:\Users\Developer\.azure-devops\python-sdk\cache\options.json as utf-8-sig
azext_devops.devops_sdk.client : File cache hit for options on: https://dev.azure.com/my-org
msrest.universal_http.requests : Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.devops_sdk._file_cache : Loading cache file: C:\Users\Developer\.azure-devops\python-sdk\cache\resources.json
azext_devops.devops_sdk.client : Route template: _apis/{area}/{resource}
azext_devops.devops_sdk._file_cache : attempting to read file C:\Users\Developer\.azure-devops\python-sdk\cache\resources.json as utf-8-sig
azext_devops.devops_sdk.client : Api version '5.0-preview.1'
azext_devops.devops_sdk.connection : File cache hit for resources on: https://dev.azure.com/my-org
azext_devops.devops_sdk.client : POST https://dev.azure.com/my-org/_apis/CustomerIntelligence/Events
msrest.universal_http.requests : Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
Looking up current version of ArtifactTool...azext_devops.devops_sdk.client : Request content: [{'area': 'AzureDevopsCli', 'feature': 'artifacts', 'properties': {'Command': 'universal publish', 'Args': 'feed name version path description organization', 'ShellType': 'cmd', 'IsInteractive': 'True', 'OutputType': 'json', 'OrgPresentInCommand': True, 'ProjectPresentInCommand': False, 'RepoPresentInCommand': False}}]

msrest.universal_http : Configuring redirects: allow=True, max=30
msrest.universal_http : Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http : Configuring proxies: ''
msrest.universal_http : Evaluate proxies against ENV settings: True
urllib3.connectionpool : Starting new HTTPS connection (1): dev.azure.com:443
azext_devops.devops_sdk.client : File cache hit for options on: https://my-org.vsblob.visualstudio.com
azext_devops.devops_sdk.client : Route template: _apis/{area}/{toolName}/{resource}
azext_devops.devops_sdk.client : Api version '5.0-preview'
azext_devops.devops_sdk.client : GET https://my-org.vsblob.visualstudio.com/_apis/clienttools/ArtifactTool/release?osName=Windows&arch=AMD64
azext_devops.devops_sdk.client : Request content: None
msrest.universal_http : Configuring redirects: allow=True, max=30
msrest.universal_http : Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http : Configuring proxies: ''
msrest.universal_http : Evaluate proxies against ENV settings: True
urllib3.connectionpool : Starting new HTTPS connection (1): my-org.vsblob.visualstudio.com:443
urllib3.connectionpool : https://dev.azure.com:443 "POST /my-org/_apis/CustomerIntelligence/Events HTTP/1.1" 204 0
urllib3.connectionpool : https://my-org.vsblob.visualstudio.com:443 "GET /_apis/clienttools/ArtifactTool/release?osName=Windows&arch=AMD64 HTTP/1.1" 200 446
azext_devops.devops_sdk.client : Response content: b'{"name":"ArtifactTool","rid":"win10-x64","version":"0.2.101","uri":"https://004vsblobprodeus2116.vsblob.vsassets.io/artifacttool/artifacttool-win10-x64-Release_0.2.101.zip?sv=2017-04-17&sr=b&sig=8PDCRKjMOGBLNf6hGl1f5ppTV7XW9x3ugHO3oKueT0I%3D&spr=https&se=2019-08-08T12%3A09%3A33Z&sp=r&P1=1565265873&P2=11&P3=2&P4=ysDP%2fH%2byNNqYiitktwoQGwnKkAHgcfm2gyneDKcwE%2bE%3d"}'
Checking if we already have ArtifactTool release 'ArtifactTool_win10-x64_0.2.101'
Not updating ArtifactTool because the current release already exists at 'C:\Users\Developer\.azure\azuredevops\cli\tools\artifacttool\ArtifactTool_win10-x64_0.2.101'
Getting credential: azdevops-cli:https://dev.azure.com/my-org
Keyring backend : keyring.backends.Windows.WinVaultKeyring (priority: 5)
PAT is present which can be used against this instance
Current cloud config:
AzureCloud
az login is not present
There are no active accounts.
Traceback (most recent call last):
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-rtk110ve\azure-cli-core\azure\cli\core\_profile.py", line 475, in get_current_account_user
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-rtk110ve\azure-cli-core\azure\cli\core\_profile.py", line 484, in get_subscription
knack.util.CLIError: Please run 'az login' to setup account.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Developer\.azure\cliextensions\azure-devops\azext_devops\dev\common\services.py", line 61, in _get_credentials
    token_from_az_login = get_token_from_az_logins(organization, pat_token_present)
  File "C:\Users\Developer\.azure\cliextensions\azure-devops\azext_devops\dev\common\services.py", line 118, in get_token_from_az_logins
    dummy_user = profile.get_current_account_user()     # noqa: F841
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-rtk110ve\azure-cli-core\azure\cli\core\_profile.py", line 477, in get_current_account_user
knack.util.CLIError: There are no active accounts.
Getting credential: azdevops-cli:https://dev.azure.com/my-org
Keyring backend : keyring.backends.Windows.WinVaultKeyring (priority: 5)
Creating connection with personal access token.
Running external command: C:\Users\Developer\.azure\azuredevops\cli\tools\artifacttool\ArtifactTool_win10-x64_0.2.101\artifacttool universal publish --service https://dev.azure.com/my-org --patvar AZURE_DEVOPS_EXT_ARTIFACTTOOL_PATVAR --feed Installers --package-name txt.tmp --package-version 0.0.1 --path .\txt.tmp --description Test upload
Ensuring that the package does not yet exist...
Package does not yet exist
Pushing content...
DedupManifestArtifactClient will correlate http requests with X-TFS-Session c82582ed-9262-4c33-9cf7-0906842ca9fd
1 files to be processed in 1 groups.
handling generic error
cli.azure.cli.core.util : Failed to hash a page of files. Exception listed below...
Failed to hash a page of files. Exception listed below...
az_command_data_logger : exit code: 1
Suppress exception There are no active accounts.
Suppress exception Please run 'az login' to setup account.
telemetry.save : Save telemetry record of length 2434 in cache
telemetry.check : Returns Positive.
telemetry.main : Begin creating telemetry upload process.
telemetry.process : Creating upload process: "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\telemetry\__init__.pyc C:\Users\Developer\.azure"
telemetry.process : Return from creating process
telemetry.main : Finish creating telemetry upload process.
command ran in 5.353 seconds.
PS C:\Users\Developer\Documents\RAM>

Additional context The feed I tried to push to is currently empty.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:22

github_iconTop GitHub Comments

6reactions
jontreynescommented, Jun 8, 2020

so figured out one thing…

When you publish a zip file, put the zip file in a folder with just the zip file

Then use “–path .” and it will upload the zip file as that’s the only piece that exists in the folder. When you download artifact, you’ll download the zip.

–path needs to receive a “DIRECTORY”, not a full path https://docs.microsoft.com/en-us/cli/azure/ext/azure-devops/artifacts/universal?view=azure-cli-latest#ext-azure-devops-az-artifacts-universal-download

4reactions
sorviscommented, Jan 7, 2020

Similar to lp-code my issue I later resolved by using a directory. At first I had tried referencing a file directly which caused the error for me. I think that should be considered a bug that it cannot take a file directly without producing a logical error message.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure CLI generic error while publishing artifact
I'm trying to upload an artifact through azure CLI and getting an error, : ... Exception listed below... Failed to hash a page...
Read more >
Publish and download pipeline Artifacts - Azure
In this article ... Using Azure Pipelines, you can download artifacts from earlier stages in your pipeline or from another pipeline. You can...
Read more >
Jenkins Artifactory Plug-in - JFrog
This integration allows your build jobs to deploy artifacts and resolve ... The supported statuses are SUCCESS, UNSTABLE, FAILURE, NOT_BUILT or ABORTED.
Read more >
Bug listing with status RESOLVED with resolution OBSOLETE ...
systemPrefs with at least two files" status:RESOLVED resolution:OBSOLETE severity:normal ... Bug:54727 - "gentoo-stats --update fails with error message" ...
Read more >
Troubleshooting Omnibus GitLab installation issues
If you see this error, it generally means you do not have the public keys currently used to sign repository metadata in your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found