Azure-devops-cli-extension: [Bug] ArtifactTool fails when version contains plus symbol

Created on 11 Apr 2019  路  7Comments  路  Source: Azure/azure-devops-cli-extension

Describe the bug
When trying to publish a universal package using a version number with a plus symbol (+) the following error is received:

An error occurred on the service. Not Found

To Reproduce
Azure Cli Version:
azure-cli (2.0.54)

Azure-Devops extension version:
Use az --version
Look for something like-
Extensions:
azure-devops (0.4.0)

Steps to reproduce the behavior:

  1. login using az login
  2. Run command to publish package - e.g. az artifacts universal publish --feed SampleFeed --name 'samples-webapp' --version '1.0.0+ffbcbfdc7f' --description "My package" --path . --debug
  3. See error An error occurred on the service. Not Found

Expected behavior
Universal package created and published.

Screenshots
NA

Debug logs

Command arguments: ['artifacts', 'universal', 'publish', '--feed', 'SampleFeed', '--name', 'samples-webapp', '--version', '1.0.0+ffbcbfdc7f', '--description', 'foo', '--path', '.', '--debug']
Event: Cli.PreExecute []
Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x10cdddb70>, <function OutputProducer.on_global_arguments at 0x10ceb10d0>, <function CLIQuery.on_global_arguments at 0x10cece730>]
Event: CommandInvoker.OnPreCommandTableCreate []
Installed command modules ['acr', 'acs', 'advisor', 'ams', 'appservice', 'backup', 'batch', 'batchai', 'billing', 'botservice', 'cdn', 'cloud', 'cognitiveservices', 'configure', 'consumption', 'container', 'cosmosdb', 'dla', 'dls', 'dms', 'eventgrid', 'eventhubs', 'extension', 'feedback', 'find', 'hdinsight', 'interactive', 'iot', 'iotcentral', 'keyvault', 'lab', 'maps', 'monitor', 'network', 'policyinsights', 'profile', 'rdbms', 'redis', 'relay', 'reservations', 'resource', 'role', 'search', 'servicebus', 'servicefabric', 'signalr', 'sql', 'storage', 'vm']
Loaded module 'acr' in 0.005 seconds.
Loaded module 'acs' in 0.003 seconds.
Loaded module 'advisor' in 0.001 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'ams' in 0.005 seconds.
Loaded module 'appservice' in 0.005 seconds.
Loaded module 'backup' in 0.003 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'batch' in 0.008 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.002 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.003 seconds.
Loaded module 'dla' in 0.003 seconds.
Loaded module 'dls' in 0.003 seconds.
Loaded module 'dms' in 0.002 seconds.
Loaded module 'eventgrid' in 0.002 seconds.
Loaded module 'eventhubs' in 0.010 seconds.
Loaded module 'extension' in 0.001 seconds.
Loaded module 'feedback' in 0.001 seconds.
Loaded module 'find' in 0.001 seconds.
Loaded module 'hdinsight' in 0.001 seconds.
Loaded module 'interactive' in 0.000 seconds.
Loaded module 'iot' in 0.004 seconds.
Loaded module 'iotcentral' in 0.001 seconds.
Loaded module 'keyvault' in 0.005 seconds.
Loaded module 'lab' in 0.004 seconds.
Loaded module 'maps' in 0.002 seconds.
Loaded module 'monitor' in 0.005 seconds.
Loaded module 'network' in 0.024 seconds.
Loaded module 'policyinsights' in 0.002 seconds.
Loaded module 'profile' in 0.001 seconds.
Loaded module 'rdbms' in 0.005 seconds.
Loaded module 'redis' in 0.002 seconds.
Loaded module 'relay' in 0.003 seconds.
Loaded module 'reservations' in 0.002 seconds.
Loaded module 'resource' in 0.006 seconds.
Loaded module 'role' in 0.003 seconds.
Loaded module 'search' in 0.001 seconds.
Loaded module 'servicebus' in 0.003 seconds.
Loaded module 'servicefabric' in 0.002 seconds.
Loaded module 'signalr' in 0.002 seconds.
Loaded module 'sql' in 0.005 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'storage' in 0.024 seconds.
Loaded module 'vm' in 0.012 seconds.
Loaded all modules in 0.194 seconds. (note: there's always an overhead with the first module loaded)
Extensions directory: '/Users/ducas/.azure/cliextensions'
Found 2 extensions: ['azure-devops', 'aks-virtual-node']
Extensions directory: '/Users/ducas/.azure/cliextensions'
Loaded extension 'azure-devops' in 0.036 seconds.
Extensions directory: '/Users/ducas/.azure/cliextensions'
Loaded extension 'aks-virtual-node' in 0.127 seconds.
Event: CommandInvoker.OnPreCommandTableTruncate []
Event: CommandInvoker.OnPostCommandTableCreate [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x10d1f9158>, <function register_ids_argument.<locals>.add_ids_arguments at 0x10d23ef28>]
Event: CommandInvoker.OnCommandTableLoaded []
Event: CommandInvoker.OnPreParseArgs [<function _documentdb_deprecate at 0x10e3db158>]
Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x10ceb1158>, <function CLIQuery.handle_query_parameter at 0x10cece7b8>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x10d24f048>, <function handler at 0x10e4c4ae8>, <function DevCommandsLoader.post_parse_args at 0x10edc7f28>]
Extensions directory: '/Users/ducas/.azure/cliextensions'
Extensions directory: '/Users/ducas/.azure/cliextensions'
Universal Packages is currently in preview.
Remote url: https://[INSTANCE]/[PROJECT]/_git/samples-webapp
azext_devops.vstsCompressed._file_cache : Loading cache file: /Users/ducas/.azure/azuredevops/cache/remotes.json
azext_devops.vstsCompressed._file_cache : attempting to read file /Users/ducas/.azure/azuredevops/cache/remotes.json as utf-8-sig
Detect: Url discovery took 0:00:00.008222
Checking for a new ArtifactTool
Checking for ArtifactTool updates
Getting credential: azdevops-cli:https://[INSTANCE]
keyring.backend : Loading KWallet
keyring.backend : Loading SecretService
keyring.backend : Loading Windows
keyring.backend : Loading chainer
keyring.backend : Loading macOS
Keyring backend : keyring.backends.OS_X.Keyring (priority: 5)
Getting credential: azdevops-cli: default
Keyring backend : keyring.backends.OS_X.Keyring (priority: 5)
Current cloud config:
AzureCloud
trying to get token (temp) for tenant [TENANT_ID] and user [USER_ID]
attempting to read file /Users/ducas/.e3dd0021-b17a-4204-91f2-156d68341ae8azure/accessTokens.json as utf-8-sig
adal-python :  - Authority:Performing instance discovery: ...
adal-python : [SOME_GUID] - Authority:Performing static instance discovery
adal-python : [SOME_GUID] - Authority:Authority validated via static instance discovery
adal-python : [SOME_GUID] - TokenRequest:Getting token from cache with refresh if necessary.
adal-python : [SOME_GUID] - CacheDriver:finding with query keys: {'_clientId': '...', 'userId': '...'}
adal-python : [SOME_GUID] - CacheDriver:Looking for potential cache entries: {'_clientId': '...', 'userId': '...'}
adal-python : [SOME_GUID] - CacheDriver:Found 7 potential entries.
adal-python : [SOME_GUID] - CacheDriver:Resource specific token found.
adal-python : [SOME_GUID] - CacheDriver:Returning token from cache lookup, AccessTokenId: b'[AccessTokenId]', RefreshTokenId: b'[RefreshTokenId]'
msrest.universal_http.requests : Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
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
msrest.universal_http.requests : Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.vstsCompressed._file_cache : Loading cache file: /Users/ducas/.vsts/python-sdk/cache/options.json
azext_devops.vstsCompressed._file_cache : attempting to read file /Users/ducas/.vsts/python-sdk/cache/options.json as utf-8-sig
azext_devops.vstsCompressed.vss_client : File cache hit for options on: https://[INSTANCE]
msrest.universal_http.requests : Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
msrest.universal_http.requests : Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.vstsCompressed.vss_client : Route template: _apis/{area}/{resource}
azext_devops.vstsCompressed._file_cache : Loading cache file: /Users/ducas/.vsts/python-sdk/cache/resources.json
azext_devops.vstsCompressed.vss_client : Api version '4.0-preview.1'
azext_devops.vstsCompressed.vss_client : POST https://[INSTANCE]/_apis/CustomerIntelligence/Events
azext_devops.vstsCompressed.vss_client : Request content: [{'area': 'AzureDevopsCli', 'feature': 'artifacts', 'properties': {'Command': 'universal publish', 'Args': [], 'ShellType': '/bin/zsh'}}]
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
azext_devops.vstsCompressed._file_cache : attempting to read file /Users/ducas/.vsts/python-sdk/cache/resources.json as utf-8-sig
azext_devops.vstsCompressed.vss_connection : File cache hit for resources on: https://[INSTANCE]
msrest.universal_http.requests : Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
msrest.universal_http.requests : Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
Looking up current version of ArtifactTool...
urllib3.connectionpool : Starting new HTTPS connection (1): [INSTANCE]:443
azext_devops.vstsCompressed.vss_client : File cache hit for options on: https://[VSBLOB_URL]
azext_devops.vstsCompressed.vss_client : Route template: _apis/{area}/{toolName}/{resource}
azext_devops.vstsCompressed.vss_client : Api version '5.0-preview'
azext_devops.vstsCompressed.vss_client : GET https://[VSBLOB_URL]/_apis/clienttools/ArtifactTool/release?osName=Darwin&arch=x86_64&distroName=darwin&distroVersion=18.5.0
azext_devops.vstsCompressed.vss_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): [VSBLOB_URL]:443
urllib3.connectionpool : https://[INSTANCE]:443 "POST /_apis/CustomerIntelligence/Events HTTP/1.1" 204 0
azext_devops.vstsCompressed.vss_client : Response content: b''
urllib3.connectionpool : https://[VSBLOB_URL]:443 "GET /_apis/clienttools/ArtifactTool/release?osName=Darwin&arch=x86_64&distroName=darwin&distroVersion=18.5.0 HTTP/1.1" 200 358
azext_devops.vstsCompressed.vss_client : Response content: b'{"name":"ArtifactTool","rid":"osx-x64","version":"0.2.99","uri":"https://044vsblobprodeau135.vsblob.vsassets.io/artifacttool/artifacttool-osx-x64-Release_0.2.99.zip?sv=2017-04-17&sr=b&sig=05PyJmXeJq2oE1HLxA%2FnYHbwWS76ok%2FBK3TkRFPcR8I%3D&spr=https&se=2019-04-12T06%3A00%3A00Z&sp=r&P1=1555048500&P2=11&P3=2&P4=GiBFz07Ucr7GCjTSCncncjcNssl05pbDrYGsFPHPxtU%3d"}'
Checking if we already have ArtifactTool release 'ArtifactTool_osx-x64_0.2.99'
Not updating ArtifactTool because the current release already exists at '/Users/ducas/.azure/azuredevops/cli/tools/artifacttool/ArtifactTool_osx-x64_0.2.99'
Getting credential: azdevops-cli:https://[INSTANCE]
Keyring backend : keyring.backends.OS_X.Keyring (priority: 5)
Getting credential: azdevops-cli: default
Keyring backend : keyring.backends.OS_X.Keyring (priority: 5)
Current cloud config:
AzureCloud
trying to get token (temp) for tenant [TENANT_ID] and user [USER_ID]
adal-python : [SOME_GUID] - Authority:Performing instance discovery: ...
adal-python : [SOME_GUID] - Authority:Performing static instance discovery
adal-python : [SOME_GUID] - Authority:Authority validated via static instance discovery
adal-python : [SOME_GUID] - TokenRequest:Getting token from cache with refresh if necessary.
adal-python : [SOME_GUID] - CacheDriver:finding with query keys: {'_clientId': '...', 'userId': '...'}
adal-python : [SOME_GUID] - CacheDriver:Looking for potential cache entries: {'_clientId': '...', 'userId': '...'}
adal-python : [SOME_GUID] - CacheDriver:Found 7 potential entries.
adal-python : [SOME_GUID] - CacheDriver:Resource specific token found.
adal-python : [SOME_GUID] - CacheDriver:Returning token from cache lookup, AccessTokenId: b'[AccessTokenId', RefreshTokenId: b'[RefreshTokenId\'
Running external command: /Users/ducas/.azure/azuredevops/cli/tools/artifacttool/ArtifactTool_osx-x64_0.2.99/artifacttool universal publish --service https://[INSTANCE] --patvar AZURE_DEVOPS_EXT_ARTIFACTTOOL_PATVAR --feed SampleFeed --package-name samples-webapp --package-version 1.0.0+ffbcbfdc7f --path . --description foo
Ensuring that the package does not yet exist...
handling generic error
An error occurred on the service. Not Found
telemetry.save : Save telemetry record of length 2661 in cache
telemetry.check : Negative: The /Users/ducas/.azure/telemetry.txt was modified at 2019-04-11 15:03:02.854481, which in less than 600.000000 s

