script-exporter icon indicating copy to clipboard operation
script-exporter copied to clipboard

Error: Get http://localhost:9661/metrics/main: EOF

Open kevinekw opened this issue 6 years ago • 6 comments

Hi ncabatoff,

Thank you for providing such an awesome exporter. I'm fairly new to Prometheus, so please bear with me :)

I have been using your script-exporter against a python executable file that runs some oracle sql query and output in the Prometheus text exposision format.

Out of the 3 queries, 2 of them are working fine (script duration is less than 5sec) and prometheus did not display any errors. The third one sometimes works fine, and sometimes gives me and EOF error as shown: eof_error eof_error2

This script duration runs between 5-60sec. This depends on how busy the database is, the script duration will vary.

To be honest, I dont think this is a script duration issue. Looking at the error, would you be able to tell me what could be the problem and how I could fix it?

Thank you in advance :)

Regards, Kevin

kevinekw avatar May 03 '18 02:05 kevinekw

Not sure, but I fixed a serious bug (race condition) a few days ago, so you might want to try updating. Otherwise, are you seeing anything in the exporter's stdout/stderr? Are any of the script_exporter internal error metrics nonzero?

ncabatoff avatar May 13 '18 19:05 ncabatoff

I see the exact same issue randomly appearing for one of my targets. The script logs that it was invoked, but somehow Prometheus does not receive the response. Can't see anything in Prometheus' or the script exporter's logs. Using the 0.1.3 release.

zstoth avatar Nov 12 '18 11:11 zstoth

@zstoth I'm having similar issue. What happens when you curl the exporter directly?

$ time curl localhost:9661/metrics/servers.py
curl: (52) Empty reply from server

real	0m21.358s
user	0m0.008s
sys	0m0.000s

Seeing the same EOF error in Prometheus targets, and curl returns with the empty reply message shown above. Couple things of note.

  1. Running the script directly with ./servers.py is successful and takes ~30 seconds.
  2. Running the script via curl or as Prometheus returns the above mentioned errors, however the script is successfully running in both cases (confirmed with log files). Have scrape interval set to 60 seconds and timeout 50 seconds for the specific Prometheus job.

nikosmeds avatar Nov 15 '18 21:11 nikosmeds

Possibly related to https://github.com/ncabatoff/script-exporter/pull/6 ?

EDIT: Yep. I recompiled the binary with change in https://github.com/ncabatoff/script-exporter/pull/6 and it has resolved the issue.

nikosmeds avatar Nov 15 '18 21:11 nikosmeds

For me setting scrape_timeout to 5 min (before 1 min) solved a similar issue in another project.

Go-Pomegranate avatar Mar 13 '20 16:03 Go-Pomegranate

I also had a similar error, but it happened in the process of prometheus notifying alertmanager, please move: https://github.com/prometheus/prometheus/issues/9176 Do you have a solution to the error, thank you very much!

jialanli avatar Aug 09 '21 09:08 jialanli