Telegraf SQL Server Plugin Issue with Windows Authentication

I am experiencing issue with Telegraf SQL Server Plugin when I use a Domain level account.

Telegraf.conf SQL connection String:

[[inputs.sqlserver]]
servers = [
“Server=PMICHLAUSQL261\DEV;User id=Domain\s-dbtelegraf;Password=somepassword;app name=telegraf;log=1;”,
]

Error Log:
[inputs.sqlserver]: read tcp [::1]:63560->[::1]:49400: wsarecv: An existing connection was forcibly closed by the remote host.
2018-06-22T10:36:20Z D! Output [influxdb] buffer fullness: 0 / 5000 metrics.
2018-06-22T10:36:25Z D! Output [influxdb] buffer fullness: 0 / 5000 metrics.
2018-06-22T10:36:30Z E! Error in plugin [inputs.sqlserver]: write tcp [::1]:63609->[::1]:49400: wsasend: An existing connection was forcibly closed by the remote host.
2018-06-22T10:36:30Z E! Error in plugin [inputs.sqlserver]: write tcp 10.115.17.17:63613->10.115.17.17:49400: wsasend: An existing connection was forcibly closed by the remote host.
2018-06-22T10:36:30Z E! Error in plugin [inputs.sqlserver]: write tcp 10.115.17.17:63605->10.115.17.17:49400: wsasend: An existing connection was forcibly closed by the remote host.
2018-06-22T10:36:30Z E! Error in plugin [inputs.sqlserver]: write tcp 10.115.17.17:63603->10.115.17.17:49400: wsasend: An existing connection was forcibly closed by the remote host.
2018-06-22T10:36:30Z E! Error in plugin [inputs.sqlserver]: write tcp [::1]:63618->[::1]:49400: wsasend: An existing connection was forcibly closed by the remote host.
2018-06-22T10:36:30Z E! Error in plugin [inputs.sqlserver]: write tcp 10.115.17.17:63604->10.115.17.17:49400: wsasend: An existing connection was forcibly closed by the remote host.
2018-06-22T10:36:30Z E! Error in plugin [inputs.sqlserver]: write tcp [::1]:63597->[::1]:49400: wsasend: An existing connection was forcibly closed by the remote host.
2018-06-22T10:36:30Z E! Error in plugin [inputs.sqlserver]: write tcp [::1]:63601->[::1]:49400: wsasend: An existing connection was forcibly closed by the remote host.
2018-06-22T10:36:30Z E! Error in plugin [inputs.sqlserver]: write tcp 10.115.17.17:63612->10.115.17.17:49400: wsasend: An existing connection was forcibly closed by the remote host.
2018-06-22T10:36:30Z E! Error in plugin [inputs.sqlserver]: write tcp [::1]:63602->[::1]:49400: wsasend: An existing connection was forcibly closed by the remote host.
2018-06-22T10:36:30Z D! Output [influxdb] buffer fullness: 0 / 5000 metrics.
2018-06-22T10:36:35Z D! Output [influxdb] buffer fullness: 0 / 5000 metrics.
2018-06-22T10:36:40Z E! Error in plugin [inputs.sqlserver]: write tcp [::1]:63637->[::1]:49400: wsasend: An existing connection was forcibly closed by the remote host.
2018-06-22T10:36:40Z E! Error in plugin [inputs.sqlserver]: write tcp [::1]:63639->[::1]:49400: wsasend: An existing connection was forcibly closed by the remote host.
2018-06-22T10:36:40Z E! Error in plugin [inputs.sqlserver]: write tcp [::1]:63635->[::1]:49400: wsasend: An existing connection was forcibly closed by the remote host.
2018-06-22T10:36:40Z E! Error in plugin [inputs.sqlserver]: Login error: read tcp [::1]:63633->[::1]:49400: wsarecv: An existing connection was forcibly closed by the remote host.
2018-06-22T10:36:40Z E! Error in plugin [inputs.sqlserver]: write tcp [::1]:63636->[::1]:49400: wsasend: An existing connection was forcibly closed by the remote host.
2018-06-22T10:36:40Z E! Error in plugin [inputs.sqlserver]: write tcp [::1]:63638->[::1]:49400: wsasend: An existing connection was forcibly closed by the remote host.
2018-06-22T10:36:40Z E! Error in plugin [inputs.sqlserver]: write tcp [::1]:63634->[::1]:49400: wsasend: An existing connection was forcibly closed by the remote host.
2018-06-22T10:36:40Z E! Error in plugin [inputs.sqlserver]: write tcp [::1]:63642->[::1]:49400: wsasend: An existing connection was forcibly closed by the remote host.
2018-06-22T10:36:40Z E! Error in plugin [inputs.sqlserver]: write tcp [::1]:63641->[::1]:49400: wsasend: An existing connection was forcibly closed by the remote host.
2018-06-22T10:36:40Z E! Error in plugin [inputs.sqlserver]: write tcp [::1]:63640->[::1]:49400: wsasend: An existing connection was forcibly closed by the remote host.
2018-06-22T10:36:40Z D! Output [influxdb] buffer fullness: 0 / 5000 metrics.

Thanks in advance.

This looks like an error from the underlying package the Telegraf plugin relies on: GitHub - zensqlmonitor/go-mssqldb: Microsoft SQL server driver written in go language

Unfortunately, I’m not able to reproduce this, but I found some references to similar problems online. One user seems to have solved this issue by upgrading to SP4. Other users seem to have tracked this down to network connectivity problems.

It probably makes sense to capture some of your network traffic and look at the packets to get a better idea of what’s going on, as well as sharing more details about your setup and configuration.

@noahcrowley : Thanks for your reply. I found some documentation and suspect that the issue is linked with the ,Net framework version installed i.e. 4.5.2
There is a hotfix available for this issue. I will apply the hotfix and update the results.

1 Like

We have been experiencing these errors on SQL servers with Force Encryption checked and after building telegraf with original sql package the error went away. Working version is available for download here: