Project

General

Profile

Tigase "loses" PubSub node after restart but it is still in the database

Gabriel Rossetti
Added about 4 years ago

Hi,

I have an issue with pubsub on Tigase 5.2.1-b3461 (windows). I create a node:

<iq type='set' from='admin@test.com/toto' to='pubsub.test.com' id='create1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <create node='test'/>
  </pubsub>
</iq>

and I can see it fine, I kill the server and start it up again and in PSI I no longer see the node, so I try:

<iq type='get' from='admin@test.com/toto' to='pubsub.test.com' id='1'>
  <query xmlns='http://jabber.org/protocol/disco#items'/>
</iq>

and I get this back:

<iq from="pubsub.test.com" type="result" id="1" to="admin@test.com/toto">
<query xmlns="http://jabber.org/protocol/disco#items"/>
</iq>

as you see it lost the node, but when I try to create it again:

I get this exceptoion in Tigase:

java.sql.SQLException: The exception 'java.sql.SQLException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'TIG_PUBSUB_NODES_SERVICE_ID_NAME' defined on 'TIG_PUBSUB_NODES'.' was thrown while evaluating an expression.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedCallableStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeQuery(Unknown Source)
        at tigase.pubsub.repository.PubSubDAOJDBC.createNode(PubSubDAOJDBC.java:193)
        at tigase.pubsub.repository.PubSubDAOPool.createNode(PubSubDAOPool.java:84)
        at tigase.pubsub.repository.cached.CachedPubSubRepository.createNode(CachedPubSubRepository.java:342)
        at tigase.pubsub.repository.PubSubRepositoryWrapper.createNode(PubSubRepositoryWrapper.java:23)
        at tigase.pubsub.modules.NodeCreateModule.process(NodeCreateModule.java:219)
        at tigase.component2.modules.ModulesManager.process(ModulesManager.java:87)
        at tigase.component2.AbstractComponent.processStanzaPacket(AbstractComponent.java:200)
        at tigase.component2.AbstractComponent.processPacket(AbstractComponent.java:188)
        at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1475)
Caused by: java.sql.SQLException: The exception 'java.sql.SQLException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'TIG_PUBSUB_NODES_SERVICE_ID_NAME' defined on 'TIG_PUBSUB_NODES'.' was thrown while evaluating an expression.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
        ... 20 more
Caused by: java.sql.SQLException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'TIG_PUBSUB_NODES_SERVICE_ID_NAME' defined on 'TIG_PUBSUB_NODES'.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
        at tigase.pubsub.repository.derby.StoredProcedures.tigPubSubCreateNode(StoredProcedures.java:110)
        at org.apache.derby.exe.accc4c01a0x0149xcdfcx83c2x00000a020e203.g0(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown Source)
        at org.apache.derby.impl.sql.execute.CallStatementResultSet.open(Unknown Source)
        at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
        at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
        ... 13 more
Caused by: ERROR 23505: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'TIG_PUBSUB_NODES_SERVICE_ID_NAME' defined on 'TIG_PUBSUB_NODES'.
        at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
        at org.apache.derby.impl.sql.execute.IndexChanger.insertAndCheckDups(Unknown Source)
        at org.apache.derby.impl.sql.execute.IndexChanger.doInsert(Unknown Source)
        at org.apache.derby.impl.sql.execute.IndexChanger.insert(Unknown Source)
        at org.apache.derby.impl.sql.execute.IndexSetChanger.insert(Unknown Source)
        at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(Unknown Source)
        at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown Source)
        at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source)
        at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
        at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
        ... 26 more
        at tigase.pubsub.repository.PubSubDAOJDBC.createNode(PubSubDAOJDBC.java:207)
        at tigase.pubsub.repository.PubSubDAOPool.createNode(PubSubDAOPool.java:84)
        at tigase.pubsub.repository.cached.CachedPubSubRepository.createNode(CachedPubSubRepository.java:342)
        at tigase.pubsub.repository.PubSubRepositoryWrapper.createNode(PubSubRepositoryWrapper.java:23)
        at tigase.pubsub.modules.NodeCreateModule.process(NodeCreateModule.java:219)
        at tigase.component2.modules.ModulesManager.process(ModulesManager.java:87)
        at tigase.component2.AbstractComponent.processStanzaPacket(AbstractComponent.java:200)
        at tigase.component2.AbstractComponent.processPacket(AbstractComponent.java:188)
        at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1475)
