VSTS - Error: ValueError: API resource location XXX is not registered on https://mytfs.com/tfs/Prd_Development
Microsoft Visual Studio Team Foundation Server Version 15.112.26307.0 vsts-cli-0.1.3
vsts login --token mytokenblablablabla --instance https://mytfs.com/tfs/Prd_Development
vsts work item create --title "Test bug title" --type Bug --assigned-to MyUserTFS --description "Test bug description" --instance https://mytfs.com/tfs/ --project Develop --debug
I am getting the error: ValueError: API resource location e81700f7-3be2-46de-8624-2eb35882fcaa is not registered on https://MyTfs.com/tfs.
Log:
Command arguments: ['work', 'item', 'create', '--title', 'Test bug title', '--type', 'Bug', '--assigned-to', 'MyUserTFS', '--description', 'Test bug description', '--instance', 'https://MyTfs.com/tfs/', '--project', 'Develop', '--debug'] Event: Cli.PreExecute [] Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x038D9E40>, <function OutputProducer.on_global_arguments at 0x03745A08>, <function CLIQuery.on_global_arguments at 0x038343D8>] Event: CommandInvoker.OnPreCommandTableCreate [<function CLILogging.remove_logger_flags at 0x038D9E88>] Event: CommandLoader.OnLoadCommandTable [] Event: CommandLoader.OnLoadArguments [] Event: CommandInvoker.OnPostCommandTableCreate [] Event: CommandInvoker.OnCommandTableLoaded [] Event: CommandInvoker.OnPreParseArgs [] Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x03745A50>, <function CLIQuery.handle_query_parameter at 0x03834420>, <function VstsCLI.post_parse_args at 0x04140348>] Getting credential: vsts-cli:https://MyTfs.com Creating connection with personal access token. Telemetry enabled. vsts._file_cache : Loading cache file: C:\Users\MyUserTFS.vsts\python-sdk\cache\options.json vsts._file_cache : attempting to read file C:\Users\MyUserTFS.vsts\python-sdk\cache\options.json as utf-8-sig vsts.vss_client : File cache hit for options on: https://MyTfs.com/tfs vsts.vss_client : Route template: _apis/{area}/{resource} vsts.vss_client : Negotiated api version from '4.0-preview.1' down to '3.1-preview'. This means the client is newer than the server. vsts.vss_client : POST https://MyTfs.com/tfs/_apis/CustomerIntelligence/Events vsts.vss_client : Request content: [{'area': 'CLI', 'feature': 'work', 'properties': {'Command': 'item create', 'Args': ['title', 'type', 'assigned-to', 'description', 'instance', 'project']}}] msrest.pipeline : Configuring request: timeout=100, verify=True, cert=None msrest.pipeline : Configuring proxies: '' msrest.pipeline : Evaluate proxies against ENV settings: True msrest.pipeline : Configuring redirects: allow=True, max=30 msrest.pipeline : Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90 urllib3.connectionpool : Starting new HTTPS connection (1): MyTfs.com:443 vsts._file_cache : Cache file does not exist: C:\Users\MyUserTFS.vsts\python-sdk\cache\resources.json vsts.vss_connection : File cache miss for resources on: https://MyTfs.com/tfs API resource location e81700f7-3be2-46de-8624-2eb35882fcaa is not registered on https://MyTfs.com/tfs. Traceback (most recent call last): File "C:\Program Files (x86)\Microsoft SDKs\VSTS\CLI\lib\site-packages\knack\cli.py", line 197, in invoke cmd_result = self.invocation.execute(args) File "C:\Program Files (x86)\Microsoft SDKs\VSTS\CLI\lib\site-packages\knack\invocation.py", line 172, in execute cmd_result = parsed_args.func(params) File "C:\Program Files (x86)\Microsoft SDKs\VSTS\CLI\lib\site-packages\knack\commands.py", line 105, in call return self.handler(*args, **kwargs) File "C:\Program Files (x86)\Microsoft SDKs\VSTS\CLI\lib\site-packages\knack\commands.py", line 203, in _command_handler result = op(client, **command_args) if client else op(**command_args) File "C:\Program Files (x86)\Microsoft SDKs\VSTS\CLI\lib\site-packages\vsts\cli\work\common\work_item.py", line 74, in create_work_item resolved_assigned_to = _resolve_identity_as_unique_user_id(assigned_to, team_instance) File "C:\Program Files (x86)\Microsoft SDKs\VSTS\CLI\lib\site-packages\vsts\cli\work\common\work_item.py", line 367, in _resolve_identity_as_unique_user_id identity = resolve_identity(identity_filter, team_instance) File "C:\Program Files (x86)\Microsoft SDKs\VSTS\CLI\lib\site-packages\vsts\cli\common\identities.py", line 46, in resolve_identity identity_client = get_identity_client(team_instance) File "C:\Program Files (x86)\Microsoft SDKs\VSTS\CLI\lib\site-packages\vsts\cli\common\services.py", line 91, in get_identity_client return connection.get_client('vsts.identity.v4_0.identity_client.IdentityClient') File "C:\Program Files (x86)\Microsoft SDKs\VSTS\CLI\lib\site-packages\vsts\vss_connection.py", line 37, in get_client self._client_cache[client_type] = self._get_client_instance(client_class) File "C:\Program Files (x86)\Microsoft SDKs\VSTS\CLI\lib\site-packages\vsts\vss_connection.py", line 50, in _get_client_instance url = self._get_url_for_client_instance(client_class) File "C:\Program Files (x86)\Microsoft SDKs\VSTS\CLI\lib\site-packages\vsts\vss_connection.py", line 60, in _get_url_for_client_instance resource_areas = self._get_resource_areas() File "C:\Program Files (x86)\Microsoft SDKs\VSTS\CLI\lib\site-packages\vsts\vss_connection.py", line 90, in _get_resource_areas self._resource_areas = location_client.get_resource_areas() File "C:\Program Files (x86)\Microsoft SDKs\VSTS\CLI\lib\site-packages\vsts\location\v4_0\location_client.py", line 72, in get_resource_areas returns_collection=True) File "C:\Program Files (x86)\Microsoft SDKs\VSTS\CLI\lib\site-packages\vsts\vss_client.py", line 71, in _send query_parameters=query_parameters) File "C:\Program Files (x86)\Microsoft SDKs\VSTS\CLI\lib\site-packages\vsts\vss_client.py", line 111, in _create_request_message + self.config.base_url + '.') ValueError: API resource location e81700f7-3be2-46de-8624-2eb35882fcaa is not registered on https://MyTfs.com/tfs. urllib3.connectionpool : https://MyTfs.com:443 "POST /tfs/_apis/CustomerIntelligence/Events HTTP/1.1" 204 0 vsts.vss_client : Response content: b''
As the error points out.. you are giving an incomplete instance.
vsts work item create --title "Test bug title" --type Bug --assigned-to MyUserTFS --description "Test bug description" --instance https://mytfs.com/tfs/Prd_Development --project Develop
This should work.
I am closing this issue. In case you still have issues feel free to reopen.
Sorry @atbagga I copy&paste the wrong code. Anyway I tried many times. My uri is https://mytfs.com/tfs/ and Prd_Development is the collection. I tried both in the --instance parameter and I'm giving the same error
API resource location e81700f7-3be2-46de-8624-2eb35882fcaa is not registered on https://tfs.cas.com/tfs/.
API resource location e81700f7-3be2-46de-8624-2eb35882fcaa is not registered on https://tfs.cas.com/tfs/prd_development.