question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Configuring SQL Server timeout

See original GitHub issue

Environment

Knex version: 0.19.5 Database + version: SQL Server 2018 OS: Windows (AWS RDS)

@smorey2.

Bug

This may not strictly be a bug and more of a bug/feature request hybrid (I’d lean towards the former). When setting the connectionTimeout option for SQL Server, it doesn’t seem to actually apply - i.e., the default is 15000ms, and after setting the value to 30000, it still times out at 15000. Is changing the request timeout possible with SQL Server?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
juicetincommented, Feb 19, 2020

Hi @elhigu

    client: "mssql",
    connection: {
      host: STG_HOST,
      user: STG_USER,
      password: STG_PASSWORD,
      port: Number(STG_PORT),
      database: STG_DB,
      connectionTimeout: 20000,
    }

This is where the connectionTimeout option was set, as you pointed out in a past issue https://github.com/knex/knex/issues/2699

However, this option didn’t take effect, as the default timeout of 15000ms was still being enforced (as stated in the error when knex killed the request at 15000ms).

0reactions
woodchuckcommented, Nov 17, 2021

For the benefit of future travelers, I believe this should be specified as follows. Note connectTimeout vs. connectionTimeout.

client: "mssql",
connection: {
  host: STG_HOST,
  user: STG_USER,
  password: STG_PASSWORD,
  port: Number(STG_PORT),
  database: STG_DB,
  options: {
    connectTimeout: 20000,
  }
}

https://github.com/tediousjs/tedious/issues/778 https://tediousjs.github.io/tedious/api-connection.html#function_newConnection

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure the remote login timeout Server Configuration Option
To configure the remote login timeout option · In Object Explorer, right-click a server and select Properties. · Click the Advanced node. ·...
Read more >
How to Increase the MS SQL Remote Query Timeout?
Connect to MS SQL server via SQL Management Studio. · In Object Explorer, right-click on the server name and then select Properties. ·...
Read more >
Is it possible to set a timeout for a SQL query on Microsoft SQL ...
As far as I know, apart from setting the command or connection timeouts in the client, there is no way to change timeouts...
Read more >
Remote Query Timeout Option – Common SQL Server ...
Use the remote query timeout option to specify how long, in seconds, a remote operation can take before Microsoft SQL Server times out....
Read more >
How to increase the timeout for a data source with SQL Server ...
Configure the connection string to increase the connection time-out and define the pool size. For example, if the data source connection of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found