You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running into an issue with querying my user collection now that I've transitioned all my updates to low level mongodb and I'm not using grails built in user.save() method. I've looked at the users in the database with MongoHub and everything looks as it should.
Here's the criteria search: def c = User.createCriteria() User user = c.get { or { and { eq "email", emailUsernameCommand.emailUsername eq "password", passEncrypted } and { eq "username", emailUsernameCommand.emailUsername eq "password", passEncrypted } } }
New accounts work normally, previously created accounts are generating the following error. ERROR AccountService - Unable to authenticate user test : readDateTime can only be called when CurrentBSONType is DATE_TIME, not when CurrentBSONType is STRING. org.bson.BsonInvalidOperationException: readDateTime can only be called when CurrentBSONType is DATE_TIME, not when CurrentBSONType is STRING. at org.bson.AbstractBsonReader.verifyBSONType(AbstractBsonReader.java:655) at org.bson.AbstractBsonReader.checkPreconditions(AbstractBsonReader.java:687) at org.bson.AbstractBsonReader.readDateTime(AbstractBsonReader.java:288) at org.grails.datastore.mapping.mongo.engine.codecs.PersistentEntityCodec$SimpleDecoder$8.decode(PersistentEntityCodec.groovy:670) at org.grails.datastore.mapping.mongo.engine.codecs.PersistentEntityCodec$SimpleDecoder.decode(PersistentEntityCodec.groovy:721) at org.grails.datastore.mapping.mongo.engine.codecs.PersistentEntityCodec$SimpleDecoder.decode(PersistentEntityCodec.groovy) at org.grails.datastore.mapping.mongo.engine.codecs.PersistentEntityCodec.decode(PersistentEntityCodec.groovy:159) at com.mongodb.operation.CommandResultArrayCodec.decode(CommandResultArrayCodec.java:48) at com.mongodb.operation.CommandResultDocumentCodec.readValue(CommandResultDocumentCodec.java:53) at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:81) at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:40) at org.bson.codecs.configuration.LazyCodec.decode(LazyCodec.java:47) at org.bson.codecs.BsonDocumentCodec.readValue(BsonDocumentCodec.java:98) at com.mongodb.operation.CommandResultDocumentCodec.readValue(CommandResultDocumentCodec.java:56) at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:81) at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:40) at com.mongodb.connection.CommandProtocol.execute(CommandProtocol.java:123) at com.mongodb.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:159) at com.mongodb.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:286) at com.mongodb.connection.DefaultServerConnection.command(DefaultServerConnection.java:173) at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:215) at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:206) at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:112) at com.mongodb.operation.FindOperation$1.call(FindOperation.java:485) at com.mongodb.operation.FindOperation$1.call(FindOperation.java:480) at com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:239) at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:212) at com.mongodb.operation.FindOperation.execute(FindOperation.java:480) at com.mongodb.operation.FindOperation.execute(FindOperation.java:77) at com.mongodb.Mongo.execute(Mongo.java:772) at com.mongodb.Mongo$2.execute(Mongo.java:759) at com.mongodb.OperationIterable.iterator(OperationIterable.java:47) at com.mongodb.FindIterableImpl.iterator(FindIterableImpl.java:143) at org.grails.datastore.mapping.mongo.query.MongoQuery.executeQuery(MongoQuery.java:1019) at org.grails.datastore.mapping.mongo.query.MongoQuery.executeQuery(MongoQuery.java:882) at org.grails.datastore.mapping.query.Query.list(Query.java:567) at org.grails.datastore.mapping.query.Query.singleResult(Query.java:585) at grails.gorm.CriteriaBuilder.get(CriteriaBuilder.java:297) at org.grails.datastore.mapping.query.api.BuildableCriteria$get.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
The text was updated successfully, but these errors were encountered:
I've compared my user domain to what I can see in MongoHub for this particular user and everything looks like it should. Is there any way to see which property of the document is throwing the error?
@idonaldson Sorry, I was confused there for a second. The easiest way to tell which property it is is to put a breakpoint at AbstractBsonReader.verifyBSONType and inspect the currentName property
Running into an issue with querying my user collection now that I've transitioned all my updates to low level mongodb and I'm not using grails built in user.save() method. I've looked at the users in the database with MongoHub and everything looks as it should.
Here's the criteria search:
def c = User.createCriteria() User user = c.get { or { and { eq "email", emailUsernameCommand.emailUsername eq "password", passEncrypted } and { eq "username", emailUsernameCommand.emailUsername eq "password", passEncrypted } } }
New accounts work normally, previously created accounts are generating the following error.
ERROR AccountService - Unable to authenticate user test : readDateTime can only be called when CurrentBSONType is DATE_TIME, not when CurrentBSONType is STRING. org.bson.BsonInvalidOperationException: readDateTime can only be called when CurrentBSONType is DATE_TIME, not when CurrentBSONType is STRING. at org.bson.AbstractBsonReader.verifyBSONType(AbstractBsonReader.java:655) at org.bson.AbstractBsonReader.checkPreconditions(AbstractBsonReader.java:687) at org.bson.AbstractBsonReader.readDateTime(AbstractBsonReader.java:288) at org.grails.datastore.mapping.mongo.engine.codecs.PersistentEntityCodec$SimpleDecoder$8.decode(PersistentEntityCodec.groovy:670) at org.grails.datastore.mapping.mongo.engine.codecs.PersistentEntityCodec$SimpleDecoder.decode(PersistentEntityCodec.groovy:721) at org.grails.datastore.mapping.mongo.engine.codecs.PersistentEntityCodec$SimpleDecoder.decode(PersistentEntityCodec.groovy) at org.grails.datastore.mapping.mongo.engine.codecs.PersistentEntityCodec.decode(PersistentEntityCodec.groovy:159) at com.mongodb.operation.CommandResultArrayCodec.decode(CommandResultArrayCodec.java:48) at com.mongodb.operation.CommandResultDocumentCodec.readValue(CommandResultDocumentCodec.java:53) at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:81) at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:40) at org.bson.codecs.configuration.LazyCodec.decode(LazyCodec.java:47) at org.bson.codecs.BsonDocumentCodec.readValue(BsonDocumentCodec.java:98) at com.mongodb.operation.CommandResultDocumentCodec.readValue(CommandResultDocumentCodec.java:56) at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:81) at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:40) at com.mongodb.connection.CommandProtocol.execute(CommandProtocol.java:123) at com.mongodb.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:159) at com.mongodb.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:286) at com.mongodb.connection.DefaultServerConnection.command(DefaultServerConnection.java:173) at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:215) at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:206) at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:112) at com.mongodb.operation.FindOperation$1.call(FindOperation.java:485) at com.mongodb.operation.FindOperation$1.call(FindOperation.java:480) at com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:239) at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:212) at com.mongodb.operation.FindOperation.execute(FindOperation.java:480) at com.mongodb.operation.FindOperation.execute(FindOperation.java:77) at com.mongodb.Mongo.execute(Mongo.java:772) at com.mongodb.Mongo$2.execute(Mongo.java:759) at com.mongodb.OperationIterable.iterator(OperationIterable.java:47) at com.mongodb.FindIterableImpl.iterator(FindIterableImpl.java:143) at org.grails.datastore.mapping.mongo.query.MongoQuery.executeQuery(MongoQuery.java:1019) at org.grails.datastore.mapping.mongo.query.MongoQuery.executeQuery(MongoQuery.java:882) at org.grails.datastore.mapping.query.Query.list(Query.java:567) at org.grails.datastore.mapping.query.Query.singleResult(Query.java:585) at grails.gorm.CriteriaBuilder.get(CriteriaBuilder.java:297) at org.grails.datastore.mapping.query.api.BuildableCriteria$get.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
The text was updated successfully, but these errors were encountered: