MSSQL Plugin connectex: Only one usage of each socket address (protocol/network address/port) is normally permitted

  • Grafana enterprise 11.3.1
  • Recently upgraded from 6.7.2

After a day or so of running, we end up our VM running Grafana failing with no TCP ports/sockets left. We have to reboot our host in order to get everything working again

  • What did you expect to happen?
    Continual operation without OS/application failure

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    logger=tsdb.mssql endpoint=queryData pluginId=mssql dsName=OURSQLHOST dsUID=000000003 uname= t=2025-02-22T02:51:22.3293712+11:00 level=error msg=“Query error” err=“unable to open tcp connection with host ‘OURSQLHOST:1433’: dial tcp SQLHOSTIP:1433: connectex: Only one usage of each socket address (protocol/network address/port) is normally permitted.”

These will continue happening for some time and then we will see:

logger=tsdb.mssql endpoint=queryData pluginId=mssql dsName=OURSQLHOST dsUID=000000003 uname= t=2025-02-22T02:54:19.5319853+11:00 level=error msg=“Query error” err=“unable to open tcp connection with host ‘:1433’: dial tcp :1433: bind: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full.”

  • Did you follow any online instructions? If so, what is the URL?
    Could not find information relating to these errors and the MS SQL datasource.

Our MSSQL data source connection limits are the same as the settings we used in Grafana 6.7.2 and this was stable without this error occurring

What is your current grafana version and what is it installed on? Is it behind IIS or are you running grafana-server.exe?

Current version is 11.3.1 installed on Windows Server 2016 data center in Azure.

It is behind IIS and IIS is running a reverse proxy.

Try running it without iis directly running the exe. Does that make a difference?

Sorry I think I answered partially wrong then
IIS is running a reverse proxy but we are still running Grafana directly as a windows service bound to the default 3000 port.

IIS is only used for the reverse proxy.

We just had another lock up so I’ve increased the amount of dynamic TCP ports to the machine to 49147 and reduced the TCP timed wait delay to 30s from 240s as per Microsoft network recommendations

1 Like

Bypass iis and run it temporarily without iis and does the issue still exist?

Can’t completely run it without IIS as its in production unfortunately.

The changes to windows seems to have made a difference. Fingers cross there have been no more lockups so far.

Thanks

1 Like

May I ask why you are running it behind IIS?