You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a script which needs to create a LTM policy with 1 condition and 2 corresponding actions. Creating the policy and empty rule works like a charm but when I try adding the condition and actions in a transaction it fails.
The issue I'm facing is maybe connected to the actions being added to the rule. When I run the script I receive the following output (rule is deleted manually before each run):
...loaded policy draft
...adding rule to policy policy-test-001
...create rule
...add condition
...add actions
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/f5/bigip/contexts.py", line 96, in __exit__
self.transaction.modify(state="VALIDATING",
File "/usr/lib/python3.9/site-packages/f5/bigip/resource.py", line 423, in modify
self._modify(**patch)
File "/usr/lib/python3.9/site-packages/f5/bigip/resource.py", line 408, in _modify
response = session.patch(patch_uri, json=patch, **requests_params)
File "/usr/lib/python3.9/site-packages/icontrol/session.py", line 295, in wrapper
raise iControlUnexpectedHTTPError(error_message, response=response)
icontrol.exceptions.iControlUnexpectedHTTPError: 400 Unexpected Error: Bad Request for uri: https://10.0.0.10:443/mgmt/tm/transaction/1683888226128082/
Text: '{"code":400,"message":"transaction failed:0107186c:3: Policy \'/Common/Drafts/policy-test-001\', rule \'rule-test.local\'; missing or invalid target.","errorStack":[],"apiError":2}'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/www/apps/f5-python/./cert.py", line 239, in
main(sys.argv[1:])
File "/var/www/apps/f5-python/./cert.py", line 236, in main
updatePolicy('Common','policy-test-001', serverName, virtualServerName, environment)
File "/var/www/apps/f5-python/./cert.py", line 184, in updatePolicy
rule.actions_s.actions.create(**cAction2)
File "/usr/lib/python3.9/site-packages/f5/bigip/contexts.py", line 100, in __exit__
raise TransactionSubmitException(e)
f5.sdk_exception.TransactionSubmitException: 400 Unexpected Error: Bad Request for uri: https://10.0.0.10:443/mgmt/tm/transaction/1683888226128082/
Text: '{"code":400,"message":"transaction failed:0107186c:3: Policy \'/Common/Drafts/policy-test-001\', rule \'rule-test.local\'; missing or invalid target.","errorStack":[],"apiError":2}'
If I comment out the second action additition rule.actions_s.actions.create(**cAction2) I receive the same error referencing rule.actions_s.actions.create(**cAction1).
If both action lines are removed from the code the policy is updated but with only the condition.
Is this an actual issue or am I just doing this the wrong way?
The text was updated successfully, but these errors were encountered:
Running on Big-IP 16.1.3.4 using Python 3.9.16
I'm working on a script which needs to create a LTM policy with 1 condition and 2 corresponding actions. Creating the policy and empty rule works like a charm but when I try adding the condition and actions in a transaction it fails.
The issue I'm facing is maybe connected to the actions being added to the rule. When I run the script I receive the following output (rule is deleted manually before each run):
If I comment out the second action additition rule.actions_s.actions.create(**cAction2) I receive the same error referencing rule.actions_s.actions.create(**cAction1).
If both action lines are removed from the code the policy is updated but with only the condition.
Is this an actual issue or am I just doing this the wrong way?
The text was updated successfully, but these errors were encountered: