powered by Jive Software

Duplicate key value violates unique constraint "ofpubsubnode_pk"

Hi,

I am getting this error while creating a new node.

duplicate key value violates unique constraint “ofpubsubnode_pk”

Appreciate any pointers on what could be the reason.

How are you trying to create the node? I am surprised that you are seeing a db error instead of an XMPP error.

The error itself is pretty clear, you are trying to create another node with the same service and node name.

Hi,

Thanks for replying.

I understand that the error is beacuse the same node is being created again…

But what I am not able to get is why there is a DB error

instead there should be IQ error packet saying conflict.

I have a hunch, what is the name of the node you are trying to create?

I have seen a similar problem before with pubsub items, and I think you are creating a node with a name that is too long. The column length for a node is 100 chars, so if you are creating a node with a name longer than this, but the first 100 are the same as an existing node, you would most likely see this exception.

Increasing the column width in your database should fix it.

That was a good guess but my node name is not longer than 100 chars and further the first 100 chars are not existing in any other node.

My server is running in a clustered env. Could it be beacuse of clustering?

Pubsub does not work in a clustered environment. It actually shuts itself off, except for the master node.

Can you post or pm me the actual stacktrace.