Azure / azure-cli

Azure Command-Line Interface
MIT License
4.03k stars 3k forks source link

azure batch jobschedule with recurring job - creating/updating requires ISO-8601 duration format, 'show' returns non-ISO-8601 duration format #29821

Open bartjanson opened 2 months ago

bartjanson commented 2 months ago

Describe the bug

When creating a jobschedule with a recurring job using json, the attribute '.schedule.recurrenceInterval' requires a value in the ISO-8601 duration format, for example, 'P1D', means 'P' for period, 1D for 'every 1 days'.

After creation, the json can be inspected using different methods:

Same goes for a number of other attributes that are returned in the json, but that were not explicitly set when creating the jobschedule:

When a job-schedule is updated (az batch job-schedule reset) using the json that is requested with 'show', the following error is returned:

The command failed with an unexpected error. Here is the traceback:
Failed to deserialized JSON file into object JobScheduleUpdateParameter: ('Unable to deserialize response data. Data: 1 day, 0:00:00, duration, DeserializationError: ("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string \'1 day, 0:00:00\'", ISO8601Error("Unable to parse duration string \'1 day, 0:00:00\'"))', DeserializationError("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string '1 day, 0:00:00'", ISO8601Error("Unable to parse duration string '1 day, 0:00:00'")))
Traceback (most recent call last):
  File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1880, in deserialize_duration
    duration = isodate.parse_duration(attr)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/isodate/isoduration.py", line 104, in parse_duration
    raise ISO8601Error("Unable to parse duration string %r" % datestring)
isodate.isoerror.ISO8601Error: Unable to parse duration string '1 day, 0:00:00'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1621, in deserialize_data
    data_val = self.deserialize_type[data_type](data)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1883, in deserialize_duration
    raise_with_traceback(DeserializationError, msg, err)
  File "/opt/az/lib/python3.11/site-packages/msrest/exceptions.py", line 51, in raise_with_traceback
    raise error.with_traceback(exc_traceback)
  File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1880, in deserialize_duration
    duration = isodate.parse_duration(attr)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/isodate/isoduration.py", line 104, in parse_duration
    raise ISO8601Error("Unable to parse duration string %r" % datestring)