Caused by: java.sql.SQLException: The exception 'java.sql.SQLException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'TIG_PUBSUB_NODES_SERVICE_ID_NAME' defined on 'TIG_PUBSUB_NODES'.' was thrown while evaluating an expression.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedCallableStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeQuery(Unknown Source)
        at tigase.pubsub.repository.PubSubDAOJDBC.createNode(PubSubDAOJDBC.java:193)
        ... 8 more
Caused by: java.sql.SQLException: The exception 'java.sql.SQLException: The statement was aborted because it would have caused a duplicate key value in a un ique or primary key constraint or unique index identified by 'TIG_PUBSUB_NODES_SERVICE_ID_NAME' defined on 'TIG_PUBSUB_NODES'.' was thrown while evaluating an expression.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
        ... 20 more
Caused by: java.sql.SQLException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'TIG_PUBSUB_NODES_SERVICE_ID_NAME' defined on 'TIG_PUBSUB_NODES'.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
        at tigase.pubsub.repository.derby.StoredProcedures.tigPubSubCreateNode(StoredProcedures.java:110)
        at org.apache.derby.exe.accc4c01a0x0149xcdfcx83c2x00000a020e203.g0(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown Source)
        at org.apache.derby.impl.sql.execute.CallStatementResultSet.open(Unknown Source)
        at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
        at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
        ... 13 more
Caused by: ERROR 23505: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'TIG_PUBSUB_NODES_SERVICE_ID_NAME' defined on 'TIG_PUBSUB_NODES'.
        at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
        at org.apache.derby.impl.sql.execute.IndexChanger.insertAndCheckDups(Unknown Source)
        at org.apache.derby.impl.sql.execute.IndexChanger.doInsert(Unknown Source)
        at org.apache.derby.impl.sql.execute.IndexChanger.insert(Unknown Source)
        at org.apache.derby.impl.sql.execute.IndexSetChanger.insert(Unknown Source)
        at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(Unknown Source)
        at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown Source)
        at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source)
        at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
        at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
        ... 26 more
2014-11-20 17:27:35.881 [in_6-pubsub]      AbstractComponent.processStanzaPacket()  SEVERE: tigase.pubsub.repository.RepositoryException: Problem accessing repository. when processing from=sess-man@test.test.com, to=null, DATA=<iq id="create1" from="admin@test.com/test" to="pubsub.test.com" xmlns="jabber:client" type="set">
  <pubsub xmlns="http://jabber.org/protocol/pubsub">
    <create node="test"/>
  </pubsub>
</iq>, SIZE=217, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=ADMIN, TYPE=set
java.lang.RuntimeException: tigase.pubsub.repository.RepositoryException: Problem accessing repository.
        at tigase.pubsub.modules.NodeCreateModule.process(NodeCreateModule.java:269)
        at tigase.component2.modules.ModulesManager.process(ModulesManager.java:87)
        at tigase.component2.AbstractComponent.processStanzaPacket(AbstractComponent.java:200)
        at tigase.component2.AbstractComponent.processPacket(AbstractComponent.java:188)
        at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1475)
Caused by: tigase.pubsub.repository.RepositoryException: Problem accessing repository.
        at tigase.pubsub.repository.PubSubDAOJDBC.createNode(PubSubDAOJDBC.java:207)
        at tigase.pubsub.repository.PubSubDAOPool.createNode(PubSubDAOPool.java:84)
        at tigase.pubsub.repository.cached.CachedPubSubRepository.createNode(CachedPubSubRepository.java:342)
        at tigase.pubsub.repository.PubSubRepositoryWrapper.createNode(PubSubRepositoryWrapper.java:23)
        at tigase.pubsub.modules.NodeCreateModule.process(NodeCreateModule.java:219)
        at tigase.component2.modules.ModulesManager.process(ModulesManager.java:87)
        at tigase.component2.AbstractComponent.processStanzaPacket(AbstractComponent.java:200)
        at tigase.component2.AbstractComponent.processPacket(AbstractComponent.java:188)
        at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1475)
