06-06-23 11:24 AM
Hi All,
Facing below given error while using the action -Utility - File Management - Download File
ERROR: Internal : Could not execute code stage because exception thrown by code stage: An exception occurred during a WebClient request, while running the automation in some specific machines from control room. This issue is not occurring in debug mode and is working fine in other machines.
Please let me know, why is this error being faced only during unattended runs
Thanks!
06-06-23 05:10 PM
Hi Devi,
I can suggest checking the value of the [Destination Path]
parameter in the session logs for these failed executions. It needs to be a complete filepath (including the name of the file to be downloaded) such as C:\MyFolder\MySubFolder\MyImage.png
. All of the folders need to exist (MyFolder
and MySubfolder
) - if any are missing or if no file is specified (MyImage.png
) then the VBO will give you this error.
If the [Destination Path]
values look okay, I would suggest checking if those locations are writeable (permissions, disk space) and maybe try an alternative location as a test on these failing machines.
07-06-23 09:20 AM
Hi @charliekovacs - The destination path is given with file name and extension. It is working fine in debug mode or attended run. But when the same process is triggered through Control room, this issue is being faced.
14-06-23 05:23 PM
It is hard to say without capturing more error detail. For that, I suggest modifying the Download File action in the VBO to gain some additional insight.
Add a Data Item (Text) named "Exception"
Add the Exception data item as an output parameter for the Download File code stage
Edit the code stage to capture exception details when failures occur
Try
Using wc As New System.Net.WebClient()
wc.DownloadFile(Url, Path)
End Using
Catch ex As Exception
If ex.InnerException IsNot Nothing Then
ExceptionMessage = ex.Message + Environment.NewLine + "Inner Exception: " + ex.InnerException.Message
Else
ExceptionMessage = ex.Message
End If
End Try
Make sure to add the Exception data item as an output parameter on the End stage for the action, so you can access it in your Process that calls this action.
When a failure occurs, this data item should contain the exception message and details, viewable in your Process session log that should help diagnose further.