Open pulkitsinghal opened 7 years ago
@pulkitsinghal I think the query is triggered by the following line in loopback's common/models/acl.js
: https://github.com/strongloop/loopback/blob/6d5d7f0d4a64f2a3938b5b53b7d35ae9271adf6f/common/models/acl.js#L355
AFAIK, LoopBack authentication requires you to attach ACL
to a datasource, similarly to other auth models like Role
and RoleMapping
.
it fails because ACL doesn't have any entries in ES and even though the result set should be empty, there isn't any _uid to sort on and that errors out in ES:
I don't have enough knowledge about ES to help here. I would expect that automigrate
/autoupdate
should create an empty ACL
table/connection in ES.
@pulkitsinghal Does this still happen with the new release? I think this could be because the access token is still not yet available for search ...
I got this error during my tests with 5.0 as well (_uid not sortable ...) I removed the defaulting sorting in here by removing the id:true on the model, then it works: https://github.com/strongloop-community/loopback-connector-elastic-search/pull/80/files#diff-2188140f8e1212974a697c3da77d751aL74
That's related I think.
During login, an unexpected/strange query to the elasticsearch (ES) is made and it fails because ACL doesn't have any entries in ES and even though the result set should be empty, there isn't any
_uid
to sort on and that errors out in ES:I ran this on mongodb connector and apparently this unexpected query exists there too:
But mongo doesn't barf on it! It tolerates it and returns an empty result set.
Next Steps
ACL for user model
via connector forEXECUTE permissions on login method
seems like a no-op to me, since ACL table/collection is never created, even in other connectors like mongo.