Tag Archives: NoSQL

[Solved] MongoDB Insert Data Error: OperationFailure: Authentication failed…

pip uninstall pymongo
pip install pymongo==3.6

Enter the password
1. TypeError: ‘Collection’ object is not callable. If you meant to call the ‘authenticate’ method on a ‘Database’ object it is failing because no such method exists.

Can connect to its own mongodb database. I can but cannot insert data to the company server. You can insert data when running on someone else’s computer, so the key is your own environment. Either it is a mongodb version problem or a pymongo version problem.

ret = dbtable.insert_one(student)

2. OperationFailure: Authentication failed., Full error: {‘OK’: 0.0, ‘errmsg’: ‘authentication failed.’, ‘code’: 18, ‘codename’: ‘authenticationfailed.}
MongoDB inserts an error in data and authentication fails.

Solution:

Delete the latest version of pymongo. My MongoDB is also version 3.6

pip uninstall pymongo
pip install pymongo==3.6

[Solved] mongodump Error: assertion: 2 { ok: 0.0, errmsg: “Auth mechanism not specified”, code: 2, codeName: “BadValue”…

Mongodump error

assertion: 2 { ok: 0.0, errmsg: “Auth mechanism not specified”, code: 2, codeName: “BadValue”, operationTime: Timestamp 1573815888000|1, $clusterTime: { clusterTime: Timestamp 1573815888000|1,

reason

It is caused by the lower version of mongodump. You need to uninstall the default Yum source installation version and reinstall the new version.

System default installation version: 2. X
requirement Version (support cluster version): 4. X

terms of settlement:

create a file

/etc/yum.repos.d/mongodb-org-4.0.repo

[mongodb-org-4.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc

Installation configuration

yum install -y mongodb-org

[Solved] Springboot Connect MongoDB Error: UncategorizedMongoDbException: Command failed with error 13 (Unauthorized)

[phenomenon]

failed; nested exception is org.springframework.data.mongodb.UncategorizedMongoDbException: Command failed with error 13 (Unauthorized): 'command insert requires authentication' on server localhost:27017. The full response is {"ok": 0.0, "errmsg": "command insert requires authentication", "code": 13, "codeName": "Unauthorized"}; nested exception is com.mongodb.MongoCommandException: Command failed with error 13 (Unauthorized): 'command insert requires authentication' on server localhost:27017. The full response is {"ok": 0.0, "errmsg": "command insert requires authentication", "code": 13, "codeName": "Unauthorized"}] with root cause

com.mongodb.MongoCommandException: Command failed with error 13 (Unauthorized): 'command insert requires authentication' on server localhost:27017. The full response is {"ok": 0.0, "errmsg": "command insert requires authentication", "code": 13, "codeName": "Unauthorized"}
	at com.mongodb.internal.connection.ProtocolHelper.getCommandFailureException(ProtocolHelper.java:175) ~[mongodb-driver-core-4.2.3.jar:na]
	at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:358) ~[mongodb-driver-core-4.2.3.jar:na]
	at com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:279) ~[mongodb-driver-core-4.2.3.jar:na]
	at com.mongodb.internal.connection.UsageTrackingInternalConnection.sendAndReceive(UsageTrackingInternalConnection.java:100) ~[mongodb-driver-core-4.2.3.jar:na]
	at com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection.sendAndReceive(DefaultConnectionPool.java:490) ~[mongodb-driver-core-4.2.3.jar:na]
	at com.mongodb.internal.connection.CommandProtocolImpl.execute(CommandProtocolImpl.java:71) ~[mongodb-driver-core-4.2.3.jar:na]
	at com.mongodb.internal.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:253) ~[mongodb-driver-core-4.2.3.jar:na]
	at com.mongodb.internal.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:202) ~[mongodb-driver-core-4.2.3.jar:na]
	at com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:118) ~[mongodb-driver-core-4.2.3.jar:na]
	at com.mongodb.internal.operation.MixedBulkWriteOperation.executeCommand(MixedBulkWriteOperation.java:431) ~[mongodb-driver-core-4.2.3.jar:na]
	at com.mongodb.internal.operation.MixedBulkWriteOperation.executeBulkWriteBatch(MixedBulkWriteOperation.java:251) ~[mongodb-driver-core-4.2.3.jar:na]
	at com.mongodb.internal.operation.MixedBulkWriteOperation.access$700(MixedBulkWriteOperation.java:76) ~[mongodb-driver-core-4.2.3.jar:na]
	at com.mongodb.internal.operation.MixedBulkWriteOperation$1.call(MixedBulkWriteOperation.java:194) ~[mongodb-driver-core-4.2.3.jar:na]
	at com.mongodb.internal.operation.MixedBulkWriteOperation$1.call(MixedBulkWriteOperation.java:185) ~[mongodb-driver-core-4.2.3.jar:na]
	at com.mongodb.internal.operation.OperationHelper.withReleasableConnection(OperationHelper.java:621) ~[mongodb-driver-core-4.2.3.jar:na]
	at com.mongodb.internal.operation.MixedBulkWriteOperation.execute(MixedBulkWriteOperation.java:185) ~[mongodb-driver-core-4.2.3.jar:na]
	at com.mongodb.internal.operation.MixedBulkWriteOperation.execute(MixedBulkWriteOperation.java:76) ~[mongodb-driver-core-4.2.3.jar:na]
	at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:187) ~[mongodb-driver-sync-4.2.3.jar:na]
	at com.mongodb.client.internal.MongoCollectionImpl.executeInsertMany(MongoCollectionImpl.java:498) ~[mongodb-driver-sync-4.2.3.jar:na]
	at com.mongodb.client.internal.MongoCollectionImpl.insertMany(MongoCollectionImpl.java:480) ~[mongodb-driver-sync-4.2.3.jar:na]
	at com.mongodb.client.internal.MongoCollectionImpl.insertMany(MongoCollectionImpl.java:475) ~[mongodb-driver-sync-4.2.3.jar:na]
	at org.springframework.data.mongodb.core.MongoTemplate.lambda$insertDocumentList$17(MongoTemplate.java:1490) ~[spring-data-mongodb-3.2.6.jar:3.2.6]
	at org.springframework.data.mongodb.core.MongoTemplate.execute(MongoTemplate.java:553) ~[spring-data-mongodb-3.2.6.jar:3.2.6]
	at org.springframework.data.mongodb.core.MongoTemplate.insertDocumentList(MongoTemplate.java:1483) ~[spring-data-mongodb-3.2.6.jar:3.2.6]
	at org.springframework.data.mongodb.core.MongoTemplate.doInsertBatch(MongoTemplate.java:1346) ~[spring-data-mongodb-3.2.6.jar:3.2.6]
	at org.springframework.data.mongodb.core.MongoTemplate.insert(MongoTemplate.java:1280) ~[spring-data-mongodb-3.2.6.jar:3.2.6]

