[ 
https://issues.apache.org/jira/browse/UNOMI-745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kevan Jahanshahi updated UNOMI-745:
-----------------------------------
    Description: 
Error after migration, rule refreshing system is broken:

 
{code:java}
  4851 2023-03-08T11:22:10,378 | ERROR | pool-16-thread-1 | RulesServiceImpl    
             | 234 - org.apache.unomi.services - 1.6.1 |  Error loading rules 
from persistence back-end
   4852 java.lang.NullPointerException: null
   4853         at 
org.apache.unomi.services.impl.ParserHelper$EventTypeConditionVisitor.visit(ParserHelper.java:193)
 ~[!/:?]
   4854         at 
org.apache.unomi.services.impl.ParserHelper.visitConditions(ParserHelper.java:90)
 ~[!/:?]
   4855         at 
org.apache.unomi.services.impl.ParserHelper.visitConditions(ParserHelper.java:102)
 ~[!/:?]
   4856         at 
org.apache.unomi.services.impl.ParserHelper.resolveConditionEventTypes(ParserHelper.java:169)
 ~[!/:?]
   4857         at 
org.apache.unomi.services.impl.rules.RulesServiceImpl.updateRulesByEventType(RulesServiceImpl.java:599)
 ~[!/:?]
   4858         at 
org.apache.unomi.services.impl.rules.RulesServiceImpl.getRulesByEventType(RulesServiceImpl.java:304)
 ~[!/:?]
   4859         at 
org.apache.unomi.services.impl.rules.RulesServiceImpl.refreshRules(RulesServiceImpl.java:277)
 [!/:?]
   4860         at 
org.apache.unomi.services.impl.rules.RulesServiceImpl$1.run(RulesServiceImpl.java:480)
 [!/:?]
   4861         at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
   4862         at 
java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
   4863         at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
 [?:?]
   4864         at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) 
[?:?]
   4865         at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) 
[?:?]
   4866         at java.lang.Thread.run(Thread.java:829) [?:?]{code}
