Python rule engine '[GenQueryOut*] not supported'] error

80 views
Skip to first unread message

wilson wilson

unread,
Feb 7, 2017, 9:44:54 AM2/7/17
to iRODS-Chat
hi,all
I had installed irods-4.2-stable on centos7,and then get https://github.com/irods/irods_rule_engine_plugin_python and make and install irods-rule-engine-plugin-python-4.2.0-1.x86_64.rpm.
After that, I follow the instructions of https://irods.org/2016/07/writing-rules-for-the-python-rule-engine/ by Rick Skarbez and write a my-pyhon-rule-language.r exactly the same with the content of iRODS Python example rule. But when i run:


irule -r irods_rule_engine_plugin-python-instance -F my-pyhon-rule-language.r


I got nothing. When I add debug info my-pyhon-rule-language.r
,I found the following error in /var/lib/irods/log/rodsLog:

callback.msiMakeGenQuery retVal={'status': True, 'output': ['DATA_NAME, DATA_SIZE', "COLL_NAME like '/tempZone/home/rods/menu1'", {'continueInx': '0', 'select_403': '1', 'select_407': '1', 'maxRows': '256', 'where_501': "like '/tempZone/home/rods/menu1'", 'rowOffset': '0', 'options': '0'}], 'code': 0L}
inDict={'continueInx': '0', 'select_403': '1', 'select_407': '1', 'maxRows': '256', 'where_501': "like '/tempZone/home/rods/menu1'", 'rowOffset': '0', 'options': '0'}
callback.msiExecGenQuery retVal={'status': True, 'output': [{'continueInx': '0', 'select_403': '1', 'select_407': '1', 'maxRows': '256', 'where_501': "like '/tempZone/home/rods/menu1'", 'rowOffset': '0', 'options': '0'}, '[GenQueryOut*] not supported'], 'code': 0L}


Seems that callback.msiMakeGenQuery worked but callback.msiExecGenQuery failed. What does '[GenQueryOut*] not supported'] mean? Any help would be appreciated!

Thanks,William
2017-02-07

Rick Skarbez

unread,
Feb 7, 2017, 11:42:50 AM2/7/17
to irod...@googlegroups.com
Hi William--

Thank you very much for your feedback! The Python rule engine plugin has not been officially released yet, but we are expecting to release soon, with a more sophisticated mechanism for interacting with iRODS types from within Python. So it may be in your interest to wait for that release.

The problem that you've run into is actually a bug in irods_re_serialization that results in GenQueryOut* objects not being eligible to be converted to Python dicts for use in the Python rule engine. If you have the ability or interest to install iRODS from source, this issue is fixed in the rule_engine_testing branch - https://github.com/irods/irods/tree/rule_engine_testing . You could checkout that branch, build, and install iRODS, and the problem you're seeing should be resolved. This will also be fixed with the release of iRODS 4.2.1 if you would rather wait for that.

-rick skarbez


--
--
"iRODS: the Integrated Rule-Oriented Data-management System; A community driven, open source, data grid software solution"   https://www.irods.org

 iROD-Chat:  http://groups.google.com/group/iROD-Chat

---
You received this message because you are subscribed to the Google Groups "iRODS-Chat" group.
To unsubscribe from this group and stop receiving emails from it, send an email to irod-chat+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

William

unread,
Feb 7, 2017, 11:28:26 PM2/7/17
to iRODS-Chat
hi,Rick
Thanks a lot for your reply! 
Following your advice, I get https://github.com/irods/irods/tree/rule_engine_testing and build and install iRODS, but when I run 

python /var/lib/irods/scripts/setup_irods.py

I got the following error:

[root@localhost build]# python /var/lib/irods/scripts/setup_irods.py 
Warning: Hostname `localhost` should be a fully qualified domain name.
Updating /var/lib/irods/VERSION.json...
The iRODS service account name needs to be defined.
iRODS user [irods]: 
iRODS group [irods]: 

+--------------------------------+
| Setting up the service account |
+--------------------------------+

