Hi guys, We're having a strange issue with a query rule on one of

A Score Level 1
Hi guys,

We're having a strange issue with a query rule on one of our sites. We're seeing 'Error evaluating function 'queryruleexec' : Unexpected error executing query' in the front-end and this in the logs:

14:33:26,501 INFO [stdout] (ajp-/0.0.0.0:8009-36) 2015-05-27 14:33:26,499 [ajp-/0.0.0.0:8009-36] ERROR com.appiancorp.suiteapi.content.ContentAccess - An error occurred while trying to test the rule: [Content:id=null,name=tyutyu,type=32,subtype=1,visibility=35,security=143,attributes={dep_functions=[Ljava.lang.String;@691f04b6, dep_rules=[Ljava.lang.Long;@736e7ea4, definition=#"84b9b493-3954-4456-8f78-9376bf6ec92d"("Enable Therapy Services", "Moving Minds")
14:33:26,501 INFO [stdout] (ajp-/0.0.0.0:8009-36)
14:33:26,501 INFO [stdout] (ajp-/0.0.0.0:8009-36) , dep_types=[Ljava.lang.String;@5b3c7c30, dep_variables=[[Ljava.lang.String;@5ffd621b}]
14:33:26,501 INFO [stdout] (ajp-/0.0.0.0:8009-36) com.appiancorp.process.expression.E...

OriginalPostID-150460

OriginalPostID-150460

  Discussion posts and replies are publicly visible

  • ...xpressionRuntimeException$AppianExceptionProvider: Expression evaluation error in rule 'mm_clientgroupbynameprovider' at function 'queryruleexec': Error evaluating function 'queryruleexec' : Unexpected error executing query (type: [MMClientGroupDT393], query: [MM_ClientGroupByNameProvider], order by: [[]], filters:[((Provider.Name = TypedValue[it=3,v=Moving Minds]) AND (Name = TypedValue[it=3,v=Enable Therapy Services]))]) (APNX-1-4198-000)

    This suggested a problem with the Provider nested CDT. I changed this in the database to use a different ProviderID and the rule worked fine. I changed it back to the old ProviderID and it breaks again. We've tested the rule with other ClientNames for that ProviderID and it works without problems. Any ideas?

    The caused by items are below:

    14:33:26,520 INFO [stdout] (ajp-/0.0.0.0:8009-36) Caused by: com.appiancorp.suiteapi.common.exceptions.AppianRuntimeException: com.appiancorp.suiteapi.common.exceptions.AppianException: Unex...
  • ...pected error executing query (type: [MMClientGroupDT393], query: [MM_ClientGroupByNameProvider], order by: [[]], filters:[((Provider.Name = TypedValue[it=3,v=Moving Minds]) AND (Name = TypedValue[it=3,v=Enable Therapy Services]))]) (APNX-1-4164-028)

    14:33:26,523 INFO [stdout] (ajp-/0.0.0.0:8009-36) Caused by: org.hibernate.TransientObjectException: The instance was not associated with this session

    Thanks!
  • 0
    Certified Lead Developer
    I've seen this sort of error before when the data in the database has something incorrect e.g badly formatted dates 00-00-0000 or if you've got any foreign constraints that ate being violated. Might be worth checking the data in each column for the one that is failing
  • @carolines Hi, to confirm the error, digging much deeper into the logs is suggested. As suggested by rodgraham, if there are any such kind of issues, logs will clearly show them AFAIK. For instance, invalid foreign key will be represented by 'No row with the given identifier exists' and badly formatted date will be represented with 'Value '0000-00-00' can not be represented as java.sql.Timestamp' and so on.
  • Has anyone found the solution for this error : APNX-1-4164-028?

    We are getting the same error and we cross checked the view to make sure there isn't any invalid date formats.

    21:35:14,295 INFO [stdout] (Appian Work Item - 59831 - execution01 : ExpressionGroupRequest) Caused by: com.appiancorp.suiteapi.common.exceptions.AppianRuntimeException: com.appiancorp.suiteapi.common.exceptions.AppianException: Unexpected error executing query (type: [XXXViewDT8164], query: [queryentity expression], order by: [[Sort[userId asc]]], filters:[(userId in TypedValue[it=101,v={5184}])]) (APNX-1-4164-028)

    21:35:14,507 INFO [stdout] (Appian Work Item - 59835 - execution15 : ExpressionGroupRequest) Caused by: com.mysql.jdbc.exceptions.MySQLTimeoutException: Statement cancelled due to timeout or client request
  • Hello Srikanth,

    I have been in that error "MySQLTimeoutException" and seems like the timeout is 60 seconds or less so the bet way to approach this issue is as follows:
    * Avoid making joins using tables which are large because this might exceed the time used when querying the information.
    * If possible and worth it(the size is really big) create a Materialized view, actually this can improve your response time from the DB and the time will be transferred to the "transformation"
    * if you still want to deal with the join times use the "Explain select" ti will give you really good hints of the problems and how to solve them.
    * filter as much as possible and review indexes on your tables.

    hope this helps
    jose