Posts: 13,429
Threads: 304
Joined: Mar 2018
Reputation:
545
(02-03-2024, 01:14 PM)Nutul Wrote: (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.
Yes it's prolly empty JSON data being returned by MPD to the front end thats causing the error to be thrown by the JSON parse function. See below.
Code: // MPD metadata engine
function engineMpd() {
$.ajax({
type: 'GET',
url: 'engine-mpd.php?state=' + MPD.json['state'],
async: true,
cache: false,
success: function(data) {
debugLog('engineMpd(): success branch: data=(' + data + ')');
// Always have valid json
try {
MPD.json = JSON.parse(data);
//console.log(MPD.json);
}
catch (e) {
MPD.json['error'] = e;
}
Why is it empty? Thats what needs to be reproducible in order to possibly improve the error handling and messages.
Posts: 1,281
Threads: 24
Joined: Jun 2022
Reputation:
42
(02-03-2024, 02:20 PM)Tim Curtis Wrote: (02-03-2024, 01:14 PM)Nutul Wrote: (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.
Yes it's prolly empty JSON data being returned by MPD to the front end thats causing the error to be thrown by the JSON parse function. See below.
Code: // MPD metadata engine
function engineMpd() {
$.ajax({
type: 'GET',
url: 'engine-mpd.php?state=' + MPD.json['state'],
async: true,
cache: false,
success: function(data) {
debugLog('engineMpd(): success branch: data=(' + data + ')');
// Always have valid json
try {
MPD.json = JSON.parse(data);
//console.log(MPD.json);
}
catch (e) {
MPD.json['error'] = e;
}
Why is it empty? Thats what needs to be reproducible in order to possibly improve the error handling and messages.
This...
Code: engine-mpd.php?state=' + MPD.json['state']
together with this...?
Code: // Check for Worker startup complete
if ($result[0]['value'] == '0') {
exit; // Worker startup is not finished yet');
}
Posts: 13,429
Threads: 304
Joined: Mar 2018
Reputation:
545
Could be but to confirm there needs to be a recipe for reproducing the error that was mentioned earlier.
Posts: 16
Threads: 2
Joined: May 2021
Reputation:
1
02-03-2024, 08:36 PM
(This post was last modified: 02-03-2024, 08:39 PM by ColinM.)
(02-03-2024, 02:37 PM)Tim Curtis Wrote: Could be but to confirm there needs to be a recipe for reproducing the error that was mentioned earlier.
My infallible recipe for this error is to initiate a restart from Firefox on Windows. This produces 5 or 6 error popups with "json.parse unexpected character at line 1 column 1 of the json data" before the player screen loads.
Restarting from Vivaldi on Windows or Chromium on Raspberry Pi OS doesn't do anything odd.
Startup log from Firefox restart:
Code: 20240203 202658 worker: --
20240203 202658 worker: -- Start moOde 8 series
20240203 202658 worker: --
20240203 202658 worker: Successfully daemonized
20240203 202658 worker: Wait for Linux startup...
20240203 202753 worker: Linux startup complete
20240203 202753 worker: Boot config backed up
20240203 202755 worker: Session loaded
20240203 202756 worker: Package holds applied
20240203 202757 worker: File check complete
20240203 202757 worker: Debug logging off
20240203 202757 worker: Reduced logging off
20240203 202757 worker: --
20240203 202757 worker: -- Audio debug
20240203 202757 worker: --
20240203 202757 worker: ALSA cards: 0:IQaudIODAC | 1:empty | 2:empty | 3:empty
20240203 202757 worker: MPD config: 0:IQaudIO Pi-DAC+ | mixer:Digital | cardnum:0
20240203 202757 worker: Mixer name: [Digital]
20240203 202757 worker: Hdwr volume: set to 0%
20240203 202757 worker: --
20240203 202757 worker: -- System
20240203 202757 worker: --
20240203 202759 worker: Host: Main
20240203 202759 worker: Model: Pi-4B 1.1 2GB
20240203 202759 worker: moOde: 8.3.7 2023-12-07
20240203 202759 worker: RaspiOS: 11.5 Bullseye 64-bit
20240203 202759 worker: Kernel: 6.1.21 64-bit
20240203 202759 worker: MPD ver: 0.23.14
20240203 202759 worker: CPU gov: ondemand
20240203 202759 worker: Userid: pi
20240203 202759 worker: Homedir: /home/pi
20240203 202759 worker: Timezone: Europe/London
20240203 202759 worker: Keyboard: gb
20240203 202759 worker: USB boot: enabled
20240203 202759 worker: File sys: expanded
20240203 202759 worker: HDMI out: off
20240203 202759 worker: Sys LED0: on
20240203 202759 worker: Sys LED1: on
20240203 202759 worker: --
20240203 202759 worker: -- Network
20240203 202759 worker: --
20240203 202759 worker: Eth: adapter exists
20240203 202759 worker: Eth: timeout up to 30 secs
20240203 202759 worker: Eth: method dhcp
20240203 202759 worker: Eth: address 192.168.1.2
20240203 202759 worker: Eth: netmask 255.255.255.0
20240203 202759 worker: Eth: gateway 192.168.1.1
20240203 202759 worker: Eth: pri DNS 192.168.1.100
20240203 202759 worker: Eth: domain lan
20240203 202759 worker: Wlan: adapter does not exist
20240203 202759 worker: --
20240203 202759 worker: -- Software update
20240203 202759 worker: --
20240203 202759 worker: Automatic check: on
20240203 202759 worker: Checking for available update...
20240203 202800 worker: Software is up to date
20240203 202800 worker: --
20240203 202800 worker: -- File sharing
20240203 202800 worker: --
20240203 202800 worker: SMB file sharing: off
20240203 202800 worker: NFS file sharing: off
20240203 202800 worker: DLNA file sharing: off
20240203 202800 worker: --
20240203 202800 worker: -- Audio config
20240203 202800 worker: --
20240203 202800 worker: MPD config: updated
20240203 202800 worker: Audio device: IQaudIO Pi-DAC+
20240203 202800 worker: Formats: S16_LE, S24_LE, S32_LE
20240203 202800 worker: Mixer type Hardware
20240203 202800 worker: Mixer name Digital
20240203 202800 worker: Hdwr volume: controller detected
20240203 202800 worker: ALSA max vol: 100%
20240203 202800 worker: ALSA card: 0
20240203 202800 worker: ALSA mode: Default
20240203 202800 worker: ALSA loopback: off
20240203 202800 worker: CamillaDSP: off
20240203 202800 worker: Renderers: active flags reset
20240203 202800 worker: --
20240203 202800 worker: -- MPD startup
20240203 202800 worker: --
20240203 202801 worker: MPD service: started
20240203 202801 worker: MPD port 6600: accepting connections
20240203 202801 worker: MPD ALSA Default: on
20240203 202801 worker: MPD ALSA Bluetooth: off
20240203 202801 worker: MPD HTTP Server: off
20240203 202801 worker: MPD crossfade: off
20240203 202801 worker: MPD ignore CUE: yes
20240203 202801 worker: MPD CDSP volsync: off
20240203 202801 worker: MPD CDSP volrange: 60 dB
20240203 202801 worker: --
20240203 202801 worker: -- Music sources
20240203 202801 worker: --
20240203 202801 worker: USB auto-mount: udisks-glue
20240203 202801 worker: USB drives: no drives found
20240203 202801 worker: NAS sources: no music sources defined
20240203 202801 worker: --
20240203 202801 worker: -- Feature availability
20240203 202801 worker: --
20240203 202801 worker: Input select: available, src MPD, out IQaudIO Pi-DAC+
20240203 202801 worker: Bluetooth: available, ALSA mode Default
20240203 202801 worker: AirPlay: available
20240203 202801 worker: Spotify Connect: available
20240203 202801 worker: Squeezelite: available
20240203 202801 worker: RoonBridge: not installed
20240203 202801 worker: Multiroom: available
20240203 202801 worker: UPnP client: started
20240203 202801 worker: GPIO buttons: available
20240203 202801 worker: Stream recorder: n/a
20240203 202801 worker: HTTPS-Only mode: n/a
20240203 202801 worker: --
20240203 202801 worker: -- Volume levels
20240203 202801 worker: --
20240203 202801 worker: Volume knob: 50
20240203 202801 worker: Saved MPD volume: 0
20240203 202801 worker: Saved SRC volume: 0
20240203 202801 worker: Hdwr volume: 83%
20240203 202801 worker: --
20240203 202801 worker: -- Peripherals
20240203 202801 worker: --
20240203 202801 worker: Local display: off
20240203 202801 worker: On-screen kbd: off
20240203 202801 worker: Rotary encoder: off
20240203 202801 worker: USB volume knob: off
20240203 202801 worker: LCD updater: off
20240203 202801 worker: --
20240203 202801 worker: -- Miscellaneous
20240203 202801 worker: --
20240203 202801 worker: Auto-CoverView: off
20240203 202801 worker: CoverView timeout: Never
20240203 202801 worker: Auto-shuffle: off
20240203 202801 worker: Auto-play: off
20240203 202801 worker: Web SSH server: on
20240203 202801 worker: Maintenance task: 360 mins
20240203 202801 worker: Current view: reset to Playback
20240203 202802 worker: Session check: ok
20240203 202802 worker: --
20240203 202802 worker: -- Startup complete
20240203 202802 worker: --
20240203 202802 worker: Mount monitor: off
20240203 202802 worker: MPD monitor: off
20240203 202802 worker: Watchdog monitor: started
20240203 202802 worker: Responsiveness: Default
20240203 202802 worker: Ready
Colin
Posts: 1,281
Threads: 24
Joined: Jun 2022
Reputation:
42
02-03-2024, 08:58 PM
(This post was last modified: 02-03-2024, 09:00 PM by Nutul.)
This might be expected, then... during a reboot, on a real Pi, the browser doesn't come up so early; here it seems the JS is there waiting / polling... and as soon as the PHP is ready to answer, it does so when the worker is not done yet... fantasizing here, but makes a lot of sense to me...
Of course, acknowledgement of the scenario in the backend could help in showing such errors only when indeed they might be real errors.
Posts: 13,429
Threads: 304
Joined: Mar 2018
Reputation:
545
(02-03-2024, 08:36 PM)ColinM Wrote: (02-03-2024, 02:37 PM)Tim Curtis Wrote: Could be but to confirm there needs to be a recipe for reproducing the error that was mentioned earlier.
My infallible recipe for this error is to initiate a restart from Firefox on Windows. This produces 5 or 6 error popups with "json.parse unexpected character at line 1 column 1 of the json data" before the player screen loads.
Restarting from Vivaldi on Windows or Chromium on Raspberry Pi OS doesn't do anything odd.
Startup log from Firefox restart:
Code: 20240203 202658 worker: --
20240203 202658 worker: -- Start moOde 8 series
20240203 202658 worker: --
20240203 202658 worker: Successfully daemonized
20240203 202658 worker: Wait for Linux startup...
20240203 202753 worker: Linux startup complete
20240203 202753 worker: Boot config backed up
20240203 202755 worker: Session loaded
20240203 202756 worker: Package holds applied
20240203 202757 worker: File check complete
20240203 202757 worker: Debug logging off
20240203 202757 worker: Reduced logging off
20240203 202757 worker: --
20240203 202757 worker: -- Audio debug
20240203 202757 worker: --
20240203 202757 worker: ALSA cards: 0:IQaudIODAC | 1:empty | 2:empty | 3:empty
20240203 202757 worker: MPD config: 0:IQaudIO Pi-DAC+ | mixer:Digital | cardnum:0
20240203 202757 worker: Mixer name: [Digital]
20240203 202757 worker: Hdwr volume: set to 0%
20240203 202757 worker: --
20240203 202757 worker: -- System
20240203 202757 worker: --
20240203 202759 worker: Host: Main
20240203 202759 worker: Model: Pi-4B 1.1 2GB
20240203 202759 worker: moOde: 8.3.7 2023-12-07
20240203 202759 worker: RaspiOS: 11.5 Bullseye 64-bit
20240203 202759 worker: Kernel: 6.1.21 64-bit
20240203 202759 worker: MPD ver: 0.23.14
20240203 202759 worker: CPU gov: ondemand
20240203 202759 worker: Userid: pi
20240203 202759 worker: Homedir: /home/pi
20240203 202759 worker: Timezone: Europe/London
20240203 202759 worker: Keyboard: gb
20240203 202759 worker: USB boot: enabled
20240203 202759 worker: File sys: expanded
20240203 202759 worker: HDMI out: off
20240203 202759 worker: Sys LED0: on
20240203 202759 worker: Sys LED1: on
20240203 202759 worker: --
20240203 202759 worker: -- Network
20240203 202759 worker: --
20240203 202759 worker: Eth: adapter exists
20240203 202759 worker: Eth: timeout up to 30 secs
20240203 202759 worker: Eth: method dhcp
20240203 202759 worker: Eth: address 192.168.1.2
20240203 202759 worker: Eth: netmask 255.255.255.0
20240203 202759 worker: Eth: gateway 192.168.1.1
20240203 202759 worker: Eth: pri DNS 192.168.1.100
20240203 202759 worker: Eth: domain lan
20240203 202759 worker: Wlan: adapter does not exist
20240203 202759 worker: --
20240203 202759 worker: -- Software update
20240203 202759 worker: --
20240203 202759 worker: Automatic check: on
20240203 202759 worker: Checking for available update...
20240203 202800 worker: Software is up to date
20240203 202800 worker: --
20240203 202800 worker: -- File sharing
20240203 202800 worker: --
20240203 202800 worker: SMB file sharing: off
20240203 202800 worker: NFS file sharing: off
20240203 202800 worker: DLNA file sharing: off
20240203 202800 worker: --
20240203 202800 worker: -- Audio config
20240203 202800 worker: --
20240203 202800 worker: MPD config: updated
20240203 202800 worker: Audio device: IQaudIO Pi-DAC+
20240203 202800 worker: Formats: S16_LE, S24_LE, S32_LE
20240203 202800 worker: Mixer type Hardware
20240203 202800 worker: Mixer name Digital
20240203 202800 worker: Hdwr volume: controller detected
20240203 202800 worker: ALSA max vol: 100%
20240203 202800 worker: ALSA card: 0
20240203 202800 worker: ALSA mode: Default
20240203 202800 worker: ALSA loopback: off
20240203 202800 worker: CamillaDSP: off
20240203 202800 worker: Renderers: active flags reset
20240203 202800 worker: --
20240203 202800 worker: -- MPD startup
20240203 202800 worker: --
20240203 202801 worker: MPD service: started
20240203 202801 worker: MPD port 6600: accepting connections
20240203 202801 worker: MPD ALSA Default: on
20240203 202801 worker: MPD ALSA Bluetooth: off
20240203 202801 worker: MPD HTTP Server: off
20240203 202801 worker: MPD crossfade: off
20240203 202801 worker: MPD ignore CUE: yes
20240203 202801 worker: MPD CDSP volsync: off
20240203 202801 worker: MPD CDSP volrange: 60 dB
20240203 202801 worker: --
20240203 202801 worker: -- Music sources
20240203 202801 worker: --
20240203 202801 worker: USB auto-mount: udisks-glue
20240203 202801 worker: USB drives: no drives found
20240203 202801 worker: NAS sources: no music sources defined
20240203 202801 worker: --
20240203 202801 worker: -- Feature availability
20240203 202801 worker: --
20240203 202801 worker: Input select: available, src MPD, out IQaudIO Pi-DAC+
20240203 202801 worker: Bluetooth: available, ALSA mode Default
20240203 202801 worker: AirPlay: available
20240203 202801 worker: Spotify Connect: available
20240203 202801 worker: Squeezelite: available
20240203 202801 worker: RoonBridge: not installed
20240203 202801 worker: Multiroom: available
20240203 202801 worker: UPnP client: started
20240203 202801 worker: GPIO buttons: available
20240203 202801 worker: Stream recorder: n/a
20240203 202801 worker: HTTPS-Only mode: n/a
20240203 202801 worker: --
20240203 202801 worker: -- Volume levels
20240203 202801 worker: --
20240203 202801 worker: Volume knob: 50
20240203 202801 worker: Saved MPD volume: 0
20240203 202801 worker: Saved SRC volume: 0
20240203 202801 worker: Hdwr volume: 83%
20240203 202801 worker: --
20240203 202801 worker: -- Peripherals
20240203 202801 worker: --
20240203 202801 worker: Local display: off
20240203 202801 worker: On-screen kbd: off
20240203 202801 worker: Rotary encoder: off
20240203 202801 worker: USB volume knob: off
20240203 202801 worker: LCD updater: off
20240203 202801 worker: --
20240203 202801 worker: -- Miscellaneous
20240203 202801 worker: --
20240203 202801 worker: Auto-CoverView: off
20240203 202801 worker: CoverView timeout: Never
20240203 202801 worker: Auto-shuffle: off
20240203 202801 worker: Auto-play: off
20240203 202801 worker: Web SSH server: on
20240203 202801 worker: Maintenance task: 360 mins
20240203 202801 worker: Current view: reset to Playback
20240203 202802 worker: Session check: ok
20240203 202802 worker: --
20240203 202802 worker: -- Startup complete
20240203 202802 worker: --
20240203 202802 worker: Mount monitor: off
20240203 202802 worker: MPD monitor: off
20240203 202802 worker: Watchdog monitor: started
20240203 202802 worker: Responsiveness: Default
20240203 202802 worker: Ready
Colin
I can repro using FF on Mac.
Posts: 58
Threads: 7
Joined: May 2023
Reputation:
2
(01-31-2024, 12:44 PM)Tim Curtis Wrote: 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.
I looked through the source and found it very helpful in switching back between the different versions. Interestingly, downgrading everything to the old versions did result in a system that was still not fully functional, the interaction with CamillaDSP was problematic after the upgrade and then the downgrade.
Might it make sense to do apt-pinning of the versions that are tested for the respective version of Moode? Or at least mark them with apt-mark? Then the other parts of the system could be updated without problems…
I then did the full re-install, and using the backup functionality from the Web GUI this was extremely fast. One observation: It seems that the Restore did not restore the MPD option to write the Metadata to a file…
When running the upgraded versions of everything I had to upgrade the CamillaDSP config as well, but that was straightforward, even without any migration tool. But I had problems with volume control (I‘m using CamillaDSP for that as well), at the beginning of each song the volume was set back to the volume set at the start of the system. Maybe something to check in the upcoming release :-)
And thanks again for the fantastic work. I really love Moode and its functionality.
Cheeers, Joe
Posts: 571
Threads: 16
Joined: Apr 2020
Reputation:
23
apt-mark is already used to protect the packages(see the list at https://github.com/moode-player/pkgbuild...markt.conf).
In your first post you indicated that you forced the upgrade because the system was 'holding back' some packages... that where the packages protected with apt-mark :-(
The volume required unreleased software and configuration files part of the upcoming moode update.
Posts: 58
Threads: 7
Joined: May 2023
Reputation:
2
(02-14-2024, 06:54 PM)bitlab Wrote: apt-mark is already used to protect the packages(see the list at https://github.com/moode-player/pkgbuild...markt.conf).
In your first post you indicated that you forced the upgrade because the system was 'holding back' some packages... that where the packages protected with apt-mark :-(
The volume required unreleased software and configuration files part of the upcoming moode update.
Ah, ok, I overlooked that.
And yes, I forced the upgrade and I‘m fully aware that my approach to updating Linux systems is where the dragons are… :-)
|