The issue is in the ParserHelper: 
[https://github.com/apache/unomi/blob/unomi-root-1.6.1/services/src/main/java/org/apache/unomi/services/impl/ParserHelper.java#L193]

 

code on 1.6.1:
{code:java}
if (condition.getConditionType().getParentCondition() != null) {
    visitConditions(condition.getConditionType().getParentCondition(), this);
} {code}
Sad story but it have been fixed in master without any ticket and explaination 
for something completely unrelated 
(https://issues.apache.org/jira/browse/UNOMI-486, 
[https://github.com/apache/unomi/pull/387]):
{code:java}
if (condition.getConditionType() != null && 
condition.getConditionType().getParentCondition() != null) {       
    visitConditions(condition.getConditionType().getParentCondition(), this); 
}  {code}

  was:
Error after migration, rule refreshing system is broken:

 
{code:java}
  4851 2023-03-08T11:22:10,378 | ERROR | pool-16-thread-1 | RulesServiceImpl    
             | 234 - org.apache.unomi.services - 1.6.1 |  Error loading rules 
from persistence back-end
   4852 java.lang.NullPointerException: null
   4853         at 
org.apache.unomi.services.impl.ParserHelper$EventTypeConditionVisitor.visit(ParserHelper.java:193)
 ~[!/:?]
   4854         at 
org.apache.unomi.services.impl.ParserHelper.visitConditions(ParserHelper.java:90)
 ~[!/:?]
   4855         at 
org.apache.unomi.services.impl.ParserHelper.visitConditions(ParserHelper.java:102)
 ~[!/:?]
   4856         at 
org.apache.unomi.services.impl.ParserHelper.resolveConditionEventTypes(ParserHelper.java:169)
 ~[!/:?]
   4857         at 
org.apache.unomi.services.impl.rules.RulesServiceImpl.updateRulesByEventType(RulesServiceImpl.java:599)
 ~[!/:?]
   4858         at 
org.apache.unomi.services.impl.rules.RulesServiceImpl.getRulesByEventType(RulesServiceImpl.java:304)
 ~[!/:?]
   4859         at 
org.apache.unomi.services.impl.rules.RulesServiceImpl.refreshRules(RulesServiceImpl.java:277)
 [!/:?]
   4860         at 
org.apache.unomi.services.impl.rules.RulesServiceImpl$1.run(RulesServiceImpl.java:480)
 [!/:?]
   4861         at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
   4862         at 
java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
   4863         at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
 [?:?]
   4864         at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) 
[?:?]
   4865         at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) 
[?:?]
   4866         at java.lang.Thread.run(Thread.java:829) [?:?]{code}
The issue is in the ParserHelper: 
[https://github.com/apache/unomi/blob/unomi-root-1.6.1/services/src/main/java/org/apache/unomi/services/impl/ParserHelper.java#L193]

 

code on 1.6.1:
{code:java}
if (condition.getConditionType().getParentCondition() != null) {
    visitConditions(condition.getConditionType().getParentCondition(), this);
} {code}
Sad story but it have been fixed in master without any ticket and explaination:
{code:java}
if (condition.getConditionType() != null && 
condition.getConditionType().getParentCondition() != null) {       
    visitConditions(condition.getConditionType().getParentCondition(), this); 
}  {code}


> Issue after migrating to 1.6.1
> ------------------------------
>
>                 Key: UNOMI-745
>                 URL: https://issues.apache.org/jira/browse/UNOMI-745
>             Project: Apache Unomi
>          Issue Type: Bug
>    Affects Versions: unomi-1.6.0, unomi-1.6.1, unomi-1.7.0, unomi-1.8.0, 
> unomi-1.7.1
>            Reporter: Kevan Jahanshahi
>            Priority: Major
>
> Error after migration, rule refreshing system is broken:
>  
> {code:java}
>   4851 2023-03-08T11:22:10,378 | ERROR | pool-16-thread-1 | RulesServiceImpl  
>                | 234 - org.apache.unomi.services - 1.6.1 |  Error loading 
> rules from persistence back-end
>    4852 java.lang.NullPointerException: null
>    4853         at 
> org.apache.unomi.services.impl.ParserHelper$EventTypeConditionVisitor.visit(ParserHelper.java:193)
>  ~[!/:?]
>    4854         at 
> org.apache.unomi.services.impl.ParserHelper.visitConditions(ParserHelper.java:90)
>  ~[!/:?]
>    4855         at 
> org.apache.unomi.services.impl.ParserHelper.visitConditions(ParserHelper.java:102)
>  ~[!/:?]
>    4856         at 
> org.apache.unomi.services.impl.ParserHelper.resolveConditionEventTypes(ParserHelper.java:169)
>  ~[!/:?]
>    4857         at 
> org.apache.unomi.services.impl.rules.RulesServiceImpl.updateRulesByEventType(RulesServiceImpl.java:599)
>  ~[!/:?]
>    4858         at 
> org.apache.unomi.services.impl.rules.RulesServiceImpl.getRulesByEventType(RulesServiceImpl.java:304)
>  ~[!/:?]
>    4859         at 
> org.apache.unomi.services.impl.rules.RulesServiceImpl.refreshRules(RulesServiceImpl.java:277)
>  [!/:?]
>    4860         at 
> org.apache.unomi.services.impl.rules.RulesServiceImpl$1.run(RulesServiceImpl.java:480)
>  [!/:?]
>    4861         at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
>    4862         at 
> java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
>    4863         at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
>  [?:?]
>    4864         at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>  [?:?]
>    4865         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>  [?:?]
>    4866         at java.lang.Thread.run(Thread.java:829) [?:?]{code}
> The issue is in the ParserHelper: 
> [https://github.com/apache/unomi/blob/unomi-root-1.6.1/services/src/main/java/org/apache/unomi/services/impl/ParserHelper.java#L193]
>  
> code on 1.6.1:
> {code:java}
> if (condition.getConditionType().getParentCondition() != null) {
>     visitConditions(condition.getConditionType().getParentCondition(), this);
> } {code}
> Sad story but it have been fixed in master without any ticket and 
> explaination for something completely unrelated 
> (https://issues.apache.org/jira/browse/UNOMI-486, 
> [https://github.com/apache/unomi/pull/387]):
> {code:java}
> if (condition.getConditionType() != null && 
> condition.getConditionType().getParentCondition() != null) {       
>     visitConditions(condition.getConditionType().getParentCondition(), this); 
> }  {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to