Caused by: java.sql.SQLException: The exception 'java.sql.SQLException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'TIG_PUBSUB_NODES_SERVICE_ID_NAME' defined on 'TIG_PUBSUB_NODES'.' was thrown while evaluating an expression.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedCallableStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeQuery(Unknown Source)
        at tigase.pubsub.repository.PubSubDAOJDBC.createNode(PubSubDAOJDBC.java:193)
        at tigase.pubsub.repository.PubSubDAOPool.createNode(PubSubDAOPool.java:84)
        at tigase.pubsub.repository.cached.CachedPubSubRepository.createNode(CachedPubSubRepository.java:342)
        at tigase.pubsub.repository.PubSubRepositoryWrapper.createNode(PubSubRepositoryWrapper.java:23)
        at tigase.pubsub.modules.NodeCreateModule.process(NodeCreateModule.java:219)
        at tigase.component2.modules.ModulesManager.process(ModulesManager.java:87)
        at tigase.component2.AbstractComponent.processStanzaPacket(AbstractComponent.java:200)
        at tigase.component2.AbstractComponent.processPacket(AbstractComponent.java:188)
        at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1475)
Caused by: java.sql.SQLException: The exception 'java.sql.SQLException: The statement was aborted because it would have caused a duplicate key value in a un ique or primary key constraint or unique index identified by 'TIG_PUBSUB_NODES_SERVICE_ID_NAME' defined on 'TIG_PUBSUB_NODES'.' was thrown while evaluating an expression.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedCallableStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeQuery(Unknown Source)
        at tigase.pubsub.repository.PubSubDAOJDBC.createNode(PubSubDAOJDBC.java:193)
        at tigase.pubsub.repository.PubSubDAOPool.createNode(PubSubDAOPool.java:84)
        at tigase.pubsub.repository.cached.CachedPubSubRepository.createNode(CachedPubSubRepository.java:342)
        at tigase.pubsub.repository.PubSubRepositoryWrapper.createNode(PubSubRepositoryWrapper.java:23)
        at tigase.pubsub.modules.NodeCreateModule.process(NodeCreateModule.java:219)
        at tigase.component2.modules.ModulesManager.process(ModulesManager.java:87)
        at tigase.component2.AbstractComponent.processStanzaPacket(AbstractComponent.java:200)
        at tigase.component2.AbstractComponent.processPacket(AbstractComponent.java:188)
        at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1475)
Caused by: java.sql.SQLException: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'TIG_PUBSUB_NODES_SERVICE_ID_NAME' defined on 'TIG_PUBSUB_NODES'.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
        at tigase.pubsub.repository.derby.StoredProcedures.tigPubSubCreateNode(StoredProcedures.java:110)
        at org.apache.derby.exe.accc4c01a0x0149xcdfcx83c2x00000a020e203.g0(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown Source)
        at org.apache.derby.impl.sql.execute.CallStatementResultSet.open(Unknown Source)
        at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
        at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedCallableStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeQuery(Unknown Source)
        at tigase.pubsub.repository.PubSubDAOJDBC.createNode(PubSubDAOJDBC.java:193)
        at tigase.pubsub.repository.PubSubDAOPool.createNode(PubSubDAOPool.java:84)
        at tigase.pubsub.repository.cached.CachedPubSubRepository.createNode(CachedPubSubRepository.java:342)
        at tigase.pubsub.repository.PubSubRepositoryWrapper.createNode(PubSubRepositoryWrapper.java:23)
        at tigase.pubsub.modules.NodeCreateModule.process(NodeCreateModule.java:219)
        at tigase.component2.modules.ModulesManager.process(ModulesManager.java:87)
        at tigase.component2.AbstractComponent.processStanzaPacket(AbstractComponent.java:200)
        at tigase.component2.AbstractComponent.processPacket(AbstractComponent.java:188)
        at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1475)
Caused by: ERROR 23505: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'TIG_PUBSUB_NODES_SERVICE_ID_NAME' defined on 'TIG_PUBSUB_NODES'.
        at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
        at org.apache.derby.impl.sql.execute.IndexChanger.insertAndCheckDups(Unknown Source)
        at org.apache.derby.impl.sql.execute.IndexChanger.doInsert(Unknown Source)
        at org.apache.derby.impl.sql.execute.IndexChanger.insert(Unknown Source)
        at org.apache.derby.impl.sql.execute.IndexSetChanger.insert(Unknown Source)
        at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(Unknown Source)
        at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown Source)
        at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source)
        at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
        at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
        at tigase.pubsub.repository.derby.StoredProcedures.tigPubSubCreateNode(StoredProcedures.java:110)
        at org.apache.derby.exe.accc4c01a0x0149xcdfcx83c2x00000a020e203.g0(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown Source)
        at org.apache.derby.impl.sql.execute.CallStatementResultSet.open(Unknown Source)
        at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
        at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedCallableStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeQuery(Unknown Source)
        at tigase.pubsub.repository.PubSubDAOJDBC.createNode(PubSubDAOJDBC.java:193)
        at tigase.pubsub.repository.PubSubDAOPool.createNode(PubSubDAOPool.java:84)
        at tigase.pubsub.repository.cached.CachedPubSubRepository.createNode(CachedPubSubRepository.java:342)
        at tigase.pubsub.repository.PubSubRepositoryWrapper.createNode(PubSubRepositoryWrapper.java:23)
        at tigase.pubsub.modules.NodeCreateModule.process(NodeCreateModule.java:219)
        at tigase.component2.modules.ModulesManager.process(ModulesManager.java:87)
        at tigase.component2.AbstractComponent.processStanzaPacket(AbstractComponent.java:200)
        at tigase.component2.AbstractComponent.processPacket(AbstractComponent.java:188)
        at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1475)

and the reply I get is:

<iq from="pubsub.test.com" type="error" id="create1" to="admin@test.com/test">
  <pubsub xmlns="http://jabber.org/protocol/pubsub">
    <create node="test"/>
  </pubsub>
  <error type="wait" code="500">
    <internal-server-error xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
  </error>
</iq>

I have been able to reproduce this by:

  1. deleteing my derby db

  2. re-creating it: .\scripts\db-create-derby.cmd derbydb

  3. re-creating the pubsub tables: .\scripts\db-import-pubsub-derby.cmd derbydb

  4. re-create the users (using psi)

  5. create the pubsub node as shown above (since psi doesn't interpret the form you send it correctly, I have to do it manually)

  6. make sur it shows up (using psi)

  7. ctrl + c in the console where tigase is running

  8. start tigase again

  9. and follow the above

This is extremely handicapping for me.

Thanks,

Gabriel


Replies (3)

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam about 4 years ago

Thank you for providing all the details.

Submitted a bug report for this: #2487

Added by Gabriel Rossetti about 4 years ago

Thanks. By the way, I was looking at the DB and noticed an error in the pubsub configutration for the pubsub#send_last_published_item field, in the spec it has:

<field var='pubsub#send_last_published_item' type='list-single' label='When to send the last published item'>
  <option label='Never'>
    <value>never</value>
  </option>
  <option label='When a new subscription is processed'>
    <value>on_sub</value>
  </option>
  <option label='When a new subscription is processed and whenever a subscriber comes online'>
    <value>on_sub_and_presence</value>
  </option>
  <value>never</value>
</field>

and you have:

<field type="list-single" label="When to send the last published item" var="pubsub#send_last_published_item">
  <value>on_sub</value>
  <option>
    <value>open</value>
  </option>
  <option>
    <value>publishers</value>
  </option>
  <option>
    <value>subscribers</value>
  </option>
</field>

as you see the options are wrong.

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam about 4 years ago

Thank you Gabriel, submitted another bug report: #2496

    (1-3/3)