-
Notifications
You must be signed in to change notification settings - Fork 12
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 on q.parse() #6
Comments
Hi @ianrapha, Any chance you can provide me with the Which version of MKLivestatus are you using? |
Hello @vbatoufflet Sorry, I cannot provide the content right now. I'll try to remove the sensitive parts and attach here. The file size is 106496 bytes and 915 lines. I tested with all tables and the problem occurred only on services table. The MKLs version is 1.2.8. |
Probably something is happening with OutputFormat: json. |
I have also noticed this problem when retrieving larger numbers of services. Filtering for state = 0 with approx 800 results works. On a larger Nagios installation with approx 1800 results, I get "Error: unexpected end of JSON input". Looking at the Exec() function in query.go, data is created with a length of 1024 and there is then a check for new line:
If I temporarily change this:
I then see the new line being found several times before reaching the end of the data, which is why a larger set of results is truncated, but a smaller set is okay.
So as a quick workaround I changed the length of data to 10240. |
Hi all, Sorry for the huge delay on this. I didn't took the time to maintain this project a lot this year. The issue is now fixed. After some additional debugging, the fact is that the problem was triggered by having |
Hi,
I'm trying to use the lib but i'm getting an error. I dumped the buf.Bytes() content and the JSON is ending with a comma not the enclosing bracket.
But when i tested with unixcat (line below) using the statement, the file generation ran successfully with a 2.3MB size.
/path/to/unixcat < services /path/to//live >> services.csv
The statement generated by q.buildCmd() is below.
I didn't find any coding issue and I'm asking for help.
Thanks,
Ian Raphael
The text was updated successfully, but these errors were encountered: