Action timed out during script execution

Hi,

i am trying to automate setting up CRS326 with a script. It is working well except where the script is signing certificates (key-size=4096), when it takes too long the script does stop with “action timed out - try again, if error continues contact MikroTik support and send a supout file (13)”.
How can i raise the timeout or execute the script in a way that waits until the command is actually finished?

I know this is very old but I’ve run into exactly the same issue.

This is not the smartest way to deal with it but at least it works enough for the script to continue. You may need to increase the delay depending on what device you have.

/certificate add name=hello copy-from=client-template common-name=hello@somewhere.example

:do {
  /certificate sign [find name=hello] ca=CA name=hello
} on-error={ :log warning "waiting for cert to generate"; :delay 120 }

A smarter way would be a delay inside a loop that checks if the cert is signed yet.

Please consider the correct use of this forum and do not quote if is it not necessary,
use “post reply” button.
Thanks.

Hello,
I’m a bit late but i finally figured out a way to wait properly the certificates to be signed before continuing a script

:do {
/certificate add name=root-cert common-name=MyCPE days-valid=6522 key-usage=key-cert-sign,crl-sign key-size=2048
/certificate sign root-cert
:do {
    :delay 1s
    :log info "root-cert not signed yet"
} while ([/certificate get [find name="root-cert"] fingerprint] = false)

:log info "root-cert signed"

/certificate add name=https-cert common-name=MyCPE days-valid=6522 key-size=2048
/certificate sign ca=root-cert https-cert
:do {
    :delay 1s
    :log info "https-cert not signed yet"
} while ([/certificate get [find name="https-cert"] fingerprint] = false)

:log info "https-cert signed"
}