You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var connection = mysql.createConnection({
host : "remotemysql.com",
user: "",
database: "",
password: ""
//port:"3306"
});
}
exports.handler = function (event, context, callback) {
context.callbackWaitsForEmptyEventLoop =false;
connection.connect(function(err) {
if (err) {
console.error('Error connecting: ' + err.stack);
}
console.log('Connected as thread id: ' + connection.threadId);
});
var results=[];
//SQL Query > Select Data
return new Promise((resolve, reject) => {
const readTable = `SELECT * FROM num_of_likes`;
connection.query(readTable, (err, results, fields) => {
if (err) {
reject(err);
} else {
resolve({statusCode: 200, body: {results}});
}
});
});
*Lambda server is listening on 9000
Request from ::1: GET /connect
Error connecting: Error: Received packet in the wrong sequence.
at A._parsePacket (/Users/riteshkarwa/netlify/functions/connect.js:1:93387)
at A._parsePacket (/Users/riteshkarwa/netlify/functions/connect.js:1:102113)
at A.write (/Users/riteshkarwa/netlify/functions/connect.js:1:96341)
at A.write (/Users/riteshkarwa/netlify/functions/connect.js:1:89855)
at Socket. (/Users/riteshkarwa/netlify/functions/connect.js:1:7771)
at Socket. (/Users/riteshkarwa/netlify/functions/connect.js:1:6835)
at Socket.emit (events.js:210:5)
at addChunk (_stream_readable.js:309:12)
at readableAddChunk (_stream_readable.js:290:11)
at Socket.Readable.push (_stream_readable.js:224:10)
at TCP.onStreamRead (internal/stream_base_commons.js:182:23)
at A._enqueue (/Users/riteshkarwa/netlify/functions/connect.js:1:91233)
at A.handshake (/Users/riteshkarwa/netlify/functions/connect.js:1:89978)
at o.connect (/Users/riteshkarwa/netlify/functions/connect.js:1:8643)
at Object.E.handler (/Users/riteshkarwa/netlify/functions/connect.js:1:238235)
at /Users/riteshkarwa/netlify/node_modules/netlify-lambda/lib/serve.js:144:27
at Layer.handle [as handle_request] (/Users/riteshkarwa/netlify/node_modules/express/lib/router/layer.js:95:5)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:137:13)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at Route.dispatch (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/Users/riteshkarwa/netlify/node_modules/express/lib/router/layer.js:95:5)
at /Users/riteshkarwa/netlify/node_modules/express/lib/router/index.js:281:22
Connected as thread id: 15223054
Response with status 500 in 2105 ms.
Error during invocation: Error: Received packet in the wrong sequence.
at A._parsePacket (/Users/riteshkarwa/netlify/functions/connect.js:1:93387)
at A._parsePacket (/Users/riteshkarwa/netlify/functions/connect.js:1:102113)
at A.write (/Users/riteshkarwa/netlify/functions/connect.js:1:96341)
at A.write (/Users/riteshkarwa/netlify/functions/connect.js:1:89855)
at Socket. (/Users/riteshkarwa/netlify/functions/connect.js:1:7771)
at Socket. (/Users/riteshkarwa/netlify/functions/connect.js:1:6835)
at Socket.emit (events.js:210:5)
at addChunk (_stream_readable.js:309:12)
at readableAddChunk (_stream_readable.js:290:11)
at Socket.Readable.push (_stream_readable.js:224:10)
at TCP.onStreamRead (internal/stream_base_commons.js:182:23)
at A._enqueue (/Users/riteshkarwa/netlify/functions/connect.js:1:91233)
at A.handshake (/Users/riteshkarwa/netlify/functions/connect.js:1:89978)
at o.connect (/Users/riteshkarwa/netlify/functions/connect.js:1:8643)
at Object.E.handler (/Users/riteshkarwa/netlify/functions/connect.js:1:238235)
at /Users/riteshkarwa/netlify/node_modules/netlify-lambda/lib/serve.js:144:27
at Layer.handle [as handle_request] (/Users/riteshkarwa/netlify/node_modules/express/lib/router/layer.js:95:5)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:137:13)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at Route.dispatch (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/Users/riteshkarwa/netlify/node_modules/express/lib/router/layer.js:95:5)
at /Users/riteshkarwa/netlify/node_modules/express/lib/router/index.js:281:22 {
code: ‘PROTOCOL_INCORRECT_PACKET_SEQUENCE’,
fatal: true
The text was updated successfully, but these errors were encountered:
link to gihub repo https://github.com/riteshkarwa/my-repository
created a connect.js file the code live in there
*Lambda server is listening on 9000
Request from ::1: GET /connect
Error connecting: Error: Received packet in the wrong sequence.
at A._parsePacket (/Users/riteshkarwa/netlify/functions/connect.js:1:93387)
at A._parsePacket (/Users/riteshkarwa/netlify/functions/connect.js:1:102113)
at A.write (/Users/riteshkarwa/netlify/functions/connect.js:1:96341)
at A.write (/Users/riteshkarwa/netlify/functions/connect.js:1:89855)
at Socket. (/Users/riteshkarwa/netlify/functions/connect.js:1:7771)
at Socket. (/Users/riteshkarwa/netlify/functions/connect.js:1:6835)
at Socket.emit (events.js:210:5)
at addChunk (_stream_readable.js:309:12)
at readableAddChunk (_stream_readable.js:290:11)
at Socket.Readable.push (_stream_readable.js:224:10)
at TCP.onStreamRead (internal/stream_base_commons.js:182:23)
at A._enqueue (/Users/riteshkarwa/netlify/functions/connect.js:1:91233)
at A.handshake (/Users/riteshkarwa/netlify/functions/connect.js:1:89978)
at o.connect (/Users/riteshkarwa/netlify/functions/connect.js:1:8643)
at Object.E.handler (/Users/riteshkarwa/netlify/functions/connect.js:1:238235)
at /Users/riteshkarwa/netlify/node_modules/netlify-lambda/lib/serve.js:144:27
at Layer.handle [as handle_request] (/Users/riteshkarwa/netlify/node_modules/express/lib/router/layer.js:95:5)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:137:13)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at Route.dispatch (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/Users/riteshkarwa/netlify/node_modules/express/lib/router/layer.js:95:5)
at /Users/riteshkarwa/netlify/node_modules/express/lib/router/index.js:281:22
Connected as thread id: 15223054
Response with status 500 in 2105 ms.
Error during invocation: Error: Received packet in the wrong sequence.
at A._parsePacket (/Users/riteshkarwa/netlify/functions/connect.js:1:93387)
at A._parsePacket (/Users/riteshkarwa/netlify/functions/connect.js:1:102113)
at A.write (/Users/riteshkarwa/netlify/functions/connect.js:1:96341)
at A.write (/Users/riteshkarwa/netlify/functions/connect.js:1:89855)
at Socket. (/Users/riteshkarwa/netlify/functions/connect.js:1:7771)
at Socket. (/Users/riteshkarwa/netlify/functions/connect.js:1:6835)
at Socket.emit (events.js:210:5)
at addChunk (_stream_readable.js:309:12)
at readableAddChunk (_stream_readable.js:290:11)
at Socket.Readable.push (_stream_readable.js:224:10)
at TCP.onStreamRead (internal/stream_base_commons.js:182:23)
at A._enqueue (/Users/riteshkarwa/netlify/functions/connect.js:1:91233)
at A.handshake (/Users/riteshkarwa/netlify/functions/connect.js:1:89978)
at o.connect (/Users/riteshkarwa/netlify/functions/connect.js:1:8643)
at Object.E.handler (/Users/riteshkarwa/netlify/functions/connect.js:1:238235)
at /Users/riteshkarwa/netlify/node_modules/netlify-lambda/lib/serve.js:144:27
at Layer.handle [as handle_request] (/Users/riteshkarwa/netlify/node_modules/express/lib/router/layer.js:95:5)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:137:13)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at next (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:131:14)
at Route.dispatch (/Users/riteshkarwa/netlify/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/Users/riteshkarwa/netlify/node_modules/express/lib/router/layer.js:95:5)
at /Users/riteshkarwa/netlify/node_modules/express/lib/router/index.js:281:22 {
code: ‘PROTOCOL_INCORRECT_PACKET_SEQUENCE’,
fatal: true
The text was updated successfully, but these errors were encountered: