The REST Operation action fails with the description: Cannot complete operation: null
When this happens you may also observe (in the details of the action's output) that the HTTP Response Code is: -1
The problem has several causes. Here are two:
1. The action's "Check Response Code [boolean]" field is set to true without a value being set in the "Expected Code [Integer]" field.
2. The "Include HTTP Headers In Response [boolean]" field is set to True|False (instead of No Value) without a value in the "Response File Path" field.
For problem #1 you need to either:
a. Provide a True value to the "Check Response Code [boolean]" field AND set the "Expected Code [Integer]" field with a value; or
b. Set "Check Response Code [boolean]" to False with "No Value" in the "Expected Code [Integer]" field.
For problem #2 you need to either:
a. Provide a True or False value to the "Include HTTP Headers In Response [boolean]" field AND set the "Response File Path" field to a valid value (the file can exist but doesn't have to but the directory must exist before the action attempts to write the file); or
b. Set "Include HTTP Headers In Response [boolean]" to "No Value".
NOTE 1:
It is worth mentioning that setting an actions field to "No Value" and removing all characters (blank/null value) are handled differently. If the above describes to use "No Value" in a field then you should put the cursor in the field and press the Ctrl+space keys to be given the list of value values from which you can select "No Value".
NOTE 2:
When #1 is the cause you might see the following message inside of the agent's nolio_all.log:
2017-02-10 16:38:58,668 [job-9-jobServer-9-6:REST Operation(P40.F100.E101):REST Operation] ERROR (com.nolio.platform.shared.datamodel.Action:181) - exception caught
java.lang.NullPointerException
at com.nolio.platform.shared.executables.actions.RESTAction.acceptResponse(RESTAction.java:118)
When #2 is the cause you might see the following message inside of the agent's nolio_all.log:
2017-02-10 16:51:02,374 [job-10-jobServer-10-6:REST Operation(P44.F110.E111):REST Operation] ERROR (com.nolio.platform.shared.datamodel.Action:181) - exception caught
java.lang.NullPointerException
at org.apache.commons.io.FileUtils.openOutputStream(FileUtils.java:223)
at org.apache.commons.io.FileUtils.writeStringToFile(FileUtils.java:1474)
at org.apache.commons.io.FileUtils.writeStringToFile(FileUtils.java:1489)
at com.nolio.platform.shared.executables.actions.RESTAction.acceptResponse(RESTAction.java:106)