I’m trying to track down these input errors errors that I’m getting every 2-10 minutes: ERROR|input_controller.php|{"success": false, "message": "Format error, json value is not numeric"} for User: 1
I’m running 10.2.6 on a Raspberry Pi with a fresh install 2 weeks ago. All of my inputs are sent to emonPi thru the API via Python code I’ve written myself, so I’m sure I’ve got a badly formatted json value somewhere. The trouble is, I’ve got 50+ Inputs and even more Feeds. I’ve studied the Inputs and Feeds pages and can’t find the one(s) causing the error. Is there some way to learn more about the bad input, such as which node it’s on, or what the bad value actually is? Or some way to help pinpoint which Input is causing the error?
This is the first thing that came to mind. It may not be what’s causing your problem, and if it’s not,
then if nothing else, you’ve eliminated one source.
There are two variants of the API that handle JSON. One handles “JSON-like” strings, the
other handles valid JSON strings. Here’s a screenshot of the emonCMS inputs/api page
Thanks Brian - I edited the settings.ini file as you instructed and now I see lots more INFO entries in the emoncms log. Still, the input with the bad json format still shows up with the same ERROR line as when the log level was set to 2. I don’t see information helping me pinpoint the source of the error. It would be great if the error line included the node, or the label, or some other identifiers. But I guess that with a json error these attributes cannot be determined. I don’t know if it’s practical, but it would be helpful if the log showed the malformed json input. I’ve since found and corrected the source of the json error, so I’m “error-free” for now. Thanks for your help and ideas Brian and Robert.
I’m getting json input errors again, but this time I know that Feed 68 is the problem because it’s recently become inactive. I changed log to level 2 INFO and here’s the log surrounding the error:
If I didn’t already know that Feed 68 was the problem, I don’t see anything in the log that points to Feed 68 being the problem. It would be really helpful if the log showed more details about the json input error, such as which feed is causing it.
When posting code or bash output, please put in 3 ‘backticks’ (found at the top left of the keyboard normally) on a line on their own, then the code, then 3 more backticks on a line following the code.
```
code
```
If it is something like php you can add a language identifier that after the first 3 backticks so ```php
First, let me repeat that I’m asking if there are clues in the emoncms.log that indicate which feedid is causing an error (if not, then I’m requesting that if possible, future versions allow the emoncms.log to show more detail for errors). Specifically it would be really helpful if the log identified the feed causing an error. My challenge was trying to figure out which of my 170 feeds was causing the json error. Once I identified which feed was causing the error, I quickly fixed my Python code that sends the json string to emoncms. But simply identifying which feed was causing the error took a fair bit of time.
level = 1 give the most detail. Here’s a portion of the emoncms.log containing the ERROR. Am I missing something that indicates which feedid is causing the error?
You are quite right that more info is needed in the log messages, the user id was added by me nearly 3 years ago as I had a similar problem, however I had numerous user accounts with only a few feeds each so adding the user id was enough for my needs at the time and quite easy to do, adding more detail might not be as easy I fear.