Additional context
As soon as you replace + with - everything works!

bug Packages

Most helpful comment

Hi @zarenner.

Thanks for the explanation. Completely understand the issues around version ordering. Would be great to see the correct message coming through.

Cheers!

All 7 comments

cc: @mitchdenny @zarenner .
Please take a look

Hi,

Sorry for the delay. The error occurs because Universal Packages with versions including the "+" character are not supported. Unfortunately, it looks like the online docs don't indicate this limitation in versioning. To clarify fully: package versions can use only letters, numbers, and dashes (-).

If you have any questions, concerns or would like to follow up on this, please feel free to reach out to us. We'll also be fixing up the online documentation to better reflect this versioning limitation.

Hi @apluche.

Thanks for confirming the issue. I believe that it should be supported though as the messaging states that the version number should be SemVer 2.0 compliant and the standard does support + characters.

If you look at tools like GitVersion (https://github.com/GitTools/GitVersion) they generate version numbers with + characters because it is part of the standard.

Hi @ducas,

As @apluche mentioned, the docs here are unfortunately incorrect. Universal Packages currently supports lowercase SemVer v2 _except_ for build metadata. We intentionally decided to exclude support for build metadata in the initial release of Universal Packages, as build metadata introduces complications around version ordering and equivalency. For example, since the SemVer spec says that build metadata has no impact on precedence, it would complicate potential features like obtaining the "newest" version of a package.

That said, there appears to also be another bug here which is causing the wrong error to be emitted. The correct error you should be seeing is: The package version provided is invalid. Universal package versions must be lowercase SemVer 2.0 versions without build metadata. The package version must be under 128 characters, and major/minor/patch must each be less than or equal to 2147483647.

We'll be fixing the documentation and this incorrect error message. I'm also personally very interested to hear how you intended to use build metadata. Again, we decided to initially exclude build metadata (and uppercase pre-release tags), but as we continue to develop Universal Packages we're interested in hearing where we can improve, and if there are common use cases for build metadata that aren't easily solved in other ways.

Hi @zarenner.

Thanks for the explanation. Completely understand the issues around version ordering. Would be great to see the correct message coming through.

Cheers!

Docs update: https://github.com/MicrosoftDocs/vsts-docs/pull/4339

Unfortunately, I don't think that updating the error response code/message will be easily possible at this time due to technical limitations in our web stack around + signs.

I'm going to go ahead and close this - with the docs updated and changing the error response code/message being non-trivial, I don't think think the time spent would be worth the value added.

Was this page helpful?
0 / 5 - 0 ratings