I have a python service running that is starting azure batch pools and adds a single job + task on user requests. In ~90% of the time, everything works fine, but sometimes i get the following error message:
Traceback (most recent call last):
[...]
azure.batch.custom.custom_errors.CreateTasksErrorException: Task with id `sim_07936` failed due to client error - InvalidPropertyValue::{'additional_properties': {}, 'lang': 'en-US', 'value': 'The value provided for one of the properties in the request body is invalid.\nRequestId:5a36d9fd-f230-46ba-ac7d-961d3572521f\nTime:2025-03-19T10:10:10.9862777Z'}
I assume the main culprit is this:
InvalidPropertyValue::{'additional_properties': {}, 'lang': 'en-US', 'value': 'The value provided for one of the properties in the request body is invalid.
However, nowhere in the task creation do i use "additional_properties", nor do my tasks differ between different user calls. This is the relevant piece of code in the "add_simulation_task" function:
job_id = str("some_uuid4")
number_cpus = 100
tasks = []
resource_files = [
batchmodels.ResourceFile(somefile1),
batchmodels.ResourceFile(somefile2)
]
display_name = "some_name"
random_tag = random.randrange(0, 10000)
sim_id = f"sim_{random_tag:05d}"
parameters = "something"
command_string = (
f"some_f_string_with_a_few_{parameters}"
)
command = (
f"/bin/bash -c '{command_string}'"
)
tasks.append(batchmodels.TaskAddParameter(
id=sim_id,
display_name=display_name,
command_line=command,
resource_files=resource_files,
environment_settings=[
batchmodels.EnvironmentSetting(
name="NODES",
value="1"
),
batchmodels.EnvironmentSetting(
name="PPN",
value=str(number_cpus)
)
],
multi_instance_settings=batchmodels.MultiInstanceSettings(
coordination_command_line="/bin/bash -c env",
number_of_instances=1,
common_resource_files=[]
),
user_identity=batchmodels.UserIdentity(
auto_user=batchmodels.AutoUserSpecification(
scope="pool",
elevation_level="nonadmin"
)
)
))
batch_service_client.task.add_collection(job_id, tasks)
I have started the exact same task 2 or 3 times without success on the one day, with no issues on the second.
I would be happy for any idea why the interface is not working 100% of the time.
I have a python service running that is starting azure batch pools and adds a single job + task on user requests. In ~90% of the time, everything works fine, but sometimes i get the following error message:
Traceback (most recent call last):
[...]
azure.batch.custom.custom_errors.CreateTasksErrorException: Task with id `sim_07936` failed due to client error - InvalidPropertyValue::{'additional_properties': {}, 'lang': 'en-US', 'value': 'The value provided for one of the properties in the request body is invalid.\nRequestId:5a36d9fd-f230-46ba-ac7d-961d3572521f\nTime:2025-03-19T10:10:10.9862777Z'}
I assume the main culprit is this:
InvalidPropertyValue::{'additional_properties': {}, 'lang': 'en-US', 'value': 'The value provided for one of the properties in the request body is invalid.
However, nowhere in the task creation do i use "additional_properties", nor do my tasks differ between different user calls. This is the relevant piece of code in the "add_simulation_task" function:
job_id = str("some_uuid4")
number_cpus = 100
tasks = []
resource_files = [
batchmodels.ResourceFile(somefile1),
batchmodels.ResourceFile(somefile2)
]
display_name = "some_name"
random_tag = random.randrange(0, 10000)
sim_id = f"sim_{random_tag:05d}"
parameters = "something"
command_string = (
f"some_f_string_with_a_few_{parameters}"
)
command = (
f"/bin/bash -c '{command_string}'"
)
tasks.append(batchmodels.TaskAddParameter(
id=sim_id,
display_name=display_name,
command_line=command,
resource_files=resource_files,
environment_settings=[
batchmodels.EnvironmentSetting(
name="NODES",
value="1"
),
batchmodels.EnvironmentSetting(
name="PPN",
value=str(number_cpus)
)
],
multi_instance_settings=batchmodels.MultiInstanceSettings(
coordination_command_line="/bin/bash -c env",
number_of_instances=1,
common_resource_files=[]
),
user_identity=batchmodels.UserIdentity(
auto_user=batchmodels.AutoUserSpecification(
scope="pool",
elevation_level="nonadmin"
)
)
))
batch_service_client.task.add_collection(job_id, tasks)
I have started the exact same task 2 or 3 times without success on the one day, with no issues on the second.
I would be happy for any idea why the interface is not working 100% of the time.
Share Improve this question asked Mar 19 at 10:40 SebStaSebSta 4942 silver badges12 bronze badges1 Answer
Reset to default 1You should inspect the BatchErrorDetail
field to understand which property is invalid.
My guess is that you are exceeding the length/size limits of a property that is susceptible to such limits. Such properties include (but aren't limited to) ResourceFiles, CommandLine, or EnvironmentVariables.