An incorrect policy file can lead to an internal server error

Seen on a 0.48.0rc8 orchestrator with a 0.40.1rc5 python toolkit.

If a policy is missing the spec parameter, a request (for example by using opentf-ctl) will generate an internal server error on the tools side and a python exception in the orchestrator logs.

Example :

image

image

This is the case only if the spec is missing. A spec without any parameter in it will not break the command.

The command also needs to be called with a correct token otherwise a 401 will be returned.