Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Problems after APT Upgrade
#11
(01-31-2024, 10:19 AM)jbaumann Wrote: The main surprise for me was that the Moode update shouldn't be done via command line (i.e., apt), but using the GUI. And this obviously thwarts my normal strategies for repairing a system :-)

It is done that way because it is a system set up to be a music player, and offer updates without requiring a sysadmin skills.

Quote:The only thing that I would like to understand before I re-install on a new sdcard is what the "json.parse" error means (yes, it is back).

As things got screwed up it may be hard to tell what the cause of such error is. The UI JavaScript parses jsons coming from the backend (the library, for instance) but there may be others. I haven't looked into the logs, but maybe some more information is there, as "who" writes such log etc. (I think I have nothing to teach you about)
Reply
#12
(01-31-2024, 10:19 AM)jbaumann Wrote: @bitlab I know, I have been working with Debian for the last 25 years or so. And I have reasonable trust in my skills to repair any Debian installation that hasn't been foobar'd. And every time I do this I learn something, so these package locks are not as scary to me.

The main surprise for me was that the Moode update shouldn't be done via command line (i.e., apt), but using the GUI. And this obviously thwarts my normal strategies for repairing a system :-)

The only thing that I would like to understand before I re-install on a new sdcard is what the "json.parse" error means (yes, it is back). The normal sys logs show nothing relevant, the mpd log shows nothing relevant, and I simply would like to know where to look...

TL;DR: I have learned a lot from the botched update. I have, with your help, a very simply strategy for setting up the same system from scratch. I still have a few questions, and the answers would help me understand the system better.

Cheers, Joe

The challenge is that we don't test the "broken by apt upgrade update" scenario to learn what exactly gets wrecked because our time is best spent supporting and troubleshooting the built-in updating mechanism. 

Btw, the build-in updater  can be run from SSH line via the command below and prints status to the terminal as it's working. The script it runs is located in our Updates repo.

Code:
sudo /var/www/util/system-updater.sh moode

To understand how the updater works examine the source code. The same would apply if you want investigate any error messages. or troubleshoot the apt upgrade breakage.

The easiest way to do this is to download the sources from the repo and then use an IDE to globally search the sources for things.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#13
(01-31-2024, 10:19 AM)jbaumann Wrote: The only thing that I would like to understand before I re-install on a new sdcard is what the "json.parse" error means (yes, it is back). The normal sys logs show nothing relevant, the mpd log shows nothing relevant, and I simply would like to know where to look...

I run all my moOde players headless, and configure them through the Web interface using Firefox on Windows. In two years, I have never seen one boot without seeing a string of those messages come up until the interface screen loads, whether the player or a config screen. I seem to remember other people having seen it too. Seems harmless, though.

Colin
Reply
#14
(02-02-2024, 06:11 PM)ColinM Wrote:
(01-31-2024, 10:19 AM)jbaumann Wrote: The only thing that I would like to understand before I re-install on a new sdcard is what the "json.parse" error means (yes, it is back). The normal sys logs show nothing relevant, the mpd log shows nothing relevant, and I simply would like to know where to look...

I run all my moOde players headless, and configure them through the Web interface using Firefox on Windows. In two years, I have never seen one boot without seeing a string of those messages come up until the interface screen loads, whether the player or a config screen. I seem to remember other people having seen it too. Seems harmless, though.

Colin

Could one of you post at least one sline from the logs (and tell what log it is), as I am on a Pi with an uptime of 23 days, and I fail to find any; I'd like to have a peek, as I don't like any error... unless I understand what the error means.
Reply
#15
So, I've seen this error pop up in the webUI from time to time. I don't want to spend time trying to determine a sequence of operations which will cause it to occur consistently.

I believe this is an error thrown by the frontend JavaScript when it tries to parse an empty json payload received from the backend. Doubt you'll see much in the backend error logs. Maybe turn on the browser console to examine the state of affairs when the error occurs.

Regards,
Kent

PS - I seem to recall the error was more likely to occur if I had frontend code cached in the browser and then made changes to the backend code but my memory isn't as sharp as it used to be (cue the Prevagen commercial). Still, it's always a good idea to clear the browser cache or at least open the webUI in a new tab when playing with the code.
Reply
#16
(02-02-2024, 07:08 PM)TheOldPresbyope Wrote: PS - I seem to recall the error was more likely to occur if I had frontend code cached in the browser and then made changes to the backend code but my memory isn't as sharp as it used to be (cue the Prevagen commercial). Still, it's always a good idea to clear the browser cache or at least open the webUI in a new tab when playing with the code.

Ooo, ok... I have seen it too, then. But haven't in a long time...
A quick grep on all the .js files, apart from the jquery lib, json.parse is only in playerlib.js, and there is only related to the mpd responses (didn't check the code) and probably related to playqueue, or library (empty instead of an empty JSON object...?). They seem to do no harm.

ETA
Code:
// Client connects before mpd started by worker ?
                else if (MPD.json['error'] == 'SyntaxError: JSON Parse error: Unexpected EOF') {
                    notify('mpderror', 'JSON Parse error: Unexpected EOF');

Code:
// These particular errors occur when front-end is simply trying to reconnect
                       if (MPD.json['error']['message'] == 'JSON Parse error: Unexpected EOF' ||
                           MPD.json['error']['message'] == 'Unexpected end of JSON input') {
Reply
#17
I see this sometimes after a configuration change that needs a reboot. Most often when using a desktop browser (Firefox on Linux), but occasionally on Chrome/Android as well. They are indeed related to the cached page trying to read the library json and getting confused (assuming I'm reading the debug in the browser right). An F5 fixes it all. It is all in the client machine, nothing is even happening on moOde.
----------------
Robert
Reply
#18
(02-03-2024, 11:22 AM)the_bertrum Wrote: I see this sometimes after a configuration change that needs a reboot.  Most often when using a desktop browser (Firefox on Linux), but occasionally on Chrome/Android as well.  They are indeed related to the cached page trying to read the library json and getting confused (assuming I'm reading the debug in the browser right).  An F5 fixes it all.  It is all in the client machine, nothing is even happening on moOde.

Yep, I also have the same feeling. TTYTT, those messages could well be removed (there's nothing that can be done anyway, and it will save us some useless complaints).

We could, also, implement some UI logging via POST to the backend (only in the case of these errors/warnings); this would be more useful IMO... @Tim Curtis what do you think?
Reply
#19
(02-03-2024, 11:31 AM)Nutul Wrote:
(02-03-2024, 11:22 AM)the_bertrum Wrote: I see this sometimes after a configuration change that needs a reboot.  Most often when using a desktop browser (Firefox on Linux), but occasionally on Chrome/Android as well.  They are indeed related to the cached page trying to read the library json and getting confused (assuming I'm reading the debug in the browser right).  An F5 fixes it all.  It is all in the client machine, nothing is even happening on moOde.

Yep, I also have the same feeling. TTYTT, those messages could well be removed (there's nothing that can be done anyway, and it will save us some useless complaints).

We could, also, implement some UI logging via POST to the backend (only in the case of these errors/warnings); this would be more useful IMO... @Tim Curtis what do you think?

Prolly a good idea to look at the code that generates those messages but unless there are exact steps to reproduce the error(s) it would not be a good idea to just remove them or change them from notify() which is visible on the WebUI to debugLog() which only shows in the Browser console.

ETA: The OP reported this error message 
Code:
"json.parse unexpected character at line 1 column 1 of the json data"

IIRC there is a legit back-end scenario in the genLibrary() routine where the presence of non-UTF8 characters in the song file metadata can result in json parse failing and an empty libcache_.json file.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#20
(02-03-2024, 12:20 PM)Tim Curtis Wrote: ETA: The OP reported this error message 
Code:
"json.parse unexpected character at line 1 column 1 of the json data"

IIRC there is a legit back-end scenario in the genLibrary() routine where the presence of non-UTF8 characters in the song file metadata can result in json parse failing and an empty libcache_.json file.

Since I see no such message template anywhere, it looks like the response of the json.parse method directly from JQuery. This actually denotes an error in the data.
Reply


Forum Jump: