Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unexpected end of JSON input #4297

Closed
pc10201 opened this Issue Jun 21, 2018 · 7 comments

Comments

Projects
None yet
5 participants
@pc10201
Copy link

pc10201 commented Jun 21, 2018

Prometheu version=2.3.1

level=error ts=2018-06-21T08:20:01.914472896Z caller=file.go:321 component="discovery manager scrape" discovery=file msg="Error reading file" path=/etc/prometheus/jobs/node.json err="unexpected end of JSON input"

But /etc/prometheus/jobs/node.json file is a valid json file.I use

python -m json.tool /etc/prometheus/jobs/node.json

to check it

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Jun 21, 2018

Is the file being created atomically via rename?

@pc10201

This comment has been minimized.

Copy link
Author

pc10201 commented Jun 22, 2018

I know the reason.

I write a program to update /etc/prometheus/jobs/node.json file every minute

And I set refresh_interval to 15s in prometheus.yml

@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Jul 6, 2018

@pc10201 can you close the issue in that case?

@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Jul 10, 2018

@pc10201 I'm closing the issue as it looks like you got things sorted out. If this isn't the case, I recommend that you ask for help on our user mailing list.

@sorx00

This comment has been minimized.

Copy link

sorx00 commented Dec 17, 2018

@pc10201 How you fixed this problem? I have discovery service for Rancher, which rewrite job file every 30 seconds. So every time Prom try to read this file, it's putting error into log.

@currycan

This comment has been minimized.

Copy link

currycan commented Jan 14, 2019

I met the same problem,the prometheus version is 2.4.3.

@pc10201

This comment has been minimized.

Copy link
Author

pc10201 commented Feb 17, 2019

@pc10201 How you fixed this problem? I have discovery service for Rancher, which rewrite job file every 30 seconds. So every time Prom try to read this file, it's putting error into log.

I do not fix it.But I change my program to create a tmp file,if the file is same as before and will not override it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.