source

노드 속편화JS 서버에서 "ERR_UNKNOWN_ENCODING" 오류가 발생했습니다.

factcode 2022. 9. 21. 23:23
반응형

노드 속편화JS 서버에서 "ERR_UNKNOWN_ENCODING" 오류가 발생했습니다.

누가 문제 찾는 것 좀 도와줄래?다음 오류가 나타납니다.

node:internal/streams/writable:296
       throw new ERR_UNKNOWN_ENCODING(encoding);
       ^

 TypeError [ERR_UNKNOWN_ENCODING]: Unknown encoding: <ref *1> Handshake {
   _events: [Object: null prototype],
   _eventsCount: 1,
   _maxListeners: undefined,
   sequenceNo: 1,
   compressSequenceNo: -1,
   resolve: [Function: bound _authSucceedHandler],
   reject: [Function: bound _authFailHandler],
   sending: false,
   _createSecureContext: [Function: bound _createSecureContext],
   _addCommand: [Function: bound _addCommandEnable],
   getSocket: [Function: _getSocket],
   onPacketReceive: [Function: parseHandshakeInit],
   plugin: [Circular *1],
   [Symbol(kCapture)]: false
 }
     at new NodeError (node:internal/errors:259:15)
     at Socket.Writable.write (node:internal/streams/writable:296:13)
     at PacketOutputStream.flushBufferBasic (/var/www/app/node_modules/mariadb/lib/io/packet-output-stream.js:444:17)
     at Object.send (/var/www/app/node_modules/mariadb/lib/cmd/handshake/client-handshake-response.js:118:7)
     at Handshake.parseHandshakeInit (/var/www/app/node_modules/mariadb/lib/cmd/handshake/handshake.js:82:31)
     at PacketInputStream.receivePacketBasic (/var/www/app/node_modules/mariadb/lib/io/packet-input-stream.js:104:9)
     at PacketInputStream.onData (/var/www/app/node_modules/mariadb/lib/io/packet-input-stream.js:169:20)
     at Socket.emit (node:events:327:20)
     at addChunk (node:internal/streams/readable:304:12)
     at readableAddChunk (node:internal/streams/readable:279:9) {
   code: 'ERR_UNKNOWN_ENCODING'
 }

저는 현재 무엇이 문제인지 전혀 모르겠습니다.문제는 여기에 있다는 것을 알았습니다.

const sequelize = new Sequelize(process.env.DB_DATABASE, process.env.DB_USER, process.env.DB_PASSWORD, {
    host: process.env.DB_HOST,
    port: process.env.DB_PORT,
    dialect: 'mariadb',
});

sequelize.authenticate()
    .then(() => {
        logger.log('info', 'Connected to database')
    })
    .catch((error) => {
        logger.log('error', 'Failed to connect to database!');
        logger.log('error', JSON.stringify(error));
    })

에서authenticate기능.데이터베이스: mariadb: 10.5.7 초점 (도커)

이전 버전에서는 모든 것이 작동했습니다. 이전 버전의 MariaDB를 사용했기 때문에npm update문제가 저절로 해결되었습니다.

언급URL : https://stackoverflow.com/questions/64750785/sequelize-nodejs-server-throwing-err-unknown-encoding-error

반응형