General iRODS rule/microservice issues, perhaps missing something during install?

126 views
Skip to first unread message

Gijs Noorlander

unread,
May 24, 2017, 3:37:16 AM5/24/17
to iRODS-Chat
I was trying to get some basic rules to work, but I keep getting one obscure error after the other.
So just to test, I tried some examples from the iRODS microservices book: https://irods.org/uploads/2015/01/irods4-microservices-book-web.pdf
For example this one on page 171 of the book:
myTestRule {
# Input parameters are:
# Key-value buffer (may be empty)
# Key
# Value
 msiGetSystemTime(*Time, "human");
 msiAddKeyVal(*Keyval, "TimeStamp", *Time);
 msiAssociateKeyValuePairsToObj(*Keyval,*Coll,"-C");
 msiGetCollectionPSmeta(*Coll,*Buf);
 writeBytesBuf("stdout", *Buf);
}
INPUT *Coll="/$rodsZoneClient/home/$userNameClient/sub1"
OUTPUT ruleExecOut

Which results in:
gijs@dop232:~$ irule -F myTestRule.r 
remote addresses: 127.0.0.1 ERROR: rcExecMyRule error.  status = -1097000 NO_RULE_OR_MSI_FUNCTION_FOUND_ERR
Level 0: DEBUG: error: cannot find rule for action "msiGetCollectionPSmeta" available: 102.
line 8, col 1
 msiGetCollectionPSmeta(*Coll,*Buf);
 ^

Apparently "msiGetCollectionPSmeta" is not available.

So my question is; What am I missing, since even simple textbook examples do not seem to be working?
I run iRODS 4.2.0 on Ubuntu 14.04.

My goal is to write a simple rule that will create a collection (if not exist), add some AVU's to this collection.
But even "msiSetAVU("-C", *Coll, *Attname, *Attvalue, *Attunit);
does not work for the same reason and the following gives boost::anycast errors:
addAVUMetadataToColl(*Coll, *Attname, *Attvalue, *Attunit, *Status) {
# add metadata to a collection
  *Status = "1";
#  msiSetAVU("-C", *Coll, *Attname, *Attvalue, *Attunit);
  msiAddKeyVal(*keyval, *Attname, *Attvalue);
  writeKeyValPairs('stdout', *keyval, " is : ");
#  msiAddKeyVal(*Keyval, *Attname, *Attvalue);
#  msiAssociateKeyValuePairsToObj(*Keyval,*Coll,"-C");
  *Status = "0";
}


Output in the logs (N.B. other install, other test rule):
May 24 07:29:39 pid:29899 NOTICE: msiWriteRodsLog message: Collection created: /tempZone/home/rods/sub1 <- 123, 345, 
May 24 07:29:39 pid:29899 remote addresses: 127.0.0.1, 192.168.102.1 ERROR: rsExecMyRule : -1822000, [-]        /home/irodsbuild/irods/server/re/include/irods_re_plugin.hpp:238:irods::error irods::pluggable_rule_engine<std::__1::tuple<> >::exec_rule_text(std::string, T &, irods::callback, As &&...) [T = std::__1::tuple<>, As = <std::__1::tuple<>, irods::callback, MsParamArray *, std::__1::basic_string<char> *, RuleExecInfo *>] :  status [INVALID_ANY_CAST]  errno [] -- message [failed to extract exec_rule_text operation from instance [irods_rule_engine_plugin-irods_rule_language-instance] exception message [boost::bad_any_cast: failed conversion using boost::any_cast]]

So in short, what am I missing here?




Gijs Noorlander

unread,
May 30, 2017, 7:59:23 AM5/30/17
to iRODS-Chat
Nobody with any idea what is wrong here?
Maybe something missing in the 4.2 branch, when running a clean install of iRODS 4.2?
Or has it something to do with this change from the changelog or 4.2?
Pluggable Rule Engine - Seventh plugin interface now supports writing rule engines for any language. The iRODS Rule Language has been moved to a plugin, alongside a default policy C++ rule engine.

Reagan Moore

unread,
May 30, 2017, 8:54:27 AM5/30/17
to irod...@googlegroups.com
Some of the rules in the microservices book require the use of microservice plugins.  Contact Antoine de Torcy.

Reagan Moore



--
--
"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+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gijs Noorlander

unread,
May 30, 2017, 9:22:22 AM5/30/17
to iRODS-Chat
Thanks for the reply.

Do you mean "irods-microservice-plugins-curl"? This is already installed.
But I will also Antoine.

Gijs

de Torcy, Antoine

unread,
May 30, 2017, 11:51:34 PM5/30/17
to iRODS-Chat

Hello,


The source for msiGetCollectionPSmeta and other legacy microservices can be found at https://github.com/DICE-UNC/microservices.


Please note that this package was last built for iRODS 4.1 and would likely need updating to work with 4.2. It contains microservices that came standard with iRODS 2 and 3 (hence their use in the book) but have been deprecated and are no longer supported by the iRODS consortium. They will be removed from any future installments of the microservice workbook.


Back to your example, to get the metadata associated with an object you can define and execute a query, which is now easy to do with the rule language, e.g:

msiSplitPath(*obj_path, *coll_name, *obj_name);
foreach(*row in select META_DATA_ATTR_NAME, META_DATA_ATTR_VALUE, META_DATA_ATTR_UNITS where COLL_NAME =*coll_name and DATA_NAME =*obj_name) {
    writeLine('serverlog', 'ATTRIBUTE=[*row.META_DATA_ATTR_NAME]')
    writeLine('serverlog', 'VALUE=[*row.META_DATA_ATTR_VALUE]')
    #etc...
}


Antoine



From: irod...@googlegroups.com <irod...@googlegroups.com> on behalf of Gijs Noorlander <gijs.no...@gmail.com>
Sent: Tuesday, May 30, 2017 9:22:22 AM
To: iRODS-Chat
Subject: Re: [iROD-Chat:16466] Re: General iRODS rule/microservice issues, perhaps missing something during install?
 
Reply all
Reply to author
Forward
0 new messages