Get Jobs Filter for specific Errors

I have been working on utilizing the Get Jobs activity, currently I have it filtering looking for jobs that have the Stopped state in the last 30 mins then afterwards it will Start the job with the Start Job activity. There are specific errors that happen when an Citrix Environment is running slower than usual, causing an error to occur. What I would like to do is filter for those errors and then take start the job with this process I have been working on creating.

Thanks

I suggest looking over some of these posts: Search results for 'filter get jobs' - UiPath Community Forum
Also, check here for getting the logs through API: Possible to get the Job Log URL?

I’m not sure how to get the Logs from Robots or Job runs.

Here is what an OrchestratorJob variable can access, but probably won’t help get the logs.
image

I’ve explored those options, I’m trying to get to the Indexof(Info,‘Action failed to execute as expected’) Jobs. I’ve tried putting that into the filter, but since it’s not an option I can not access. I just did a query with swagger and I keep getting an error.
{
“message”: “An organization unit is required for this action.”,
“errorCode”: 1101,
“resourceIds”: null
}
I know what my Organization Unit is, but I don’t know how to incorporate that value into the odata query? Would you know by chance?
I’m thinking that I may have to do a web api odata query to get the “info” and do some web scraping to find specific errors. Be a pain, unless I can filter through the Get Jobs activity lol

I appreciate your help again ClaytonM!!

1 Like

I’m not really familiar with API, enough to comment on this :thinking:

Check this solution: Error 1101 in HTTP request - #10 by Andrei_Oprea

No worries, I’ve only seen one other post on here on this error, the original poster just need their Organizational Unit # and then they were good to go. I replied to that post to ask if they could put up a sample of how they “plugged in” the OU #. But the post is from January, we’ll see I may hear back.

Another direction I’ve thought of is do you how to get the running job to identify itself? My thought is if there is a way that the job that is running through’s the specific error I’m looking out for I could put a Start Job activity in the Try…Catch that the job is wrapped in. So if the specific error occurs it will start itself :slight_smile: But I’m not sure how to make the job identify itself. I could plug in the name in an argument but we have like 85 jobs and have naming conventions for different environments, schedules etc… It would have too many possibilities of failure.

Yeah, so there are some ideas I can share that you might think about.

Best approach is a Framework concept where you have retry attempts when certain errors occur. You can look at the ReFramework that is a template found in Studio. A robust process should catch errors and clean up the environment, then re-attempt to process the item. So, with this approach, you technically don’t need a robot manager to rerun the jobs. However, at the same time, this doesn’t prevent items from failing if all retry attempts failed for the job run.

Alongside this concept, you can utilize Queues that have built-in retry attempts for items. However, like I mentioned, an item could fail all its retries still. Which in that case, you would need to build in a postpone method somehow to change the Failed items back to New, so they can be processed on the next job run.

Additionally, you can get the ProcessName from the project.json file located in the same directory as the job run. So if you use Read Text File, then Deserialize json to an object, where you can get the name of process (ie jsonObj(“name”).ToString). Then, you have the ProcessName. But, you also need the Environment if you plan on using Start Job. For Environment, I suppose you can use Get Jobs and filter it down to the job that is running or last ran… alternatively, you can use a hardcoded value or Asset to store the Environment name to be used.

So those are some ideas also.

Regards.

1 Like

ClaytonM,

Appreciate your feedback! I’m working taking one of our common jobs that we’ve cloned 40 times now and building it into a RE Framework. I’m working on making it easy to adapt, so that cloning will be easy to do for the client. My contract is up in a couple of months so I want to have something easy for them to modify.
I’m also still looking into figuring out how to use a web api odata query to get information about processes. I see possible benefits to still being able to use it at some point. I started looking into the HTTP Orchestrator activity. Seems like that might work for me to achieve what I’m after also.

Thanks again for your help!!

1 Like