azure.core.exceptions.DeserializationError: ("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string '1 day, 0:00:00'", ISO8601Error("Unable to parse duration string '1 day, 0:00:00'"))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/batch/_command_type.py", line 293, in deserialize_json
    kwargs[self._request_param['name']] = model_type.from_dict(json_obj)
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 349, in from_dict
    return deserializer(cls.__name__, data, content_type=content_type)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1376, in __call__
    return self._deserialize(target_obj, data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1450, in _deserialize
    value = self.deserialize_data(raw_value, attr_desc['type'])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1639, in deserialize_data
    return self._deserialize(obj_type, data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1450, in _deserialize
    value = self.deserialize_data(raw_value, attr_desc['type'])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1637, in deserialize_data
    raise_with_traceback(DeserializationError, msg, err)
  File "/opt/az/lib/python3.11/site-packages/msrest/exceptions.py", line 51, in raise_with_traceback
    raise error.with_traceback(exc_traceback)
  File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1621, in deserialize_data
    data_val = self.deserialize_type[data_type](data)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1883, in deserialize_duration
    raise_with_traceback(DeserializationError, msg, err)
  File "/opt/az/lib/python3.11/site-packages/msrest/exceptions.py", line 51, in raise_with_traceback
    raise error.with_traceback(exc_traceback)
  File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1880, in deserialize_duration
    duration = isodate.parse_duration(attr)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/isodate/isoduration.py", line 104, in parse_duration
    raise ISO8601Error("Unable to parse duration string %r" % datestring)
azure.core.exceptions.DeserializationError: ('Unable to deserialize response data. Data: 1 day, 0:00:00, duration, DeserializationError: ("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string \'1 day, 0:00:00\'", ISO8601Error("Unable to parse duration string \'1 day, 0:00:00\'"))', DeserializationError("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string '1 day, 0:00:00'", ISO8601Error("Unable to parse duration string '1 day, 0:00:00'")))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/az/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 664, in execute
    raise ex
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 731, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 723, in _run_job
    return cmd_copy.exception_handler(ex)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/batch/_exception_handler.py", line 28, in batch_exception_handler
    raise ex
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 701, in _run_job
    result = cmd_copy(params)
             ^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 334, in __call__
    return self.handler(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/batch/_command_type.py", line 480, in _execute_command
    self.parser.deserialize_json(kwargs, json_file)
  File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/batch/_command_type.py", line 296, in deserialize_json
    raise ValueError(message.format(self._request_param['model']))
ValueError: Failed to deserialized JSON file into object JobScheduleUpdateParameter: ('Unable to deserialize response data. Data: 1 day, 0:00:00, duration, DeserializationError: ("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string \'1 day, 0:00:00\'", ISO8601Error("Unable to parse duration string \'1 day, 0:00:00\'"))', DeserializationError("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string '1 day, 0:00:00'", ISO8601Error("Unable to parse duration string '1 day, 0:00:00'")))
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

Related command

az batch job-schedule show --subscription "<xxxx>" --account-name "<batchaccountname>" --job-schedule-id "<name of a jobschedule>" > jobschedule.json

and then using the json-output 'jobschedule.json' in the reset command:

az batch job-schedule reset --json jobschedule.json --job-schedule-id "<name of a jobschedule>" --account-name "<batchaccountname>" --subscription "<xxxx>" 

Errors

The command failed with an unexpected error. Here is the traceback: Failed to deserialized JSON file into object JobScheduleUpdateParameter: ('Unable to deserialize response data. Data: 1 day, 0:00:00, duration, DeserializationError: ("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string \'1 day, 0:00:00\'", ISO8601Error("Unable to parse duration string \'1 day, 0:00:00\'"))', DeserializationError("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string '1 day, 0:00:00'", ISO8601Error("Unable to parse duration string '1 day, 0:00:00'"))) Traceback (most recent call last): File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1880, in deserialize_duration duration = isodate.parse_duration(attr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/isodate/isoduration.py", line 104, in parse_duration raise ISO8601Error("Unable to parse duration string %r" % datestring) isodate.isoerror.ISO8601Error: Unable to parse duration string '1 day, 0:00:00'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1621, in deserialize_data data_val = self.deserialize_typedata_type ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1883, in deserialize_duration raise_with_traceback(DeserializationError, msg, err) File "/opt/az/lib/python3.11/site-packages/msrest/exceptions.py", line 51, in raise_with_traceback raise error.with_traceback(exc_traceback) File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1880, in deserialize_duration duration = isodate.parse_duration(attr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/isodate/isoduration.py", line 104, in parse_duration raise ISO8601Error("Unable to parse duration string %r" % datestring) azure.core.exceptions.DeserializationError: ("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string '1 day, 0:00:00'", ISO8601Error("Unable to parse duration string '1 day, 0:00:00'"))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/batch/_command_type.py", line 293, in deserialize_json kwargs[self._request_param['name']] = model_type.from_dict(json_obj) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 349, in from_dict return deserializer(cls.name, data, content_type=content_type) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1376, in call return self._deserialize(target_obj, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1450, in _deserialize value = self.deserialize_data(raw_value, attr_desc['type']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1639, in deserialize_data return self._deserialize(obj_type, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1450, in _deserialize value = self.deserialize_data(raw_value, attr_desc['type']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1637, in deserialize_data raise_with_traceback(DeserializationError, msg, err) File "/opt/az/lib/python3.11/site-packages/msrest/exceptions.py", line 51, in raise_with_traceback raise error.with_traceback(exc_traceback) File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1621, in deserialize_data data_val = self.deserialize_typedata_type ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1883, in deserialize_duration raise_with_traceback(DeserializationError, msg, err) File "/opt/az/lib/python3.11/site-packages/msrest/exceptions.py", line 51, in raise_with_traceback raise error.with_traceback(exc_traceback) File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1880, in deserialize_duration duration = isodate.parse_duration(attr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/isodate/isoduration.py", line 104, in parse_duration raise ISO8601Error("Unable to parse duration string %r" % datestring) azure.core.exceptions.DeserializationError: ('Unable to deserialize response data. Data: 1 day, 0:00:00, duration, DeserializationError: ("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string \'1 day, 0:00:00\'", ISO8601Error("Unable to parse duration string \'1 day, 0:00:00\'"))', DeserializationError("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string '1 day, 0:00:00'", ISO8601Error("Unable to parse duration string '1 day, 0:00:00'")))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 664, in execute raise ex File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 731, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 723, in _run_job return cmd_copy.exception_handler(ex) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/batch/_exception_handler.py", line 28, in batch_exception_handler raise ex File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 701, in _run_job result = cmd_copy(params) ^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 334, in call return self.handler(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/batch/_command_type.py", line 480, in _execute_command self.parser.deserialize_json(kwargs, json_file) File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/batch/_command_type.py", line 296, in deserialize_json raise ValueError(message.format(self._request_param['model'])) ValueError: Failed to deserialized JSON file into object JobScheduleUpdateParameter: ('Unable to deserialize response data. Data: 1 day, 0:00:00, duration, DeserializationError: ("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string \'1 day, 0:00:00\'", ISO8601Error("Unable to parse duration string \'1 day, 0:00:00\'"))', DeserializationError("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string '1 day, 0:00:00'", ISO8601Error("Unable to parse duration string '1 day, 0:00:00'"))) To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

Issue script & Debug output

cli.knack.cli: Command arguments: ['batch', 'job-schedule', 'reset', '--json', 'exportJobScheduleWithOtherKey.json', '--job-schedule-id', '', '--account-name', '', '--subscription', '', '--debug'] cli.knack.cli: init debug log: Enable color in terminal. cli.knack.cli: Event: Cli.PreExecute [] cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7f4b3c1abf60>, <function OutputProducer.on_global_arguments at 0x7f4b3c15e160>, <function CLIQuery.on_global_arguments at 0x7f4b3bf77c40>] cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate [] cli.azure.cli.core: Modules found from index for 'batch': ['azure.cli.command_modules.batch'] cli.azure.cli.core: Loading command modules: cli.azure.cli.core: Name Load Time Groups Commands cli.azure.cli.core: batch 0.139 34 102 cli.azure.cli.core: Total (1) 0.139 34 102 cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next'] cli.azure.cli.core: Loading extensions: cli.azure.cli.core: Name Load Time Groups Commands Directory cli.azure.cli.core: Total (0) 0.000 0 0 cli.azure.cli.core: Loaded 34 groups, 102 commands. cli.azure.cli.core: Found a match in the command table. cli.azure.cli.core: Raw command : batch job-schedule reset cli.azure.cli.core: Command table: batch job-schedule reset cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f4b3b422ca0>] cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/root/.azure/commands/2024-09-02.16-07-28.batch_job-schedule_reset.1934.log'. az_command_data_logger: command args: batch job-schedule reset --json {} --job-schedule-id {} --account-name {} --subscription {} --debug cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x7f4b3b4772e0>] cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad [] cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x7f4b3b477380>, <function register_cache_arguments..add_cache_arguments at 0x7f4b3b4774c0>] cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded [] cli.knack.cli: Event: CommandInvoker.OnPreParseArgs [] cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7f4b3c15e200>, <function CLIQuery.handle_query_parameter at 0x7f4b3bf77ce0>, <function register_ids_argument..parse_ids_arguments at 0x7f4b3b477420>] cli.azure.cli.core.util: attempting to read file exportJobScheduleWithOtherKey.json as utf-8-sig cli.azure.cli.core.auth.persistence: build_persistence: location='/root/.azure/msal_token_cache.json', encrypt=False cli.azure.cli.core.auth.binary_cache: load: /root/.azure/msal_http_cache.bin urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None) msal.authority: Initializing with Entra authority: https://login.microsoftonline.com/ msal.authority: openid_config("https://login.microsoftonline.com//v2.0/.well-known/openid-configuration") = {'token_endpoint': 'https://login.microsoftonline.com//oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com//discovery/v2.0/keys', 'response_modes_supported': ['query', 'fragment', 'form_post'], 'subject_types_supported': ['pairwise'], 'id_token_signing_alg_values_supported': ['RS256'], 'response_types_supported': ['code', 'id_token', 'code id_token', 'id_token token'], 'scopes_supported': ['openid', 'profile', 'email', 'offline_access'], 'issuer': 'https://login.microsoftonline.com//v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com//oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com//oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com//oauth2/v2.0/logout', 'claims_supported': ['sub', 'iss', 'cloud_instance_name', 'cloud_instance_host_name', 'cloud_graph_host_name', 'msgraph_host', 'aud', 'exp', 'iat', 'auth_time', 'acr', 'nonce', 'preferred_username', 'name', 'tid', 'ver', 'at_hash', 'c_hash', 'email'], 'kerberos_endpoint': 'https://login.microsoftonline.com//kerberos', 'tenant_region_scope': 'EU', 'cloud_instance_name': 'microsoftonline.com', 'cloud_graph_host_name': 'graph.windows.net', 'msgraph_host': 'graph.microsoft.com', 'rbac_url': 'https://pas.windows.net'} msal.application: Broker enabled? None msrest.universal_http.requests: Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90 cli.azure.cli.core.azclierror: Traceback (most recent call last): File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1880, in deserialize_duration duration = isodate.parse_duration(attr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/isodate/isoduration.py", line 104, in parse_duration raise ISO8601Error("Unable to parse duration string %r" % datestring) isodate.isoerror.ISO8601Error: Unable to parse duration string '1 day, 0:00:00'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1621, in deserialize_data data_val = self.deserialize_typedata_type ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1883, in deserialize_duration raise_with_traceback(DeserializationError, msg, err) File "/opt/az/lib/python3.11/site-packages/msrest/exceptions.py", line 51, in raise_with_traceback raise error.with_traceback(exc_traceback) File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1880, in deserialize_duration duration = isodate.parse_duration(attr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/isodate/isoduration.py", line 104, in parse_duration raise ISO8601Error("Unable to parse duration string %r" % datestring) azure.core.exceptions.DeserializationError: ("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string '1 day, 0:00:00'", ISO8601Error("Unable to parse duration string '1 day, 0:00:00'"))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/batch/_command_type.py", line 293, in deserialize_json kwargs[self._request_param['name']] = model_type.from_dict(json_obj) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 349, in from_dict return deserializer(cls.name, data, content_type=content_type) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1376, in call return self._deserialize(target_obj, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1450, in _deserialize value = self.deserialize_data(raw_value, attr_desc['type']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1639, in deserialize_data return self._deserialize(obj_type, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1450, in _deserialize value = self.deserialize_data(raw_value, attr_desc['type']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1637, in deserialize_data raise_with_traceback(DeserializationError, msg, err) File "/opt/az/lib/python3.11/site-packages/msrest/exceptions.py", line 51, in raise_with_traceback raise error.with_traceback(exc_traceback) File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1621, in deserialize_data data_val = self.deserialize_typedata_type ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1883, in deserialize_duration raise_with_traceback(DeserializationError, msg, err) File "/opt/az/lib/python3.11/site-packages/msrest/exceptions.py", line 51, in raise_with_traceback raise error.with_traceback(exc_traceback) File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1880, in deserialize_duration duration = isodate.parse_duration(attr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/isodate/isoduration.py", line 104, in parse_duration raise ISO8601Error("Unable to parse duration string %r" % datestring) azure.core.exceptions.DeserializationError: ('Unable to deserialize response data. Data: 1 day, 0:00:00, duration, DeserializationError: ("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string \'1 day, 0:00:00\'", ISO8601Error("Unable to parse duration string \'1 day, 0:00:00\'"))', DeserializationError("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string '1 day, 0:00:00'", ISO8601Error("Unable to parse duration string '1 day, 0:00:00'")))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 664, in execute raise ex File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 731, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 723, in _run_job return cmd_copy.exception_handler(ex) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/batch/_exception_handler.py", line 28, in batch_exception_handler raise ex File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 701, in _run_job result = cmd_copy(params) ^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 334, in call return self.handler(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/batch/_command_type.py", line 480, in _execute_command self.parser.deserialize_json(kwargs, json_file) File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/batch/_command_type.py", line 296, in deserialize_json raise ValueError(message.format(self._request_param['model'])) ValueError: Failed to deserialized JSON file into object JobScheduleUpdateParameter: ('Unable to deserialize response data. Data: 1 day, 0:00:00, duration, DeserializationError: ("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string \'1 day, 0:00:00\'", ISO8601Error("Unable to parse duration string \'1 day, 0:00:00\'"))', DeserializationError("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string '1 day, 0:00:00'", ISO8601Error("Unable to parse duration string '1 day, 0:00:00'")))

