我已经向AWS Elastic Beanstalk部署了一个Loopback 3应用程序,运行节点8.10。我一直得到API的失败请求,当我检查日志时,我只看到这个:
Error: Handshake inactivity timeout
at Handshake.<anonymous> (/var/app/current/node_modules/mysql/lib/protocol/Protocol.js:164:17)
at emitNone (events.js:106:13)
at Handshake.emit (events.js:208:7)
at Handshake._onTimeout (/var/app/current/node_modules/mysql/lib/protocol/sequences/Sequence.js:129:8)
at ontimeout (timers.js:482:11)
at tryOnTimeout (timers.js:317:5)
at Timer.listOnTimeout (timers.js:277:5)
--------------------
at Protocol._enqueue (/var/app/current/node_modules/mysql/lib/protocol/Protocol.js:145:48)
at Protocol.handshake (/var/app/current/node_modules/mysql/lib/protocol/Protocol.js:52:23)
at PoolConnection.connect (/var/app/current/node_modules/mysql/lib/Connection.js:130:18)
at Pool.getConnection (/var/app/current/node_modules/mysql/lib/Pool.js:48:16)
at MySQL.connect (/var/app/current/node_modules/loopback-connector-mysql/lib/mysql.js:89:17)
at Object.initializeDataSource [as initialize] (/var/app/current/node_modules/loopback-connector-mysql/lib/mysql.js:43:28)
at DataSource.setup (/var/app/current/node_modules/loopback-datasource-juggler/lib/datasource.js:425:19)
at new DataSource (/var/app/current/node_modules/loopback-datasource-juggler/lib/datasource.js:123:8)
at Registry.createDataSource (/var/app/current/node_modules/loopback/lib/registry.js:362:12)
at dataSourcesFromConfig (/var/app/current/node_modules/loopback/lib/application.js:522:19)
at Function.app.dataSource (/var/app/current/node_modules/loopback/lib/application.js:229:14)
at /var/app/current/node_modules/loopback-boot/lib/executor.js:191:9
at /var/app/current/node_modules/loopback-boot/lib/executor.js:282:5
at Array.forEach (<anonymous>)
at forEachKeyedObject (/var/app/current/node_modules/loopback-boot/lib/executor.js:281:20)
at setupDataSources (/var/app/current/node_modules/loopback-boot/lib/executor.js:181:3)
奇怪的是,我正在使用postgresql。我以前有一个mysql数据库,但在开发过程中迁移到pg。 mysql数据源仍然在datasources.production.json
中声明,但它没有用于任何模型。为什么我会收到此错误?