Existing Group Detected: irods
Existing Account Detected: irods
Setting owner of /var/lib/irods to irods:irods
Setting owner of /etc/irods to irods:irods
iRODS server's role:
1. provider
2. consumer
Please select a number or choose 0 to enter a new value [1]: 1
Updating /etc/irods/server_config.json...

+-----------------------------------------+
| Configuring the database communications |
+-----------------------------------------+

You are configuring an iRODS database plugin. The iRODS server cannot be started until its database has been properly configured.

ODBC driver for postgres [PostgreSQL]: 
Database server's hostname or IP address [127.0.0.1]: 
Database server's port [5432]: 
Database name [ICAT]: 
Database username [irods]: 

-------------------------------------------
Database Type: postgres
ODBC Driver:   PostgreSQL
Database Host: 127.0.0.1
Database Port: 5432
Database Name: ICAT
Database User: irods
-------------------------------------------

Please confirm [yes]: 
Database password: 
Updating /etc/irods/server_config.json...
Listing database tables...
Salt for passwords stored in the database: 
Updating /etc/irods/server_config.json...

+--------------------------------+
| Configuring the server options |
+--------------------------------+

iRODS server's zone name [tempZone]: 
iRODS server's port [1247]: 
iRODS port range (begin) [20000]: 
iRODS port range (end) [20199]: 
Control Plane port [1248]: 
Schema Validation Base URI (or off) [file:///var/lib/irods/configuration_schemas]: 
iRODS server's administrator username [rods]: 

-------------------------------------------
Zone name:                  tempZone
iRODS server port:          1247
iRODS port range (begin):   20000
iRODS port range (end):     20199
Control plane port:         1248
Schema validation base URI: file:///var/lib/irods/configuration_schemas
iRODS server administrator: rods
-------------------------------------------

Please confirm [yes]: 
iRODS server's zone key: 
iRODS server's negotiation key (32 characters): 
Control Plane key (32 characters): 
Updating /etc/irods/server_config.json...

+-----------------------------------+
| Setting up the client environment |
+-----------------------------------+


iRODS server's administrator password: 

Updating /var/lib/irods/.irods/irods_environment.json...

+--------------------------+
| Setting up default vault |
+--------------------------+

iRODS Vault directory [/var/lib/irods/Vault]: 

+-------------------------+
| Setting up the database |
+-------------------------+

Listing database tables...
Creating database tables...

+-------------------+
| Starting iRODS... |
+-------------------+

Validating [/var/lib/irods/.irods/irods_environment.json]... Success
Validating [/var/lib/irods/VERSION.json]... Success
Validating [/etc/irods/server_config.json]... Success
Validating [/etc/irods/host_access_control_config.json]... Success
Validating [/etc/irods/hosts_config.json]... Success
Ensuring catalog schema is up-to-date...
Updating to schema version 2...
Updating to schema version 3...
Updating to schema version 4...
Updating to schema version 5...
Catalog schema is up-to-date.
Starting iRODS server...
Success

+---------------------+
| Attempting test put |
+---------------------+

Putting the test file into iRODS...
Error encountered running setup_irods:
Traceback (most recent call last):
  File "/var/lib/irods/scripts/setup_irods.py", line 436, in main
    setup_server(irods_config, json_configuration_file=options.json_configuration_file)
  File "/var/lib/irods/scripts/setup_irods.py", line 131, in setup_server
    test_put(irods_config)
  File "/var/lib/irods/scripts/setup_irods.py", line 145, in test_put
    irods.lib.execute_command(['iput', f.name])
  File "/var/lib/irods/scripts/irods/lib.py", line 134, in execute_command
    check_command_return(args, out, err, returncode, **kwargs)
  File "/var/lib/irods/scripts/irods/lib.py", line 117, in check_command_return
    indent(err))]))
