Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

An error occurred with the script: CustomScript. Error: Read timed out

40 views
Skip to first unread message

Raphael Carvalho

unread,
Feb 13, 2025, 10:10:54 AMFeb 13
to ZAP Developer Group
Hello ZAP group :)

I'm working on an active rule script that runs just fine in local ZAP GUI, but once running within an automation framework, the script actually runs and finds alerts(I know that due to console.logs along the script), but then it suddenly goes "An error occurred with the script: CustomScript. Error: Read timed out", and no report is created for the scan. 

I've tried changing vars for connection timeout and such, but without success.

Would be glad if someone could share some insight on this.

There's really nothing special with the script or the automation yaml, as I'm using the following job to import it:
- parameters:
name: "CustomScript"
type: "active"
action: "add"
engine: "ECMAScript : Graal.js"
source: "/my-script-path"
type: script

psiinon

unread,
Feb 13, 2025, 10:19:08 AMFeb 13
to ZAP Developer Group
Are there any errors in the zap.log file?
Can you reproduce the problem running the AF plan locally, e.g. using the "-cmd" option?

Cheers,

Simon

Raphael Carvalho

unread,
Feb 14, 2025, 11:20:41 AMFeb 14
to ZAP Developer Group
Hi Simon, appreciate your help.

By doing the local execution I got access to the zap.log file, where I found that the issue was actually in an endpoint from the host receiving the HTTP requests for the scan, the request was getting timeout for this specific endpoint, raising an error for the whole script and stopping a report from being generated. Do you have any suggestion to make the script more bulletproof for this kind of situation?

Thanks,
Message has been deleted

thc202

unread,
Feb 18, 2025, 12:26:39 PMFeb 18
to zaproxy...@googlegroups.com
Hi,

Handle the exception, it is responsibility of the scan rule to handle
any I/O errors as needed.

Best regards.

Raphael Carvalho

unread,
Feb 19, 2025, 2:55:06 PMFeb 19
to ZAP Developer Group
Will do that, thanks @thc202 and Simon!
Reply all
Reply to author
Forward
0 new messages