SQL Server Error - write: connection reset by peer


I have a data source of SQL Server. I have created a table visualization, but when I try to access the table, I get the below error:

Status: 500. Message: db query error: failed to send SQL Batch: write tcp 172.X.X.X:43XXX->172.X.X.X:14XX: write: connection reset by peer

Can someone help me with this error? How can I resolve this issue?

Hey @abhinavanand,

Which SQL server instance are you using? It looks like Microsoft SQL Server but I’m not sure…
Did you enable logs? if yes please share it.

Also, can you share your authentication configuration?


Thanks for the response @codi639 ,

Yes, I am using Microsoft Sql Sever. Sometimes it works fine and I can see the data but when I try accessing it after 1-2 hrs, it shows me the above error.

The data source is already added for me, I don’t have permission to view its configurations. I am just using the data source in my table panel.

I have not enabled logs, Let me know how can I do it?

Can you connect manually (ie: not using Grafana) from the machine running
Grafana to the machine running SQL Server and perform a query?

Also, when describing IP addresses, please ensure that two different machines
are represented differently - don’t label them both “172.X.X.X”

If the first X in 172.X.X.X is a number between 16 and 31 inclusive, you can
just tell us the whole address - it’s private space not routable across the
Internet and gives away no sensitive information about your network.


1 Like

“Sometimes it works fine and I can see the data but when I try accessing it
after 1-2 hrs, it shows me the above error.”

That is extremely significant information.

Please explain what network connectivity and devices (eg: routers, firewalls,
anything performing NAT) you have between the machine running Grafana and the
machine running SQL Server.


1 Like

@pooh I am using VPN to access the data from Microsoft SQL server. Without VPN I can’t access it. Even with VPN connected, I get the same above error.

So, your grafana is installed locally or on remote company server?
Is the sql server hosted by company you work for? Is it live production server?

@yosiasz I am using Grafana Enterprise. I don’t have access to any of it’s configuration files.
Yes, The sql server is hosted by the company itself.

Where is this grafana enterprise hosted at?

on company server.

Have your admin check the log files on grafana

Vpn has nothing to do with it imo as both of these servers are on prem and can talk to each other wihtout vpn like @pooh stated above

No, The log files hasn’t been checked yet.

Is it something that can be fixed from the Dashboard side?
Let me know.

it could be fixed on dashboard side. the issue could be for example what kind of query you are using, is it querying 3 million rows? etc

but not sure why you don’t want to engage your admin

Another option is to install grafana locally and sql server dev (free) locally and mock the data in production and finish your dashboard locally and upload to remote grafana.

1 Like