Project

General

Profile

Retrieving subscriptions: user affiliations reading error

Eric Johan
Added over 3 years ago

I recently switched from openfire to tigase and overall everything went very smoothly. I do however have run into a problem with pubsub. Creating and subscribing seem to go fine but retrieving the nodes to which a user is subscribed doesn't work. My application reports an internal server error so I checked the logs. It reports an error with reading the user affiliations. The info in table tig_pubsub_affiliations corresponds to the way it was created and subscribed to so it's correct. I've pasted the relevant part from the logs below.

2015-08-15 13:23:21.491 [in_3-pubsub]      AbstractComponent.processStanzaPacket()  SEVERE: tigase.pubsub.repository.RepositoryException: User affiliations reading error when processing 
from=sess-man@removedhostinformation, to=null, DATA=<iq id="A935C3C8-F2D3-47D2-ABC1-30E86EF6CBD3" xmlns="jabber:client" type="get" from="user@host/iPhone" to="pubsub.hostname">
<pubsub xmlns="http://jabber.org/protocol/pubsub"><subscriptions/></pubsub></iq>, SIZE=208, XMLNS=jabber:client,
PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=get
java.lang.RuntimeException: tigase.pubsub.repository.RepositoryException: User affiliations reading error
    at tigase.pubsub.modules.RetrieveSubscriptionsModule.process(RetrieveSubscriptionsModule.java:140)
    at tigase.component2.modules.ModulesManager.process(ModulesManager.java:87)
    at tigase.component2.AbstractComponent.processStanzaPacket(AbstractComponent.java:221)
    at tigase.component2.AbstractComponent.processPacket(AbstractComponent.java:209)
    at tigase.pubsub.PubSubComponent.processPacket(PubSubComponent.java:599)
    at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1424)
Caused by: tigase.pubsub.repository.RepositoryException: User affiliations reading error
    at tigase.pubsub.repository.PubSubDAOJDBC.getUserSubscriptions(PubSubDAOJDBC.java:625)
    at tigase.pubsub.repository.PubSubDAOPool.getUserSubscriptions(PubSubDAOPool.java:381)
    at tigase.pubsub.modules.RetrieveSubscriptionsModule.process(RetrieveSubscriptionsModule.java:112)
    at tigase.component2.modules.ModulesManager.process(ModulesManager.java:87)
    at tigase.component2.AbstractComponent.processStanzaPacket(AbstractComponent.java:221)
    at tigase.component2.AbstractComponent.processPacket(AbstractComponent.java:209)
    at tigase.pubsub.PubSubComponent.processPacket(PubSubComponent.java:599)
    at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1424)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after statement closed.
    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:422)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
    at com.mysql.jdbc.Util.getInstance(Util.java:381)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
    at com.mysql.jdbc.StatementImpl.checkClosed(StatementImpl.java:380)
    at com.mysql.jdbc.PreparedStatement.setString(PreparedStatement.java:3965)
    at tigase.pubsub.repository.PubSubDAOJDBC.getUserSubscriptions(PubSubDAOJDBC.java:613)
    at tigase.pubsub.repository.PubSubDAOPool.getUserSubscriptions(PubSubDAOPool.java:381)
    at tigase.pubsub.modules.RetrieveSubscriptionsModule.process(RetrieveSubscriptionsModule.java:112)
    at tigase.component2.modules.ModulesManager.process(ModulesManager.java:87)
    at tigase.component2.AbstractComponent.processStanzaPacket(AbstractComponent.java:221)
    at tigase.component2.AbstractComponent.processPacket(AbstractComponent.java:209)
    at tigase.pubsub.PubSubComponent.processPacket(PubSubComponent.java:599)
    at tigase.server.AbstractMessageReceiver$QueueListener.run(AbstractMessageReceiver.java:1424)

Replies (5)

(1)

Added by Wojciech Kapcia TigaseTeam over 3 years ago

Can you share exact Tigase version and MySQL version that you use?

(1)

Added by Eric Johan over 3 years ago

Wojciech Kapcia wrote:

Can you share exact Tigase version and MySQL version that you use?

I use MySQL version 5.6.22 and Tigase 7.0.2.

(1)

Added by Wojciech Kapcia TigaseTeam over 3 years ago

Do you use clustering? Can you share your complete init.properties (obfuscated)? Is the issue reproducible on local MySQL instance?

(1)

Added by Eric Johan over 3 years ago

Sorry for the delay in getting back to you.

I've terminated my ec2 and rds-instances and launched new ones (this is currently used in a test environment) and did a clean install of Tigase. At first everything worked fine. I registered new users and could create and subscribe to groups and the subscriptions would be fetched normally. The next day however, the problem returned.

I do have clustering enabled but there's currently only one server running, I expect to need more servers in a cluster setup eventually in production and I read that it's okay to have clustering enabled while running only one server.

I did not however enable Tigase ACS.

My init.properties:

--comp-class-1 = tigase.muc.MUCComponent

--virt-hosts =

--auth-db-uri = jdbc:mysql://:3306/tigasedb?user=&password=

--user-db-uri = jdbc:mysql://:3306/tigasedb?user=&password=

--user-db = mysql

--admins = admin@

--comp-name-5 = message-archive

--comp-name-4 = rest

--auth-db = tigase-auth

--comp-name-3 = proxy

config-type = --gen-config-all

--comp-name-2 = pubsub

--comp-name-1 = muc

--cluster-mode = true

--sm-plugins = +message-archive-xep-0136,+jabber:iq:auth,+urn:ietf:params:xml:ns:xmpp-sasl,+urn:ietf:params:xml:ns:xmpp-bind,+urn:ietf:params:xml:ns:xmpp-session,+jabber:iq:register,+jabber:iq:roster,+presence,+jabber:iq:privacy,+jabber:iq:version,+http://jabber.org/protocol/stats,+starttls,+msgoffline,+vcard-temp,+http://jabber.org/protocol/commands,+jabber:iq:private,+urn:xmpp:ping,+basic-filter,+domain-filter,+pep,+zlib

--debug = server,xmpp.impl,db,cluster

--comp-class-5 = tigase.archive.MessageArchiveComponent

--comp-class-4 = tigase.http.rest.RestMessageReceiver

--comp-class-3 = tigase.socks5.Socks5ProxyComponent

--comp-class-2 = tigase.pubsub.PubSubComponent

Added by Eric Johan over 3 years ago

I've been doing some further testing but the problem seems to show up irregularly. I've just created more accounts and groups and it seems to have be working fine right now for a few hours. I've checked the logs and there's nothing (no near misses or anything) since a few hours ago when it didn't work correctly. I will continue testing to try and get some pattern that could uncover a trigger or anything.

    (1-5/5)