reporter icon indicating copy to clipboard operation
reporter copied to clipboard

127.0.0.1:3000: socket: too many open files

Open JanKraljic opened this issue 4 years ago • 2 comments

Reporter is not closing connections to the Grafana, after max open files is reached (usually 1024) starts returning Code HTTP 500 Internal Server Error . It means that after 1024 is reporter not usable.

lsof -p

grafana-r 7654 root    5u     IPv4 38595998      0t0      TCP localhost:51240->localhost:3000 (ESTABLISHED)
grafana-r 7654 root    6u     IPv4 37998345      0t0      TCP localhost:57772->localhost:3000 (ESTABLISHED)
grafana-r 7654 root    7u     IPv4 37998346      0t0      TCP localhost:57774->localhost:3000 (ESTABLISHED)
grafana-r 7654 root    8u     IPv4 37998347      0t0      TCP localhost:57776->localhost:3000 (ESTABLISHED)

x1024

Reporter output: http: Accept error: accept tcp [::]:8686: accept4: too many open files; retrying in 1s

Grafana Version: 7.2.2 Reporter GIT version.

  • It there any parameter to force closing connection streams after PDF is read?
  • Any other workaround (increase max open files does not count)?

JanKraljic avatar Nov 13 '20 15:11 JanKraljic

Today I have faced the same problem. Temporary added a job to restart reporter service once a day.

bon3o avatar Nov 16 '20 08:11 bon3o

Today I have faced the same problem. Temporary added a job to restart reporter service once a day.

how can I restart the reporter?

andcard10 avatar Jul 14 '21 01:07 andcard10

My solution:Modify the api.go file

First, add the code to import

image

Then add the following code to the GetDashboard method

image

Add the same code to the GetPanelPng method

image

Finally, recompile and install grafana-Reporter

The above is my solution, I am not sure whether it will cause other adverse effects

425500133 avatar Oct 19 '21 10:10 425500133