Cassandra DB update script contains create trigger command #191
amitpriyadarshi
started this conversation in
Bugs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@pallakartheekreddy in the new setup OCI DOCK env, while calling update hierarchy api in content service we found below exception. It was related to trigger.
ERROR [Native-Transport-Requests-1] 2024-03-07 08:59:11,348 QueryMessage.java:129 - Unexpected error during query java.lang.RuntimeException: Exception while executing trigger on table with ID: bb340dc0-d6cb-11ee-b9d3-3bad88fbaa4a at org.apache.cassandra.triggers.TriggerExecutor.executeInternal(TriggerExecutor.java:246) at org.apache.cassandra.triggers.TriggerExecutor.execute(TriggerExecutor.java:124) at org.apache.cassandra.service.StorageProxy.mutateWithTriggers(StorageProxy.java:959) at org.apache.cassandra.cql3.statements.ModificationStatement.executeWithoutCondition(ModificationStatement.java:435) at org.apache.cassandra.cql3.statements.ModificationStatement.execute(ModificationStatement.java:421) at org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:243) at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:274) at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:259) at org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:116) at org.apache.cassandra.transport.Message$Dispatcher.processRequest(Message.java:688) at org.apache.cassandra.transport.Message$Dispatcher.lambda$channelRead0$0(Message.java:594) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:162) at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:113) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.apache.cassandra.triggers.TriggerExecutor.loadTriggerInstance(TriggerExecutor.java:259) at org.apache.cassandra.triggers.TriggerExecutor.executeInternal(TriggerExecutor.java:231) ... 14 common frames omitted Caused by: com.fasterxml.jackson.databind.JsonMappingException: Scala module 2.9.9 requires Jackson Databind version >= 2.9.0 and < 2.10.0 at com.fasterxml.jackson.module.scala.JacksonModule$class.setupModule(JacksonModule.scala:61) at com.fasterxml.jackson.module.scala.DefaultScalaModule.setupModule(DefaultScalaModule.scala:17) at com.fasterxml.jackson.databind.ObjectMapper.registerModule(ObjectMapper.java:853) at org.sunbird.cassandra.triggers.TransactionEventTrigger.<init>(TransactionEventTrigger.scala:28) ... 20 common frames omitted ERROR [Native-Transport-Requests-1] 2024-03-07 08:59:11,349 ErrorMessage.java:384 - Unexpected exception during request java.lang.RuntimeException: Exception while executing trigger on table with ID: bb340dc0-d6cb-11ee-b9d3-3bad88fbaa4a at org.apache.cassandra.triggers.TriggerExecutor.executeInternal(TriggerExecutor.java:246) at org.apache.cassandra.triggers.TriggerExecutor.execute(TriggerExecutor.java:124) at org.apache.cassandra.service.StorageProxy.mutateWithTriggers(StorageProxy.java:959) at org.apache.cassandra.cql3.statements.ModificationStatement.executeWithoutCondition(ModificationStatement.java:435) at org.apache.cassandra.cql3.statements.ModificationStatement.execute(ModificationStatement.java:421) at org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:243) at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:274) at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:259) at org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:116) at org.apache.cassandra.transport.Message$Dispatcher.processRequest(Message.java:688) at org.apache.cassandra.transport.Message$Dispatcher.lambda$channelRead0$0(Message.java:594) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:162) at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:113) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.apache.cassandra.triggers.TriggerExecutor.loadTriggerInstance(TriggerExecutor.java:259) at org.apache.cassandra.triggers.TriggerExecutor.executeInternal(TriggerExecutor.java:231) ... 14 common frames omitted Caused by: com.fasterxml.jackson.databind.JsonMappingException: Scala module 2.9.9 requires Jackson Databind version >= 2.9.0 and < 2.10.0 at com.fasterxml.jackson.module.scala.JacksonModule$class.setupModule(JacksonModule.scala:61) at com.fasterxml.jackson.module.scala.DefaultScalaModule.setupModule(DefaultScalaModule.scala:17) at com.fasterxml.jackson.databind.ObjectMapper.registerModule(ObjectMapper.java:853) at org.sunbird.cassandra.triggers.TransactionEventTrigger.<init>(TransactionEventTrigger.scala:28) ... 20 common frames omitted
Also, we found there are 4 trigger creation script in the below url link:
https://github.com/Sunbird-Knowlg/sunbird-learning-platform/blob/release-5.5.0/ansible/roles/cassandra-db-update/templates/data.cql.j2
CREATE TRIGGER IF NOT EXISTS content_data_trigger ON {{ content_keyspace_name }}.content_data USING 'org.sunbird.cassandra.triggers.TransactionEventTrigger'; CREATE TRIGGER IF NOT EXISTS question_data_trigger ON {{ content_keyspace_name }}.question_data USING 'org.sunbird.cassandra.triggers.TransactionEventTrigger'; CREATE TRIGGER IF NOT EXISTS framework_hierarchy_trigger ON {{ hierarchy_keyspace_name }}.framework_hierarchy USING 'org.sunbird.cassandra.triggers.TransactionEventTrigger'; CREATE TRIGGER IF NOT EXISTS content_hierarchy_trigger ON {{ hierarchy_keyspace_name }}.content_hierarchy USING 'org.sunbird.cassandra.triggers.TransactionEventTrigger';
this file is used for cassandra db update for new instance setup. During which these trigger gets created and causing issue.
post dropping these triggers, issue got resolved.
cc: @vinukumar-vs
Beta Was this translation helpful? Give feedback.
All reactions