[solution]

Add the following configuration:

spring.data.mongodb.username=admin
spring.data.mongodb.password=admin

Modify the application.properties file as below:

spring.data.mongodb.host=localhost
spring.data.mongodb.port=27017
spring.data.mongodb.username=admin
spring.data.mongodb.password=admin
spring.data.mongodb.database=user

Redis Delete dump.rdb Mistakenly [How to Solve]

1. Log in to redis database

[ [email protected] ~]# redis-cli -h 192.168.1.19
2. View redis configuration information

192.168.1.19:6379> info

2. According the path of config_file to set dump.rdb file storage path, or you can customize the path

192.168.1.19:6379> config set dir /storage/redis/

3. Save and exit

192.168.1.19:6379> save

192.168.1.19:6379> exit

4. Restart redis service

[ [email protected] ~]# service redis stop

[ [email protected] ~]# service redis start

[Solved] ERROR: child process failed, exited with error number 14 (error number 1, error number 100)

Problem Description:

Error: 14 when starting mongodb, check mongodb.log for MongoDB – Unable to unlink socket file / tmp / mongodb-27017

Cause analysis:

Check /tmp/mongodb-27017.sock, found that the owner is root

Solution:

Delete the /tmp/mongodb-27017.sock file and restart the mongod process. Check the /tmp/mongodb-27017.sock permissions again and change the ownership to the “mongodb” user.

also started successfully

Summary:

1. Check more logs, mongodb.log
2. The mongodb error column, such as 1100, is mostly due to the wrong specification of the data path and log path in the configuration file. The data path needs to be created in advance, which is a directory, and the log path also needs to be created in advance, which is a file

[Solved] MongoDB Error: FaileError: dToParse: Password must be URL Encoded for mongodb:// URL:

Mongodb – error failedtoparse: password must be URL encoded for mongodb:// URL:

Problem background:
when you log in to mongodb with @ password, an error is reported. Failedtoparse: password must be URL encoded for mongodb:// URL:

