cancel
Showing results for 
Search instead for 
Did you mean: 

Utility - File Management - Web Client Issue

Devi_PratyushaN
Level 3

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!

3 REPLIES 3

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.

Charlie Kovacs

Devi_PratyushaN
Level 3

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.

Hi @Devi_PratyushaN 

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"35643.png

Add the Exception data item as an output parameter for the Download File code stage

35644.png

Edit the code stage to capture exception details when failures occur

35645.png

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.

35646.png

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.

Charlie Kovacs