Tag Archives: Technical scheme

[Solved] failed (13: Permission denied) while reading upstream

Error Messages:

/usr/local/nginx/logs/error.log
2022/08/11 09:36:47 [crit] 2821940#0: *6263 open() "/usr/local/nginx/proxy_temp/2/29/0000000292" failed 
(13: Permission denied) while reading upstream, client: 15.60.178.88, server: demo.jichu.com, 
request: "GET /static/css/bootstrap.min.css.map HTTP/1.1", 
upstream: "http://15.60.178.88:3001/static/css/bootstrap.min.css.map", host: "demo.jichu.com"
2022/08/11 09:36:49 [crit] 2821940#0: *6261 open() "/usr/local/nginx/proxy_temp/3/29/0000000293" failed (
13: Permission denied) while reading upstream, client: 15.60.178.88, server: demo.jichu.com, 
request: "GET /class/studChoiceConfig?v=463&_=1660181808733 HTTP/1.1", 
upstream: "http://15.60.178.88:3001/class/stu?v=463&_=1660181808733", host: "demo.jichu.com", 
referrer: "http://demo.jichu.com/class/class"

 

Solution:
vi /usr/local/nginx/conf/nginx.conf
#use nobody;
Modify to
use root;
Restart nginx

[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