# Use the base App Engine Docker image, based on debian jessie.
FROM gcr.io/google_appengine/nodejs
# Install specific node.js version
RUN install_node v6.5.0
# Copy application code.
COPY . /app/
WORKDIR /app
# Set common env vars
ENV NODE_ENV dev
# Install dependencies.
RUN npm --unsafe-perm install
# start
CMD ["npm", "start"]
# [START app_yaml]
#runtime: nodejs
runtime: custom
vm: true
beta_settings:
cloud_sql_instances: "<cloud-sql-instance-name>"
# [END app_yaml]
{ Error: Connection lost: The server closed the connection.2016-09-08 15:32:39 default[20160908t164127] at Protocol.end (/app/node_modules/mysql/lib/protocol/Protocol.js:109:13)2016-09-08 15:32:39 default[20160908t164127] at Socket.<anonymous> (/app/node_modules/mysql/lib/Connection.js:115:28)2016-09-08 15:32:39 default[20160908t164127] at emitNone (events.js:91:20)2016-09-08 15:32:39 default[20160908t164127] at Socket.emit (events.js:185:7)2016-09-08 15:32:39 default[20160908t164127] at endReadableNT (_stream_readable.js:974:12)2016-09-08 15:32:39 default[20160908t164127] at _combinedTickCallback (internal/process/next_tick.js:74:11)2016-09-08 15:32:39 default[20160908t164127] at process._tickCallback (internal/process/next_tick.js:98:9)2016-09-08 15:32:39 default[20160908t164127] --------------------2016-09-08 15:32:39 default[20160908t164127] at Protocol._enqueue (/app/node_modules/mysql/lib/protocol/Protocol.js:141:48)2016-09-08 15:32:39 default[20160908t164127] at Protocol.handshake (/app/node_modules/mysql/lib/protocol/Protocol.js:52:41)2016-09-08 15:32:39 default[20160908t164127] at PoolConnection.connect (/app/node_modules/mysql/lib/Connection.js:136:18)2016-09-08 15:32:39 default[20160908t164127] at Pool.getConnection (/app/node_modules/mysql/lib/Pool.js:48:16)2016-09-08 15:32:39 default[20160908t164127] at Promise (/app/node_modules/typeorm/driver/mysql/MysqlDriver.js:205:27)2016-09-08 15:32:39 default[20160908t164127] at MysqlDriver.retrieveDatabaseConnection (/app/node_modules/typeorm/driver/mysql/MysqlDriver.js:204:20)2016-09-08 15:32:39 default[20160908t164127] at MysqlDriver.<anonymous> (/app/node_modules/typeorm/driver/mysql/MysqlDriver.js:101:51)2016-09-08 15:32:39 default[20160908t164127] at next (native)2016-09-08 15:32:39 default[20160908t164127] at /app/node_modules/typeorm/driver/mysql/MysqlDriver.js:7:652016-09-08 15:32:39 default[20160908t164127] at __awaiter (/app/node_modules/typeorm/driver/mysql/MysqlDriver.js:3:12) fatal: true, code: 'PROTOCOL_CONNECTION_LOST' }
Hello!I'm currently developing a Node.js application (Express framework and TypeORM) with MySQL Second Generation.
When the Node.js application runs on a local machine, they are any problem to connect and use the MySQL instance.
<-- HandshakeInitializationPacketHandshakeInitializationPacket { protocolVersion: 10, serverVersion: '5.7.14-google-log', threadId: 5596, scrambleBuff1: <Buffer 14 4a 4e 33 14 49 2c 0e>, filler1: <Buffer 00>, serverCapabilities1: 63487, serverLanguage: 33, serverStatus: 2, serverCapabilities2: 49663, scrambleLength: 21, filler2: <Buffer 00 00 00 00 00 00 00 00 00 00>, scrambleBuff2: <Buffer 6b 5a 26 35 34 65 23 01 6c 51 7b 36>, filler3: <Buffer 00>, pluginData: 'mysql_native_password', protocol41: true }
--> ClientAuthenticationPacketClientAuthenticationPacket { clientFlags: 455631, maxPacketSize: 0, charsetNumber: 33, filler: undefined, user: *****, scrambleBuff: <Buffer f3 9e 6e dc 09 0b 2e 2a b0 70 d9 9a c1 b2 39 53 31 ac c8 2b>, database: *****, protocol41: true }
Connection fails: Error: Connection lost: The server closed the connection.It will be retried for the next request.events.js:160 throw er; // Unhandled 'error' event ^
Error: Connection lost: The server closed the connection.
at Protocol.end (/app/node_modules/mysql/lib/protocol/Protocol.js:109:13)
at Socket.<anonymous> (/app/node_modules/mysql/lib/Connection.js:109:28)
at emitNone (events.js:91:20)
at Socket.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)