IrodsError: Call to open process with ['iput', '/tmp/tmpO_v4vvdemoResc'] returned an error:
  Options passed to Popen:
  
  Return code: 2
  Standard output:
    
  Error output:
    remote addresses: 127.0.0.1 ERROR: [-] /home/irodsbuild/irods/lib/core/src/sockComm.cpp:1160:int sendStartupPack(rcComm_t *, int, int) :  status [SYS_INVALID_INPUT_PARAM]  errno [] -- message []
    [-] /home/irodsbuild/irods/lib/core/src/sockComm.cpp:1236:irods::error sendRodsMsg(irods::network_object_ptr, const char *, bytesBuf_t *, bytesBuf_t *, bytesBuf_t *, int, irodsProt_t) :  status [SYS_INVALID_INPUT_PARAM]  errno [] -- message [failed to resolve network interface]
    [-] /home/irodsbuild/irods/lib/core/src/irods_tcp_object.cpp:98:virtual irods::error irods::tcp_object::resolve(const std::string &, plugin_ptr &) :  status [SYS_INVALID_INPUT_PARAM]  errno [] -- message []
    [-] /home/irodsbuild/irods/lib/core/src/irods_network_manager.cpp:104:irods::error irods::network_manager::init_from_type(const int &, const std::string &, const std::string &, const std::string &, const std::string &, network_ptr &) :  status [SYS_INVALID_INPUT_PARAM]  errno [] -- message [Failed to load network plugin]
    [-] /home/irodsbuild/irods/lib/core/src/irods_network_manager.cpp:75:irods::error irods::load_network_plugin(network_ptr &, const std::string &, const std::string &, const std::string &) :  status [SYS_INVALID_INPUT_PARAM]  errno [] -- message []
    [-] /home/irodsbuild/irods/lib/core/include/irods_load_plugin.hpp:137:irods::error irods::load_plugin(PluginType *&, const std::string &, const std::string &, const std::string &, const std::string &) [PluginType = irods::network] :  status [SYS_INVALID_INPUT_PARAM]  errno [] -- message []
    [-] /home/irodsbuild/irods/lib/core/include/irods_load_plugin.hpp:66:irods::error irods::resolve_plugin_path(const std::string &, std::string &) :  status [SYS_INVALID_INPUT_PARAM]  errno [] -- message [does not exist [//usr/usr/lib/irods/plugins/network]]
    
    remote addresses: 127.0.0.1 ERROR: connectToRhost: sendStartupPack to localhost failed, status = -130000 status = -130000 SYS_INVALID_INPUT_PARAM
     ERROR: _rcConnect: connectToRhost error, server on localhost:1247 is probably down status = -130000 SYS_INVALID_INPUT_PARAM
Exiting...


Seem that /usr/usr/lib/irods/plugins/network path is a bug? I manually mkdir /usr/usr and then copy  plugins into /usr/usr/lib/irods/plugins/network,and then remove postgres database "ICAT" and run "python /var/lib/irods/scripts/setup_irods.py" again, and everythings seems fine, ils works.

After that, I run 


irule -r irods_rule_engine_plugin-python-instance -F my-pyhon-rule-language.r 


but the problem still exists,  in in /var/lib/irods/log/rodsLog: 

callback.msiMakeGenQuery retVal={'status': True, 'output': ['DATA_NAME, DATA_SIZE', "COLL_NAME like '/tempZone/home/rods/menu1'", {'continueInx': '0', 'select_403': '1', 'select_407': '1', 'maxRows': '256', 'where_501': "like '/tempZone/home/rods/menu1'", 'rowOffset': '0', 'options': '0'}], 'code': 0L} 
inDict={'continueInx': '0', 'select_403': '1', 'select_407': '1', 'maxRows': '256', 'where_501': "like '/tempZone/home/rods/menu1'", 'rowOffset': '0', 'options': '0'} 
callback.msiExecGenQuery retVal={'status': True, 'output': [{'continueInx': '0', 'select_403': '1', 'select_407': '1', 'maxRows': '256', 'where_501': "like '/tempZone/home/rods/menu1'", 'rowOffset': '0', 'options': '0'}, '[GenQueryOut*] not supported'], 'code': 0L} 


What else should I do?Do I miss something?
Thanks,William
2016-02-08 



Reply all
Reply to author
Forward
0 new messages