본문 바로가기

개발/에러해결48

spawn app crashed : 에러 메시지 없는 에러 잡기 spawn app crashed : 에러 메시지 없는 에러 잡기 spawn app crashed 에러 내용 node express에서는 크게 동기 에러와 비동기 에러가 있습니다. 이는 다음과 같이 각각 error handler와 wrapping을 통해 잡을 수 있습니다. ... app.use(handlingError); ... export const handlingError = (err, req, res, next) => { let httpCode = StatusCodes.INTERNAL_SERVER_ERROR; let data = { success: false, data: {}, error: err.name, message: err.message, detail: err.stack, }; logger.e.. 2023. 5. 15.
Error: Transaction numbers are only allowed on a replica set member or mongos Error: Transaction numbers are only allowed on a replica set member or mongos mongoose transaction 에러 내용 mongoose에서 transaction 및 session을 사용하려고 하면 위와 같은 오류가 출력됩니다. mongoose transaction 에러 원인 default 설정인 standalone은 mongoose session의 transaction 기능을 사용할 수 없습니다. 단일 서버에서는 다수 데이터에 대한 다수 연산이 동시에 요청되더라도 atomicty 등을 지키면서 연산을 수행할 수 있습니다. 따라서 transaction은 standalone 에서는 필요하지 않습니다. 그러나 분산환경은 그렇지 않습니다. 따라.. 2023. 5. 15.
haproxy load balancer 중 /usr/local/etc/haproxy/haproxy.cfg: 'server mongo1' : could not resolve address 'mongo1' 또는 Failed to initialize server(s) addr. 2023-05-15 15:18:49 [ALERT] (1) : parsing [/usr/local/etc/haproxy/haproxy.cfg:20] : 'server mongo1' : could not resolve address 'mongo1'. 2023-05-15 15:19:09 [ALERT] (1) : parsing [/usr/local/etc/haproxy/haproxy.cfg:21] : 'server mongo2' : could not resolve address 'mongo2'. 2023-05-15 15:19:29 [ALERT] (1) : parsing [/usr/local/etc/haproxy/haproxy.cfg:22] : 'server mongo3' : could not resolve ad.. 2023. 5. 15.
MongoServerError: Authentication failed. MongoServerError: Authentication failed. 또는 MongoServerError: not authorized on admin to execute command MongoServerError: Authentication failed. 에러 내용 mongosh로 유저 생성 등의 초기화 과정을 수행하기 위해 db.auth()를 진행했지만 위와 같은 오류를 만났습니다. MongoServerError: Authentication failed. 에러 원인 놀랍게도 MONGO_INITDB_ROOT_USERNAME=root MONGO_INITDB_ROOT_PASSWORD=passwd 등으로 root의 username과 password를 설정해도 해당 username과 password로 바로.. 2023. 5. 15.
nginx load balancer 중 MongooseServerSelectionError: Invalid message size: 1347703880, max allowed: 67108864 또는 MongoParseError: option maxbsonsize is not supported MongooseServerSelectionError: Invalid message size: 1347703880, max allowed: 67108864 또는 MongoParseError: option maxbsonsize is not supported nginx load balancer 에러 내용 mongod replica set와 nginx load balancer을 구현하는 도중 mongoose.connect 시 다음과 같은 에러가 출력된다. 이에 대한 몇 가지 해결책인 bufferCommands : false 또는 maxBsonSize : 1677216를 mongoose.connect에 추가하여도 다음과 같은 에러가 출력되며 해결되지 않는다. 그 외에도 setParameter 등으로 maxBSON.. 2023. 5. 12.
mongod --keyFile 시 permissions on /etc/mongodb.key are too open 또는 /etc/mongodb.key: bad file mongod --keyFile 시 permissions on /etc/mongodb.key are too open 또는 /etc/mongodb.key: bad file key: bad file or key are too open 에러 내용 docker-compose를 활용해 mongodb replica set을 구축하는 도중 위와 같은 에러들을 만났습니다. key: bad file or key are too open 에러 원인 permissions on /etc/mongodb.key are too open : keyFile의 mode가 소유자 읽기 전용(400)이 아닌 다른 유저들이 읽을 수 있는 등 보안이 필요한 keyFile에 올바르지 않은 mode를 가지고 있기 때문입니다. /etc/mongodb... 2023. 5. 12.