Problem analysis:
official: https://docs.mongodb.com/manual/reference/connection-string/#examples

If the username or password includes the following characters:

@ is %40

Solution:
we can replace the login password @ with %40.

After creating an Iam ordinary user, you can execute the following commands to log in to mongodb through the Iam user:

$ mongo --quiet mongodb://iam:'aaa%40intah'@127.0.0.1:27017/iam_analytics?authSource=iam_analytics

Mongodb error: authentication failed [How to Solve]

Error Messages:

Database connect error:

com.mongodb.MongoSecurityException: Exception authenticating MongoCredential{mechanism=SCRAM-SHA-1, userName=‘root’, source=‘gateway’, password=, mechanismProperties=} Command failed with error 18 (AuthenticationFailed): ‘Authentication failed.’ on server 192.168.81.13:27017. The full response is {“ok”: 0.0, “errmsg”: “Authentication failed.”, “code”: 18, “codeName”: “AuthenticationFailed”}.

 

Solution:

Connect URL

mongodb://user:[email protected]:port/dbname

Add parameter authsource

For example:

mongodb://user:[email protected]:port/dbname?authSource=admin

In general, authsource is admin and can be replaced as needed

Command failed with error 16412: ‘FieldPath field names may not contain ‘.‘.‘ on server 10.21.20.8:2

    problem description
    query interface error:

    {"errorMessage":
    "Command failed with error 16412: 'FieldPath field names may not contain '.'.' on server 10.21.20.8:27019. The full response is { \"ok\" : 0.0, \"errmsg\" : \"FieldPath field names may not contain '.'.\", \"code\" : 16412, \"codeName\" : \"Location16412\" }"}
    
    
    com.mongodb.MongoCommandException: Command failed with error 16412: 'FieldPath field names may not contain '.'.' on server 10.21.20.8:27019. The full response is { "ok" : 0.0, "errmsg" : "FieldPath field names may not contain '.'.", "code" : 16412, "codeName" : "Location16412" }
        at com.mongodb.connection.ProtocolHelper.getCommandFailureException(ProtocolHelper.java:115)
        at com.mongodb.connection.CommandProtocol.execute(CommandProtocol.java:114)
        at com.mongodb.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:168)
        at com.mongodb.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:289)
        at com.mongodb.connection.DefaultServerConnection.command(DefaultServerConnection.java:176)
        at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:216)
        at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:207)
        at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:113)
        at com.mongodb.operation.AggregateOperation$1.call(AggregateOperation.java:257)
        at com.mongodb.operation.AggregateOperation$1.call(AggregateOperation.java:253)
        at com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:435)
        at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:408)
        at com.mongodb.operation.AggregateOperation.execute(AggregateOperation.java:253)
        at com.mongodb.operation.AggregateOperation.execute(AggregateOperation.java:67)
        at com.mongodb.Mongo.execute(Mongo.java:836)
        at com.mongodb.Mongo$2.execute(Mongo.java:823)
        at com.mongodb.DBCollection.aggregate(DBCollection.java:1455)
        at com.mongodb.DBCollection.aggregate(DBCollection.java:1418)
        at com.mongodb.DBCollection.aggregate(DBCollection.java:1403)
        at com.linkus.biz.prj.service.impl.PrjDevTaskStatServiceImpl.getPrjDevTaskStatData(PrjDevTaskStatServiceImpl.java:127)
    
    
      problem solving
      check the fields in the group. The grouping fields are wrong. The value “joinbiz. Resp” of resp in the group is changed to “resp”

      "$group":{
      	"_id":{
      		"prjSys":"$prjSys",
      		"prjMod":"$prjMod",
      		"resp":"$_joinBiz_.resp",
      	},
      	"devTasksCount":{
      		"$sum":1
      	},
      	"minPlanEndDate":{
      		"$min":"$_joinBiz_.planEndDate"
      	},
      	"maxPlanEndData":{
      		"$max":"$_joinBiz_.planEndDate"
      	},
      	"planCompletionCount":{
      		"$sum":"$planCompletionNum"
      	},
      	"actualCompletionCount":{
      		"$sum":"$actualCompletionNum"
      	}      
      }
      

Deploy mongodb fragment combined with replica set to realize distributed storage of MySQL database files (step 10)

Configure the mongos process of the SHARD2 node
[[email protected] bin]# cat < > /usr/local/mongodb/bin/mongos.conf

