2

I am new to Microsoft SQL Server, please advise.

I am receiving the following error message when I deploy code into my development environment (which is hosted on Azure using Node.js (version 10) and Objection.js (1.4.0). It works fine locally and only seems to have issues with specific queries on the development environment.

Error Details

RequestError: Connection lost - read ECONNRESET 
    at handleError (/src/node_modules/mssql/lib/tedious.js:519:15) 
    at Connection.emit (events.js:203:15) 
    at Connection.socketError (/src/node_modules/tedious/lib/connection.js:1028:14) 
    at Socket.<anonymous> (/src/node_modules/tedious/lib/connection.js:878:18) 
    at Socket.emit (events.js:203:15) 
    at emitErrorNT (internal/streams/destroy.js:91:8) 
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3) 
    at process._tickCallback (internal/process/next_tick.js:63:19) 

Code

 return Order.query()
.joinEager('[shipments.shipmentQuantities.lineItem, lineItems.shipmentQuantities]')
.findById(id);

Connection File

database: {
  client: 'mssql',
  connection: {
  host: process.env.DB_HOST,
    user: process.env.DB_USER,
    password: process.env.DB_PASSWORD,
    database: process.env.DB_NAME,
    charset: 'utf8',
    stream: true,
       options: process.env.ENABLE_DB_SSL ? {
       port: 1433,
       database: process.env.DB_NAME,
       encrypt: true,
    } : undefined,
   },
    debug: false,
  },

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.