Foreman finish scripts failing

Foreman is failing with following error:
{“errors”:{“base”:[“Failed to login via SSH to ERF42-1994 [Foreman::Exception]: Unable to find proper authentication method”]}}

Expected outcome:
The server is being built on vsphere and foreman should wait until its cloning is complete.

Foreman and Proxy versions:
foreman version: 1.21.2
smart proxy version: 1.21.2

We are building vms on vcenter using foreman and the cloning process from templates takes a little more time sometimes. When the vms is still being cloned foreman gives up and throws the above error just 10 to 15 secs before the servers is up. This has been happening more frequently recently when multiple vms are being provisioned and they slow down the cloning process by a minute or so (not much delay).

I have icreased the SSH timeout to 500 secs but the timeout still happens way before hitting that point. Is there any other setting that can be manipulated to make the provisioning work ?
pls let me know if any more info is required.

Foreman tries to ssh into the box to execute post scripts.
In order for ssh to work, correct credentials has to be updated under compute resources -> images.
Updating the correct credentials have resolved the issue.
Bug #15440: [oVirt] SSH provisionning failed with "ERF42-1994: Unable to find proper authentication method" - Foreman … a similar issue.