Applying automatic fix for PowershellScriptExecution prerequisite failed

When upgrading from vRealize Automation 7.4 to 7.5 or other versions you might get the error:

Applying automatic fix for PowershellScriptExecution prerequisite failed

or

Pre-install: failed (code p-1)

There can be many reasons for this, but in my case it was a GPO that prohibited PowerShell from executing scripts. as referenced here: VMware

For you it might be something else. Tto figure out what the error was you can start of by looking in the logs, but there is actually much more information available in the original output which gets parsed, and then deleted.

Please be aware that the following is quite technical, and it is not very likely that you can use the fix demonstrated here out of the box, but I might give you a hint or two on how to troubleshoot your own issue.

How can we get a hold of this information before it is deleted?

One way is to edit the prerequisites scripts. In my case it was the following script:

/etc/bootstrap/preupdate.d/00-00-04-prereq-iaas

This information was found in the log on the vRA appliance.

# Log File
/opt/vmware/var/log/vami/updatecli.log

I the python file 00-00-04-prereq-iaas line 230 just after json.dump add print result, and run the file manually.

json.dump(......)
print result

It needs two parameters, in my case it was run with the source version as the first parameter, and the destination version as the second.

# Command:
/etc/bootstrap/preupdate.d/00-00-04-prereq-iaas 7.4.0.645 7.5.0.458

This information was found in the log too. I ran the script manually, and noticed that there was no output, but if I check the return value of the command I get a 1, and not a 0 as expected if everything succeeded.

You can check the return value with the command:

echo $?

After I altered the script I ran it, and now it dumped the json output just before the script exited. I could then format this output and find the cause of the error together with a very good explanation of what to do about it.

All of the above is at you own risk, and I do not recommend to run any of the real upgrade scripts, og post scripts manually, as they might do some real changes.

Please remember to change everything back before you reattempt the upgrade, when you have figured out what the problem was.

Remember to backup everything before you try any of this.

Best of luck.

Leave a Reply

Your email address will not be published. Required fields are marked *