New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ConnectionError: Failed to connect to {{host}}:1433 - Cannot call write after a stream was destroyed #931
Comments
Hi @bj9215, What version of tedious are you using? Mssql package.json is using an outdated version of tedious (current tedious version is v6.2.0). Try updating that and see if it helps? :) |
Which version of Node.js are you running on? Do you have encryption enabled? As you're trying to connect to an older version of SQL Server, you most likely need to tweak the encryption settings to use an older version of TLS and use a ciphersuite that is supported on both SQL Server 2008 and the Node.js version you are using. |
@bj9215 Are you still having this issue? |
I have a similar proplem wit "tedious": "6.6.2", const config = {
server: 'local-sql-host',
authentication: {
type: 'default',
options: {
userName: process.env.AUTH_LOCAL_USR,
password: process.env.AUTH_LOCAL_PWD,
},
},
options: {
database: 'DATABASE_NAME',
encrypted: false,
},
}
|
forget it! |
@bj9215 Closing for now. Feel free to re-open if you're still having this issue! |
One million of thanks!! |
I ran into the same issue. Looks like node-mssql changed the encrypt default from false to true in this PR: |
@ataft's comment helped me solve my issue as well - setting "encrypt" to false fixed my issue. |
…(Sentry IOBROKER-SQL-W) * (Apollon77) Always set "encrypt" flag, even if false because else might en in default true (see tediousjs/tedious#931)
@crazyx13th Thanks, this helped me |
This is what if trying to fix on 1 week. |
Thanks. This solved the issue. i just added --tls-min-v1.0 flag |
Hola tengo el mismo error y ya trate de hacer lo que han comentado anterior mente y me sigue saliendo el mismo error Esta es mi cadena de conexión. const config = { |
I just used this parameter in database connection options, options: { encrypt: false } |
Error while connecting to Database (Sql Server 2008 R2)
I am using "mssql": "^5.1.0"
I am able to connect to localhost and SQL Server 2017
[Nest] 29632 - 07/29/2019, 9:34 PM [TypeOrmModule] Unable to connect to the database. Retrying (1)... +876ms
ConnectionError: Failed to connect to {{host}}:1433 - Cannot call write after a stream was destroyed
at Connection. (\nrwl\node_modules\mssql\lib\tedious.js:244:17)
at Object.onceWrapper (events.js:288:20)
at Connection.emit (events.js:200:13)
at Connection.socketError (\nrwl\node_modules\tedious\lib\connection.js:1098:12)
at Socket. (\nrwl\node_modules\tedious\lib\connection.js:971:14)
at Socket.emit (events.js:205:15)
at errorOrDestroy (internal/streams/destroy.js:107:12)
at onwriteError (_stream_writable.js:432:5)
at onwrite (_stream_writable.js:459:5)
at doWrite (_stream_writable.js:413:11)
Kindly suggest some solution :)
The text was updated successfully, but these errors were encountered: