Projects tigase _server tigase-http-api Issues #60
Some REST handlers doesn't work correctly with MongoDB (#60)
Closed
wojciech.kapcia@tigase.net opened 7 years ago

Some rest endpoints doesn't work with MongoDB (for example tigase-http-api/src/scripts/groovy/tigase/rest/user/UserAdmin.groovy) as they use call to tigase.db.UserRepository#getUserUID to verify if user exists:

def uid = service.getUserRepository().getUserUID(jid);
if (uid <= 0) {
	callback(null);
…

and in case of mongo it always returns 0:

/**
 * Should be removed as only relational DB are using this and it is not required by any other code
 *
 * {@inheritDoc}
 */
@Override
@Deprecated
public long getUserUID(BareJID user) throws TigaseDBException {
	return 0;
}

I think we should review all code that depends on this method for user checking (not only in http-api)

wojciech.kapcia@tigase.net commented 7 years ago

Afterwards iot1.cloud installation should be updated (#6493)

Andrzej Wójcik (Tigase) commented 7 years ago

I've reviewed usages of getUserUID() and fixed them. UID is displayed/returned by REST API, so I've left it as it was (it is retrieved), but I'm no longer using it for checking if user exists - for that userExists() method is used.

Andrzej Wójcik (Tigase) commented 7 years ago

iot-1.cloud is updated with new version of Tigase XMPP Server which contains this fix.

Andrzej Wójcik (Tigase) commented 7 years ago

There was an issue in AuditLog which was part of the build installed at iot-1.cloud. Tigase Kernel creates instance of beans during processing and due to that license checker for auditlog was installed even though AuditLog component was not enabled! I've fixed it by delaying license checking to the initialization stage of the AuditLog component bean.

This will work just fine, but I wonder if there is no similar issue in clustered versions of PubSub and MUC, as I created license checking for AuditLog based on code used for license checking for PubSub? Wojtek, is it possible that each instance used in clustered mode (even without ACS) is still trying to retrieve license?

If so, then we need to modify clustered versions of PubSub and MUC in the same way as AuditLog was modified.

wojciech.kapcia@tigase.net commented 6 years ago

I've updated acs-muc and acs-pubsub and verified that it works.

issue 1 of 1
Type
Bug
Priority
Critical
Assignee
RedmineID
6744
Version
tigase-server-8.0.0rc1
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/tigase-http-api#60
Please wait...
Page is in error, reload to recover