I have not encounter this error previously. When I join two code block to an action block using the visual editor. A join_***_***_1 block will be created.
This auto generated block is using the the "code_name" parameter which is triggering the unexpected-keyword-arg error.
I believe by deleting this auto generated block would be able to resolve the problem. But making changes to this auto generated block, it will disable the visual editor, which is not the right situation.
Any other alternative solution to resolve this problem?
I am getting this today too.
This code_name is not valid per the docs, but its being placed there by the gui editor behind the scence. I cannot edit the join_ function without breaking the gui restrictions and going straight code. (classic playbook)
here is example:
@phanTom.playbook_block()
def code_7(action=None, success=None, container=None, results=None, handle=None, filtered_artifacts=None, filtered_results=None, custom_function=None, loop_state_json=None, **kwargs):
phantom.debug("code_7() called")
################################################################################
## Custom Code Start
################################################################################
# Write your custom code here...
################################################################################
## Custom Code End
################################################################################
join_code_9(container=container)
return
@phantom.playbook_block()
def code_8(action=None, success=None, container=None, results=None, handle=None, filtered_artifacts=None, filtered_results=None, custom_function=None, loop_state_json=None, **kwargs):
phantom.debug("code_8() called")
################################################################################
## Custom Code Start
################################################################################
# Write your custom code here...
################################################################################
## Custom Code End
################################################################################
join_code_9(container=container)
return
**** This part is auto generated by the SOAR GUI editor*****
@phantom.playbook_block()
def join_code_9(action=None, success=None, container=None, results=None, handle=None, filtered_artifacts=None, filtered_results=None, custom_function=None, loop_state_json=None, **kwargs):
phantom.debug("join_code_9() called")
if phantom.completed(code_names=["code_7", "code_8"]):
# call connected block "code_9"
code_9(container=container, handle=handle)
return
The phantom.completed method doesnt take a code_names param, the function accepts the following:
phantom.completed(action_names=None, playbook_names=None, custom_function_names=None, trace=False)
Check out https://docs.splunk.com/Documentation/Phantom/4.10.7/PlaybookAPI/PlaybookAPI#:~:text=action%20and%20... for more details on the phantom.completed method
🌟 Did this answer help you? If so, please consider:
Your feedback encourages the volunteers in this community to continue contributing
I see. Now I know why did the Validate Python report an error.
However, as mentioned earlier. This block of code is automatically generated when I ammend the visual editor. Changing the "code_names" to either "action_names" or "custom_function_names" will result in disabling the visual editor. Which would create a big trouble for my future development of this playbook.
you can replace "code_names" with "custom_function_names", it will pass linting and work, but like you said, it will force you out of the GUI editor. I've put in a support ticket. they should just update that GUI editor to use the documented parameter and we'll be back on track.
Thank you for raising the support ticket. But I am quite new to Splunk. May I know how long will splunk take to response to the ticket and resolve the bug.
Also, Just to check with you, this is a new error that just occur right? Because, I did not encounter this error weeks ago.
It would be worthwhile raising a Support ticket yourself aswell as @Butz ticket, this will add a little weight as demonstrates multiple users are affected by the issue.
You can access Support via https://www.splunk.com/support
🌟 Did this answer help you? If so, please consider:
Your feedback encourages the volunteers in this community to continue contributing