-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
Description
Server: iRODS 4.3.2
Preconditions:
We execute a Python rule "myrule" via irule, and the rule does a callback to an iRods rule language rule "intfunction".
The rule intfunction returns an integer value calculated within a remote block.
Expected:
No errors in server log, integer value returned from intfunction to myrule.
Actual:
The integer value is misinterpreted, and the server log shows an exception "no to_python (by value) converter found for C++ type: int"
Issue can be reproduced using below iRODS rule intfunction:
intfunction(*output) {
remote("irods","null") {
*output = 42;
}
}
Example client rule myrule (executed via irule and Python rule engine) that shows issue:
def main(rule_args, callback, rei):
output = ""
ret = callback.intfunction(output)
callback.writeLine("stdout", "Answer is ={}=".format(ret))
input null
output ruleExecOut
iRule output: (note the asterisk as output instead of value 42)
irods@irods:/etc/irods$ irule -r irods_rule_engine_plugin-python-instance -F myrule.r
Answer is ={'code': 0, 'status': True, 'arguments': ['*']}=
irods@irods:/etc/irods$
RodsLog entry in syslog:
Jul 12 18:07:22 irods irodsServer[9422]: {"log_category":"rule_engine","log_level":"error","log_message":"caught python exception","python_exception":"TypeError: No to_python (by-value) converter found for C++ type: int\n","request_api_name":"EXEC_MY_RULE_AN","request_api_number":625,"request_api_version":"d","request_client_user":"rods","request_host":"127.0.0.1","request_proxy_user":"rods","request_release_version":"rods4.3.2","rule_engine_plugin":"python","server_host":"irods","server_pid":9422,"server_timestamp":"2024-07-12T18:07:22.652Z","server_type":"agent","server_zone":"tempZone"}