Conjur - Error loading policy , Invalid syntax in YAML file
94
Created On 11/10/26 10:56 AM - Last Modified 11/10/26 12:57 PM
Symptom
error: undefined method `each_with_index' for nil:NilClass
Cause
Invalid syntax in YAML file.
[root@conjur-ee01 ConjurRESTAPI]# cat YML-Policy.yml
---
- !policy
id: test_policy
...
[root@conjur-ee01 ConjurRESTAPI]# conjur policy load YML-Policy.yml
error: undefined method `each_with_index' for nil:NilClass
Resolution
Add body: [] as per sample below:
[root@conjur-ee01 ConjurRESTAPI]# cat YML-Policy.yml
---
- !policy
id: test_policy
body: []
...
[root@conjur-ee01 ConjurRESTAPI]# conjur policy load YML-Policy.yml
Authenticating andyg
Create policy role 'test_policy'
Create policy resource 'test_policy'
{}
Additional Information
Details
SYMPTOM: -
Error loading policy with the following error:
error: undefined method `each_with_index' for nil:NilClass
PROBLEM: -
Invalid syntax in YAML file.
[root@conjur-ee01 ConjurRESTAPI]# cat YML-Policy.yml
---
- !policy
id: test_policy
...
[root@conjur-ee01 ConjurRESTAPI]# conjur policy load YML-Policy.yml
error: undefined method `each_with_index' for nil:NilClass
SOLUTION: -
Add body: [] as per sample below:
[root@conjur-ee01 ConjurRESTAPI]# cat YML-Policy.yml
---
- !policy
id: test_policy
body: []
...
[root@conjur-ee01 ConjurRESTAPI]# conjur policy load YML-Policy.yml
Authenticating andyg
Create policy role 'test_policy'
Create policy resource 'test_policy'
{}