cli.azure.cli.core.azclierror: The command failed with an unexpected error. Here is the traceback: az_command_data_logger: The command failed with an unexpected error. Here is the traceback: cli.azure.cli.core.azclierror: Failed to deserialized JSON file into object JobScheduleUpdateParameter: ('Unable to deserialize response data. Data: 1 day, 0:00:00, duration, DeserializationError: ("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string \'1 day, 0:00:00\'", ISO8601Error("Unable to parse duration string \'1 day, 0:00:00\'"))', DeserializationError("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string '1 day, 0:00:00'", ISO8601Error("Unable to parse duration string '1 day, 0:00:00'"))) Traceback (most recent call last): File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1880, in deserialize_duration duration = isodate.parse_duration(attr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/isodate/isoduration.py", line 104, in parse_duration raise ISO8601Error("Unable to parse duration string %r" % datestring) isodate.isoerror.ISO8601Error: Unable to parse duration string '1 day, 0:00:00'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1621, in deserialize_data data_val = self.deserialize_typedata_type ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1883, in deserialize_duration raise_with_traceback(DeserializationError, msg, err) File "/opt/az/lib/python3.11/site-packages/msrest/exceptions.py", line 51, in raise_with_traceback raise error.with_traceback(exc_traceback) File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1880, in deserialize_duration duration = isodate.parse_duration(attr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/isodate/isoduration.py", line 104, in parse_duration raise ISO8601Error("Unable to parse duration string %r" % datestring) azure.core.exceptions.DeserializationError: ("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string '1 day, 0:00:00'", ISO8601Error("Unable to parse duration string '1 day, 0:00:00'"))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/batch/_command_type.py", line 293, in deserialize_json kwargs[self._request_param['name']] = model_type.from_dict(json_obj) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 349, in from_dict return deserializer(cls.name, data, content_type=content_type) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1376, in call return self._deserialize(target_obj, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1450, in _deserialize value = self.deserialize_data(raw_value, attr_desc['type']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1639, in deserialize_data return self._deserialize(obj_type, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1450, in _deserialize value = self.deserialize_data(raw_value, attr_desc['type']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1637, in deserialize_data raise_with_traceback(DeserializationError, msg, err) File "/opt/az/lib/python3.11/site-packages/msrest/exceptions.py", line 51, in raise_with_traceback raise error.with_traceback(exc_traceback) File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1621, in deserialize_data data_val = self.deserialize_typedata_type ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1883, in deserialize_duration raise_with_traceback(DeserializationError, msg, err) File "/opt/az/lib/python3.11/site-packages/msrest/exceptions.py", line 51, in raise_with_traceback raise error.with_traceback(exc_traceback) File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1880, in deserialize_duration duration = isodate.parse_duration(attr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/isodate/isoduration.py", line 104, in parse_duration raise ISO8601Error("Unable to parse duration string %r" % datestring) azure.core.exceptions.DeserializationError: ('Unable to deserialize response data. Data: 1 day, 0:00:00, duration, DeserializationError: ("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string \'1 day, 0:00:00\'", ISO8601Error("Unable to parse duration string \'1 day, 0:00:00\'"))', DeserializationError("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string '1 day, 0:00:00'", ISO8601Error("Unable to parse duration string '1 day, 0:00:00'")))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 664, in execute raise ex File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 731, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 723, in _run_job return cmd_copy.exception_handler(ex) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/batch/_exception_handler.py", line 28, in batch_exception_handler raise ex File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 701, in _run_job result = cmd_copy(params) ^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 334, in call return self.handler(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/batch/_command_type.py", line 480, in _execute_command self.parser.deserialize_json(kwargs, json_file) File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/batch/_command_type.py", line 296, in deserialize_json raise ValueError(message.format(self._request_param['model'])) ValueError: Failed to deserialized JSON file into object JobScheduleUpdateParameter: ('Unable to deserialize response data. Data: 1 day, 0:00:00, duration, DeserializationError: ("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string \'1 day, 0:00:00\'", ISO8601Error("Unable to parse duration string \'1 day, 0:00:00\'"))', DeserializationError("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string '1 day, 0:00:00'", ISO8601Error("Unable to parse duration string '1 day, 0:00:00'"))) az_command_data_logger: Failed to deserialized JSON file into object JobScheduleUpdateParameter: ('Unable to deserialize response data. Data: 1 day, 0:00:00, duration, DeserializationError: ("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string \'1 day, 0:00:00\'", ISO8601Error("Unable to parse duration string \'1 day, 0:00:00\'"))', DeserializationError("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string '1 day, 0:00:00'", ISO8601Error("Unable to parse duration string '1 day, 0:00:00'"))) Traceback (most recent call last): File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1880, in deserialize_duration duration = isodate.parse_duration(attr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/isodate/isoduration.py", line 104, in parse_duration raise ISO8601Error("Unable to parse duration string %r" % datestring) isodate.isoerror.ISO8601Error: Unable to parse duration string '1 day, 0:00:00'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1621, in deserialize_data data_val = self.deserialize_typedata_type ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1883, in deserialize_duration raise_with_traceback(DeserializationError, msg, err) File "/opt/az/lib/python3.11/site-packages/msrest/exceptions.py", line 51, in raise_with_traceback raise error.with_traceback(exc_traceback) File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1880, in deserialize_duration duration = isodate.parse_duration(attr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/isodate/isoduration.py", line 104, in parse_duration raise ISO8601Error("Unable to parse duration string %r" % datestring) azure.core.exceptions.DeserializationError: ("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string '1 day, 0:00:00'", ISO8601Error("Unable to parse duration string '1 day, 0:00:00'"))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/batch/_command_type.py", line 293, in deserialize_json kwargs[self._request_param['name']] = model_type.from_dict(json_obj) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 349, in from_dict return deserializer(cls.name, data, content_type=content_type) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1376, in call return self._deserialize(target_obj, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1450, in _deserialize value = self.deserialize_data(raw_value, attr_desc['type']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1639, in deserialize_data return self._deserialize(obj_type, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1450, in _deserialize value = self.deserialize_data(raw_value, attr_desc['type']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1637, in deserialize_data raise_with_traceback(DeserializationError, msg, err) File "/opt/az/lib/python3.11/site-packages/msrest/exceptions.py", line 51, in raise_with_traceback raise error.with_traceback(exc_traceback) File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1621, in deserialize_data data_val = self.deserialize_typedata_type ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1883, in deserialize_duration raise_with_traceback(DeserializationError, msg, err) File "/opt/az/lib/python3.11/site-packages/msrest/exceptions.py", line 51, in raise_with_traceback raise error.with_traceback(exc_traceback) File "/opt/az/lib/python3.11/site-packages/msrest/serialization.py", line 1880, in deserialize_duration duration = isodate.parse_duration(attr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/isodate/isoduration.py", line 104, in parse_duration raise ISO8601Error("Unable to parse duration string %r" % datestring) azure.core.exceptions.DeserializationError: ('Unable to deserialize response data. Data: 1 day, 0:00:00, duration, DeserializationError: ("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string \'1 day, 0:00:00\'", ISO8601Error("Unable to parse duration string \'1 day, 0:00:00\'"))', DeserializationError("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string '1 day, 0:00:00'", ISO8601Error("Unable to parse duration string '1 day, 0:00:00'")))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 664, in execute raise ex File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 731, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 723, in _run_job return cmd_copy.exception_handler(ex) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/batch/_exception_handler.py", line 28, in batch_exception_handler raise ex File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 701, in _run_job result = cmd_copy(params) ^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 334, in call return self.handler(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/batch/_command_type.py", line 480, in _execute_command self.parser.deserialize_json(kwargs, json_file) File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/batch/_command_type.py", line 296, in deserialize_json raise ValueError(message.format(self._request_param['model'])) ValueError: Failed to deserialized JSON file into object JobScheduleUpdateParameter: ('Unable to deserialize response data. Data: 1 day, 0:00:00, duration, DeserializationError: ("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string \'1 day, 0:00:00\'", ISO8601Error("Unable to parse duration string \'1 day, 0:00:00\'"))', DeserializationError("Cannot deserialize duration object., ISO8601Error: Unable to parse duration string '1 day, 0:00:00'", ISO8601Error("Unable to parse duration string '1 day, 0:00:00'"))) To check existing issues, please visit: https://github.com/Azure/azure-cli/issues cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f4b3b422f20>] az_command_data_logger: exit code: 1 cli.main: Command ran in 0.334 seconds (init: 0.100, invoke: 0.234) telemetry.main: Begin splitting cli events and extra events, total events: 1 telemetry.client: Accumulated 0 events. Flush the clients. telemetry.main: Finish splitting cli events and extra events, cli events: 1 telemetry.save: Save telemetry record of length 8266 in cache telemetry.main: Begin creating telemetry upload process. telemetry.process: Creating upload process: "/opt/az/bin/python3 /opt/az/lib/python3.11/site-packages/azure/cli/telemetry/init.py /root/.azure" telemetry.process: Return from creating process telemetry.main: Finish creating telemetry upload process.

Expected behavior

requesting json using 'show' for the jobschedule should return the json-attributes as used when creating the jobschedule, not convert them to a non-ISO-8601 duration format.

Environment Summary

azure-cli 2.63.0

core 2.63.0 telemetry 1.1.0

Extensions: account 0.2.5 aks-preview 8.0.0b1 application-insights 1.2.1 azure-devops 1.0.1 log-analytics-solution 1.0.0

Dependencies: msal 1.30.0 azure-mgmt-resource 23.1.1

Python location '/opt/az/bin/python3' Extensions directory '/root/.azure/cliextensions'

Python (Linux) 3.11.8 (main, Jul 31 2024, 03:39:39) [GCC 11.4.0]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

-

yonzhan commented 2 months ago

Thank you for opening this issue, we will look into it.