My batch service doesn't return the right output
I execute a python script on an Azure batch service. I have programmed it to systematically return an outputs.json on which I test a condition. However, sometime the outputs.json doesn't appear although I have an exit code 0 (no errors). I can't understand why it happens.
Azure Batch
-
kobulloc-MSFT 26,346 Reputation points • Microsoft Employee
2023-07-29T00:11:55.0033333+00:00 Hello, @Ayoub !
It sounds like we may need to review the script to determine what the issue is. Are you able to provide that? I would recommend looking at the Azure Batch logs if you have not already done so:
https://learn.microsoft.com/en-us/azure/batch/batch-diagnostics
-
Ayoub Mabrouki 15 Reputation points
2023-07-31T15:52:15.12+00:00 Hi @kobulloc-MSFT ,
The script looks pretty much like this:
def res = verif_code_article(articles)
I've cut off some confidential stuff but it's not really necessary to understand the logic behind the output.
-
kobulloc-MSFT 26,346 Reputation points • Microsoft Employee
2023-08-01T02:57:17.7666667+00:00 Thank you for adding the script,@Ayoub ! Unfortunately, the sample you've provided doesn't offer much additional insight. From what you've said:
- There are no errors (exit code of 0)
- You've programmed the Python script to systematically return an
outputs.json
- This sometimes works and sometimes does not
The only thing I can think of at this point is that you may be running into a size limit or there is some additional debugging that needs to be done with the script.
-
Ayoub Mabrouki 15 Reputation points
2023-08-01T07:34:37.3666667+00:00 Hi ,
Thanks for your response.
I' m sorry, but I dont know why the code doesn' t appear on my previous comment.
Normally, it should look like this
-
kobulloc-MSFT 26,346 Reputation points • Microsoft Employee
2023-08-02T06:43:46.4666667+00:00 Thank you, @Ayoub !
Just to confirm, you've gotten both of the
json_data
results inoutputs.json
?-
"result": "Success", "Missing": None
-
"result": "Failure", "Missing": missing
And you've also gotten
outputs.json
including bothres
data and'Problem'
? -
-
Ayoub MABROUKI 5 Reputation points
2023-08-02T06:53:28.7833333+00:00 Hi @kobulloc-MSFT hd, I should only get one the dictionary in the outputs.json containing either one of the dictionaries. The problem is that I don't get any output at all
-
kobulloc-MSFT 26,346 Reputation points • Microsoft Employee
2023-08-02T07:32:00.65+00:00 Hello, @Ayoub !
Really, what I'm trying to confirm is if there is a specific logic path that fails to return the expected result. If that was the case, I would look at the script in more detail. If not, there isn't a lot in the documentation that describes the type of failure you are seeing from an Azure Batch standpoint so I would need to do some more research.
-
Ayoub Mabrouki 15 Reputation points
2023-08-02T08:29:50.47+00:00 Hello, @kobulloc-MSFT
Here you can find a more detailed look at the code that runs on the batch. I might have made a mistake while writing the code which would explain the inconsistency but for me, we should always have an output no matter what happens in the functions.
Thanks for taking the time to look at the matter, it's really appreciated.
-
kobulloc-MSFT 26,346 Reputation points • Microsoft Employee
2023-08-03T06:16:39.3966667+00:00 Thank you, @Ayoub !
I'll take a closer look at the updated script and let you know if I'm able to narrow down the cause of this inconsistency.
-
kobulloc-MSFT 26,346 Reputation points • Microsoft Employee
2023-08-09T01:53:29.8+00:00 Hello, @Ayoub !
I'm not seeing anything on the first pass in the script that would cause the issue that you are seeing. If you are interested, we can have someone look at your resources to rule out anything on the Azure side of things.
Please email the following to AzCommunity@microsoft.com and we'll get back to you promptly:
- Subject: "Attn: kobulloc - Batch service output"
- Email body: Your Subscription ID
- Email body: A link to this thread so we can validate and expedite the request
If you don't receive a response within 24 hours, please reply to the thread so we can investigate.
Sign in to comment