bind_ip=192.168.100.103
port=27025
logpath=/usr/local/mongodb/logs/mongos.log
fork=true
maxConns=5000
configdb=configs/192.168.100.101:27017,192.168.100.101:27018,192.168.100.101:27019
END

[root @ shard2 bin] # touch…/logs/mongos.log
[root @ shard2 bin] # chmod 777…/logs/mongos.log
[root @ shard2 bin] # mongos -f/usr/local/mongodb/bin/mongos.conf

about to fork child process, waiting until server is ready for connections.
forked process: 1562
child process started successfully, parent exiting

[[email protected] ~]# netstat -utpln |grep mongo

tcp        0      0 192.168.100.103:27019   0.0.0.0:*               LISTEN      1095/mongod         
tcp        0      0 192.168.100.103:27020   0.0.0.0:*               LISTEN      1122/mongod         
tcp        0      0 192.168.100.103:27025   0.0.0.0:*               LISTEN      12122/mongos        
tcp        0      0 192.168.100.103:27017   0.0.0.0:*               LISTEN      1041/mongod         
tcp        0      0 192.168.100.103:27018   0.0.0.0:*               LISTEN      1068/mongod 

MongoDB Error: Query failed with error code 2 and error message ‘Field ‘locale’ is invalid

is a very bad exception:

2020-06-29 18:44:40.940 ERROR 15164 --- [nio-9002-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.data.mongodb.UncategorizedMongoDbException: Query failed with error code 2 and error message 'Field 'locale' is invalid in: { locale: "user" }' on server 192.168.10.105:27017; nested exception is com.mongodb.MongoQueryException: Query failed with error code 2 and error message 'Field 'locale' is invalid in: { locale: "user" }' on server 192.168.10.105:27017] with root cause

com.mongodb.MongoQueryException: Query failed with error code 2 and error message 'Field 'locale' is invalid in: { locale: "user" }' on server 192.168.10.105:27017
	at com.mongodb.internal.operation.FindOperation$1.call(FindOperation.java:635) ~[mongodb-driver-core-4.0.4.jar:na]
	at com.mongodb.internal.operation.FindOperation$1.call(FindOperation.java:625) ~[mongodb-driver-core-4.0.4.jar:na]
	at com.mongodb.internal.operation.OperationHelper.withReadConnectionSource(OperationHelper.java:462) ~[mongodb-driver-core-4.0.4.jar:na]
	at com.mongodb.internal.operation.FindOperation.execute(FindOperation.java:625) ~[mongodb-driver-core-4.0.4.jar:na]
	at com.mongodb.internal.operation.FindOperation.execute(FindOperation.java:77) ~[mongodb-driver-core-4.0.4.jar:na]
	at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:190) ~[mongodb-driver-sync-4.0.4.jar:na]
	at com.mongodb.client.internal.MongoIterableImpl.execute(MongoIterableImpl.java:135) ~[mongodb-driver-sync-4.0.4.jar:na]
	at com.mongodb.client.internal.MongoIterableImpl.iterator(MongoIterableImpl.java:92) ~[mongodb-driver-sync-4.0.4.jar:na]
	at org.springframework.data.mongodb.core.MongoTemplate.executeFindMultiInternal(MongoTemplate.java:2771) ~[spring-data-mongodb-3.0.1.RELEASE.jar:3.0.1.RELEASE]
	at org.springframework.data.mongodb.core.MongoTemplate.findAll(MongoTemplate.java:1757) ~[spring-data-mongodb-3.0.1.RELEASE.jar:3.0.1.RELEASE]
	at org.springframework.data.mongodb.core.MongoTemplate.findAll(MongoTemplate.java:1752) ~[spring-data-mongodb-3.0.1.RELEASE.jar:3.0.1.RELEASE]
	at com.coldlight.mongo.service.impl.UserServiceImpl.getAllUser(UserServiceImpl.java:36) ~[classes/:na]
	at com.coldlight.mongo.controller.UserController.getAllUser(UserController.java:28) ~[classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_251]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_251]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_251]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_251]
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) ~[spring-web-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) ~[spring-web-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) ~[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879) ~[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793) ~[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) ~[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) ~[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.36.jar:9.0.36]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_251]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_251]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.36.jar:9.0.36]
	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_251]

I did not change anything, just added a comment, suddenly error, why and the network said different, then take a closer look at the blog, my own problem, here first explain the problem

I misannotated

//正确的
@Document(collection  = "user")

is written as

//导致错误的
@Document(collation  = "user")

collection and collation are not the same.