While loading a policy using REST API getting an error with message ": Unexpected scalar"

When i try to load a policy file using shell conjur policy load command it works perfectly fine. When i run that same file using python REST API i am getting an error with error message “policy_text Error at line 1, column 0 in : Unexpected scalar”.
My policy file is look like

- !policy 
  id: github
  - !variable username 
  - !variable password

I’d be suspicious of a hidden ascii character that Python is sensitive to, but Ruby is not (or we’re doing something in the CLI to sanitize the input).

1 Like

@wazeem.sds I agree with @nathan.whipple - even if you look at the way your policy snippet was formatted in your post, only part of it is in the code block. It looks like there might be an unexpected character in your policy.

If you try re-typing the policy, does it work? If not, can you re-share here with the entire snippet in a code block (between triple backticks)?

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.