Thank you for your donation!


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


Thread Closed 
Problem: Library update in progress message
#61
(06-19-2025, 05:46 PM)Yawarakaimono Wrote: Regenerate database finishes without error.

Update a folder works. Several times.

But after reboot Update a folder gives the "Library update is already in progress." message.

Does this present new information?

Log file:

Code:
20250619 193311 worker: --
20250619 193311 worker: -- Start moOde 9 series
20250619 193311 worker: --
20250619 193311 worker: Daemonize:     complete
20250619 193311 worker: Linux startup: complete
20250619 193311 worker: Boot config:   ok
20250619 193311 worker: Boot folder:   ok
20250619 193311 worker: Radio table:   ok
20250619 193313 worker: PHP session:   cleaned
20250619 193313 worker: PHP session:   loaded
20250619 193317 worker: Package locks: applied
20250619 193318 worker: File check:    complete
20250619 193318 worker: Log to RAM:    on
20250619 193318 worker: Tmp to RAM:    on
20250619 193318 worker: Debug logging: off
20250619 193318 worker: --
20250619 193318 worker: -- System
20250619 193318 worker: --
20250619 193321 worker: Host name:     Sennheiser
20250619 193321 worker: RPi model:     Pi-3B 1.2 1GB
20250619 193321 worker: moOde release: 9.3.6 2025-06-06
20250619 193321 worker: RaspiOS:       12.10 Bookworm 64-bit
20250619 193321 worker: Linux Kernel:  6.12.25 64-bit
20250619 193321 worker: MPD version:   0.24.4
20250619 193321 worker: User id:       pi
20250619 193321 worker: Home folder:   /home/pi
20250619 193321 worker: Time zone:     Europe/Amsterdam
20250619 193321 worker: Kbd layout:    us
20250619 193321 worker: HDMI ports(s): on
20250619 193321 worker: HDMI-CEC:      off
20250619 193321 worker: Sys LED0:      on
20250619 193321 worker: Sys LED1:      on
20250619 193321 worker: Reduce power:  n/a
20250619 193321 worker: Fan control:   n/a
20250619 193321 worker: CPU governor:  ondemand
20250619 193321 worker: --
20250619 193321 worker: -- Network
20250619 193321 worker: --
20250619 193321 worker: Eth0
20250619 193321 worker: Ethernet: adapter exists
20250619 193321 worker: Ethernet: timeout off
20250619 193321 worker: Ethernet: method  dhcp
20250619 193321 worker: Ethernet: address 192.168.188.40
20250619 193321 worker: Ethernet: netmask 255.255.255.0
20250619 193321 worker: Ethernet: gateway 192.168.188.1
20250619 193321 worker: Ethernet: pri DNS 192.168.188.1
20250619 193321 worker: Ethernet: domain  fritz.box
20250619 193321 worker: Wlan0
20250619 193321 worker: Wireless: adapter does not exist
20250619 193321 worker: mDNS
20250619 193321 worker: Discover: IPv4 and IPv6
20250619 193321 worker: --
20250619 193321 worker: -- File sharing
20250619 193321 worker: --
20250619 193321 worker: SMB file sharing:  off
20250619 193321 worker: SMB password:      none
20250619 193321 worker: NFS file sharing:  off
20250619 193321 worker: DLNA file sharing: off
20250619 193321 worker: --
20250619 193321 worker: -- Special configs
20250619 193321 worker: --
20250619 193321 worker: Plexamp:          not installed
20250619 193321 worker: RoonBridge:       not installed
20250619 193321 worker: Allo Boss 2:      not detected, OLED script ok
20250619 193321 worker: Allo Piano 2.1:   not detected
20250619 193321 worker: IQaudIO DigiAMP+: not detected
20250619 193321 worker: RPi DigiAMP+:     not detected
20250619 193321 worker: Bluetooth:        session vars ok
20250619 193321 worker: --
20250619 193321 worker: -- ALSA debug
20250619 193321 worker: --
20250619 193321 worker: Cards:  0:vc4hdmi         1:sndrpihifiberry 2:empty           3:empty          
20250619 193321 worker:         4:empty           5:empty           6:empty           7:empty          
20250619 193322 worker: Mixers: 0:none            1:none            2:none            3:none            
20250619 193322 worker:         4:none            5:none            6:none            7:none            
20250619 193322 worker: --
20250619 193322 worker: -- Audio configuration
20250619 193322 worker: --
20250619 193322 worker: Audio device:  1:HiFiBerry Digi+ Pro
20250619 193322 worker: ALSA card:     has not been reassigned
20250619 193322 worker: MPD config:    update not needed
20250619 193322 worker: ALSA output:   I2S
20250619 193322 worker: ALSA mode:     Direct (hw)
20250619 193322 worker: ALSA mixer:    none exists
20250619 193325 worker: ALSA volume:   controller not detected
20250619 193325 worker: ALSA maxvol:   100%
20250619 193325 worker: ALSA loopback: off
20250619 193325 worker: MPD mixer      Fixed (0dB)
20250619 193325 worker: Integ audio:   vc4-kms-v3d
20250619 193326 worker: Audio formats: S16_LE, S24_LE
20250619 193326 worker: CamillaDSP:    off
20250619 193326 worker: CDSP volume:   0dB
20250619 193326 worker: CDSP volrange: 60dB
20250619 193326 worker: --
20250619 193326 worker: -- MPD startup
20250619 193326 worker: --
20250619 193327 worker: MPD service:        started
20250619 193327 worker: MPD port 6600:      accepting connections
20250619 193327 worker: MPD ALSA Default:   on
20250619 193327 worker: MPD ALSA Bluetooth: off
20250619 193327 worker: MPD HTTP Server:    off
20250619 193327 worker: MPD volume:         0
20250619 193327 worker: Saved MPD vol:      -1
20250619 193327 worker: Saved SRC vol:      0
20250619 193327 worker: MPD crossfade:      off
20250619 193327 worker: MPD ignore CUE:     no
20250619 193327 worker: MPD CDSP volsync:   off
20250619 193328 worker: --
20250619 193328 worker: -- Music sources
20250619 193328 worker: --
20250619 193328 worker: USB drives:     none
20250619 193328 worker: NVMe drives:    none
20250619 193328 worker: SATA drives:    none
20250619 193328 worker: NAS source:     Fafnir (smb)
20250619 193328 worker: NAS source:     Fasolt (smb)
20250619 193329 worker: --
20250619 193329 worker: -- Feature availability
20250619 193329 worker: --
20250619 193329 worker: Input select:    available, Source: MPD, Output: HiFiBerry Digi+ Pro
20250619 193329 worker: Bluetooth:       available, PIN: None, ALSA/CDSP maxvol: 100%/0dB, ALSA outmode: Standard
20250619 193329 worker: AirPlay:         available
20250619 193329 worker: Spotify Connect: available
20250619 193329 worker: Deezer Connect:  n/a
20250619 193329 worker: Squeezelite:     available
20250619 193329 worker: UPnP client:     available
20250619 193329 worker: Plexamp:         not installed, ALSA maxvol: 100%
20250619 193329 worker: RoonBridge:      not installed
20250619 193329 worker: Multiroom:       available
20250619 193329 worker: GPIO buttons:    available
20250619 193329 worker: Stream recorder: n/a
20250619 193329 worker: --
20250619 193329 worker: -- Security
20250619 193329 worker: --
20250619 193329 worker: Web SSH server:    on
20250619 193329 worker: XSS detection:     off
20250619 193329 worker: HTTPS mode:        available
20250619 193329 worker: --
20250619 193329 worker: -- Peripherals
20250619 193329 worker: --
20250619 193351 worker: Local display:   off
20250619 193351 worker: Chromium ver:    126.0.6478.164-rpt1
20250619 193351 worker: Chromium cfg:    directory ok
20250619 193351 worker: Screen blank     600
20250619 193351 worker: On-screen kbd:   off
20250619 193351 worker: Disable GPU:     off
20250619 193351 worker: HDMI orient:     landscape
20250619 193351 worker: HDMI 4K 60Hz:    off
20250619 193351 worker: DSI scn type:    none
20250619 193351 worker: DSI port:        1
20250619 193351 worker: DSI brightness:  255
20250619 193351 worker: DSI rotate:      0
20250619 193351 worker: Rotary encoder:  off
20250619 193351 worker: Triggerhappy:    off
20250619 193351 worker: LCD updater:     off
20250619 193351 worker: --
20250619 193351 worker: -- Miscellaneous
20250619 193351 worker: --
20250619 193351 worker: Software update:   Automatic check on
20250619 193351 worker: Software update:   Checking for available update...
20250619 193352 worker: Software update:   Software is up to date
20250619 193352 worker: Auto-CoverView:    off
20250619 193352 worker: CoverView timeout: Never
20250619 193352 worker: Auto-shuffle:      off
20250619 193352 worker: Auto-play:         off
20250619 193352 worker: Maintenance task:  360 mins
20250619 193352 worker: Current view:      reset to Playback
20250619 193352 worker: Active flags:      all false
20250619 193352 worker: Reset flags:       skipped
20250619 193352 worker: Session check:     ok
20250619 193352 worker: --
20250619 193352 worker: -- Startup complete
20250619 193352 worker: --
20250619 193352 worker: Mount monitor:    started
20250619 193352 worker: Radio monitor:    off
20250619 193352 worker: Watchdog monitor: started
20250619 193352 worker: Responsiveness:   Boosted
20250619 193352 worker: Ready

I don't see anything suspicious in the log.

I'm not able to reproduce the issue but here's some log output from one of my test collections for successful "Update this folder" and "Update library". 

Your log should look similar if the library updates are completing successfully. Note that the Thumbnail Generator and MPD database update run parallel to one another so one may complete before the other and thats fine.

Code:
.
.
.
20250619 181310 worker: --
20250619 181310 worker: -- Startup complete
20250619 181310 worker: --
20250619 181310 worker: Mount monitor:    started
20250619 181310 worker: Radio monitor:    off
20250619 181310 worker: Watchdog monitor: started
20250619 181310 worker: Responsiveness:   Default
20250619 181310 worker: Ready
20250619 181310 worker: Ready script enabled
20250619 181310 worker: Script started
20250619 181310 worker: Script result: Play OSDISK/System Sounds/ReadyChime.flac
20250619 181310 worker: Script finished

# 1 "Update this folder"
20250619 183508 worker: Job update_library
20250619 183508 worker: Clear Library tag cache
20250619 183508 mpdindex: Start
20250619 183508 mpdindex: Cmd (update "NAS/TRX-FLAC/Aaron Parks")
20250619 183508 worker: Update thumbnail cache
20250619 183508 thumb-gen: Start
20250619 183508 thumb-gen: Scan opt: Default+
20250619 183508 thumb-gen: Priority: Embedded cover
20250619 183508 thumb-gen: Res,Qual: 600px,60
20250619 183508 thumb-gen: Px ratio: 1
20250619 183508 thumb-gen: Th width: 600
20250619 183508 thumb-gen: Thm qual: 60
20250619 183508 thumb-gen: Scanning: NAS, NVME, OSDISK, SATA, SDCARD
20250619 183511 mpdindex: Done: indexed 311 artists, 404 albums, 4489 songs
20250619 183511 worker: Job update_library done
20250619 183515 thumb-gen: Done: 405 folders scanned, 0 thumbs created, 405 already in cache.

# 2 "Update this folder"
20250619 183526 worker: Job update_library
20250619 183526 worker: Clear Library tag cache
20250619 183526 mpdindex: Start
20250619 183526 mpdindex: Cmd (update "NAS/TRX-FLAC/Alan Pasqua")
20250619 183526 worker: Update thumbnail cache
20250619 183526 thumb-gen: Start
20250619 183526 thumb-gen: Scan opt: Default+
20250619 183526 thumb-gen: Priority: Embedded cover
20250619 183526 thumb-gen: Res,Qual: 600px,60
20250619 183526 thumb-gen: Px ratio: 1
20250619 183526 thumb-gen: Th width: 600
20250619 183526 thumb-gen: Thm qual: 60
20250619 183526 thumb-gen: Scanning: NAS, NVME, OSDISK, SATA, SDCARD
20250619 183529 thumb-gen: Done: 405 folders scanned, 0 thumbs created, 405 already in cache.
20250619 183529 mpdindex: Done: indexed 311 artists, 404 albums, 4489 songs
20250619 183529 worker: Job update_library done

# 3 "Update this folder"
20250619 183553 worker: Job update_library
20250619 183553 worker: Clear Library tag cache
20250619 183553 mpdindex: Start
20250619 183553 mpdindex: Cmd (update "NAS/TRX-FLAC/Alex Cortiz")
20250619 183553 worker: Update thumbnail cache
20250619 183553 thumb-gen: Start
20250619 183553 thumb-gen: Scan opt: Default+
20250619 183553 thumb-gen: Priority: Embedded cover
20250619 183553 thumb-gen: Res,Qual: 600px,60
20250619 183553 thumb-gen: Px ratio: 1
20250619 183553 thumb-gen: Th width: 600
20250619 183553 thumb-gen: Thm qual: 60
20250619 183553 thumb-gen: Scanning: NAS, NVME, OSDISK, SATA, SDCARD
20250619 183555 thumb-gen: Done: 405 folders scanned, 0 thumbs created, 405 already in cache.
20250619 183556 mpdindex: Done: indexed 311 artists, 404 albums, 4489 songs
20250619 183556 worker: Job update_library done

# 4 "Update library"
20250619 183648 worker: Job update_library
20250619 183648 worker: Clear Library tag cache
20250619 183648 mpdindex: Start
20250619 183648 mpdindex: Cmd (update)
20250619 183648 worker: Update thumbnail cache
20250619 183648 thumb-gen: Start
20250619 183648 thumb-gen: Scan opt: Default+
20250619 183648 thumb-gen: Priority: Embedded cover
20250619 183648 thumb-gen: Res,Qual: 600px,60
20250619 183648 thumb-gen: Px ratio: 2
20250619 183648 thumb-gen: Th width: 600
20250619 183648 thumb-gen: Thm qual: 60
20250619 183648 thumb-gen: Scanning: NAS, NVME, OSDISK, SATA, SDCARD
20250619 183652 thumb-gen: Done: 405 folders scanned, 0 thumbs created, 405 already in cache.
20250619 183700 mpdindex: Done: indexed 311 artists, 404 albums, 4489 songs
20250619 183700 worker: Job update_library done

Another troubleshooting approach is to look at the GLOBAL flags in the front-end (WebUI) that determine whether it thinks a Library update is still running.

- Open your Browsers Javascript console
- At the prompt type in GLOBAL.libLoading; <return> and GLOBAL.libRendered; <return>
- They will either be true or false depending on whether the front-end thinks the Library update and Library rendering in the WebUI are complete.

The function below in file /var/www/js/playerlib.js is responsible for displaying "Library update in progress".

Code:
function submitLibraryUpdate (path = '') {
   if (GLOBAL.libLoading == false) {
       GLOBAL.libLoading = true;
       // DEBUG:
       //console.log('submitLibraryUpdate(): GLOBAL.libLoading: ' + GLOBAL.libLoading);
       GLOBAL.libRendered = false;
       $.getJSON('command/music-library.php?cmd=update_library', {'path': path}, function(data) {
           //console.log(data);
       });
       notify(NOTIFY_TITLE_INFO, 'update_library', (path == '' ? '' : '<br>' + path));
   }
   else {
       notify(NOTIFY_TITLE_ALERT, 'library_updating');
   }
}

The function submits the command 'update_library' and and optional path to /var/www/command/music-library.php. This script in turn submits the 'update_library' job to /var/www/daemon/worker.php which starts MPD database update and thumbnail generator. If those complete successfully log entries are written to the moode log and the GlOBAL flags are set appropriately.

If this code in the function never returns or bombs then the GLOBAL flags prolly won't be set correctly. I'm not able to get this to fail in my environment so I have no insights.
Code:
       $.getJSON('command/music-library.php?cmd=update_library', {'path': path}, function(data) {
           //console.log(data);
       });

Food for thought :-)
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
#62
(06-19-2025, 11:22 PM)Tim Curtis Wrote: - Open your Browsers Javascript console
- At the prompt type in GLOBAL.libLoading; <return> and GLOBAL.libRendered; <return>

In my Browsers Javascript console immediately shows an error -

Code:
Uncaught TypeError: (e.album_artist || e.artist).toLowerCase is not a function
   at keyAlbum (scripts-library.js:506:81)
   at scripts-library.js:248:23
   at Array.map (<anonymous>)
   at groupLib (scripts-library.js:246:21)
   at renderLibrary (scripts-library.js:128:2)
   at Object.success (scripts-library.js:111:3)
   at u (jquery-1.8.2.js:974:30)
   at Object.fireWith [as resolveWith] (jquery-1.8.2.js:1082:7)
   at N (jquery-1.8.2.js:7788:14)
   at XMLHttpRequest.n (jquery-1.8.2.js:8500:8)

And it returns flags like this

Code:
GLOBAL.libLoading;
true
GLOBAL.libRendered;
false

Is it possible to somehow reset the GLOBAL.libLoading flag?

I have a guess that in version 8 the Refresh command from the main menu reset these flags
#63
(06-19-2025, 07:09 PM)alexarz Wrote:
(06-19-2025, 04:49 PM)Nutul Wrote: If you have deleted some "suspicious folders", then:
1. there might be other such folders
2. there could also be some "suspicious" files, if you have a Mac updating your folders...
3. take note of the pattern of those suspicious folders names, then, with a very powerful Linux tool by the name of "find" you can scan (and get rid of) all those nasties is a matter of seconds; like:

find <root folder of your library> -iname "file/folder pattern" -exec rm -rf "{}" \;

If you just want to see how many they are, but take no immediate action, just end the command at "file/folder pattern" and you are free to go.
But I don't know what to look for, what sample

It is a music library containing music you acquired, any thing that isn't music or related (cover images, folders, etc) can go.  You know what should be in there, it's your library.
----------------
Robert
#64
(06-20-2025, 05:21 AM)alexarz Wrote:
(06-19-2025, 11:22 PM)Tim Curtis Wrote: - Open your Browsers Javascript console
- At the prompt type in GLOBAL.libLoading; <return> and GLOBAL.libRendered; <return>

In my Browsers Javascript console immediately shows an error -

Code:
Uncaught TypeError: (e.album_artist || e.artist).toLowerCase is not a function
   at keyAlbum (scripts-library.js:506:81)
   at scripts-library.js:248:23
   at Array.map (<anonymous>)
   at groupLib (scripts-library.js:246:21)
   at renderLibrary (scripts-library.js:128:2)
   at Object.success (scripts-library.js:111:3)
   at u (jquery-1.8.2.js:974:30)
   at Object.fireWith [as resolveWith] (jquery-1.8.2.js:1082:7)
   at N (jquery-1.8.2.js:7788:14)
   at XMLHttpRequest.n (jquery-1.8.2.js:8500:8)

And it returns flags like this

Code:
GLOBAL.libLoading;
true
GLOBAL.libRendered;
false

Is it possible to somehow reset the GLOBAL.libLoading flag?

I have a guess that in version 8 the Refresh command from the main menu reset these flags

Menu > Refresh is the same as a Browser reload or refresh. Theres nothing special about it.

That specific Javascript error at that line in the function could happen with poorly tagged music files that are missing the basic tags like Artist, Title, Album, Track etc, or the files could have some sort of other metadata corruption. If the script blows up the globals and all other state variables won't be set correctly. The only way to prevent the error is to fix the data in the music files.

Generally moode is not the best player software for untagged or sparsely tagged collections. Something like PiCorePlayer (LMS/Squeezelite) I think has more exception handling for things like missing tags or corrupt files but you might be able to work around the data triggered error in moode by setting Prefs > Library > Album key to Folder path or Folder path@AlbumID.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
#65
Using the script, I deleted all unnecessary folders and files from the disk.
I left only music(dsf, flac, wav) and picture files(jpg, png).
I regenerated the library - all useless. The problem remained.
#66
How to find this damaged album?
#67
(06-20-2025, 11:58 AM)alexarz Wrote: How to find this damaged album?

I am not aware of a program which can scan for all possible music tracks, no matter their encoding and container (e.g., file type), verify their metadata, and report out all files which are problematic. If anyone else is, I'd like to hear about it.

I'm not a JavaScript expert but I believe the specific error you reported means either an album_artist tag or an artist tag in some file did not contain a string value.  The function .toLowerCase requires a string input, so it failed. I suppose a savvy JS coder could modify the routine to identify the file it was working from, but that person certainly isn't me.

Since you've now "cleaned" your library of extraneous files, you could try using the .mpdignore directive to narrow down the list of suspect files.

1. clear the MPD and related databases (I'm not sure what is the best way to do this.)

2. at the highest-level directory in your library collection, place a text file named .mpdignore. In it, place the text lines
 
Code:
*.dsd
*.wav

This means that MPD should scan your entire library for only .flac files. (I chose them first only because I like their tagging scheme best).

3. use the usual moOde webUI methods to update your library.

4. does this succeed in all the ways you expect? 
 - if  yes, then go to next step.
 - if not, you at least now know you have one or more FLAC files to fix. Go fix* them and then repeat.

5. repeat the above, but this time using a .mpdignore file containing

Code:
*.flac
*.wav

6. same as 3.

7. Same as 4. except now you know you have one or more .dsd files to fix.

8. Do it all again but this time with a .mpdignore file containing

Code:
*.dsd
*.flac

You can guess where this is heading. As an aside, I dislike WAV files the most because of their lack of prescriptive metadata tagging. People do all sorts of wild things to add metadata to them.

In summary, yes, this is tedious, but with a huge un-proctored collection of putative music files, you have to start somewhere.

Obviously, the same approach could be taken at a subdirectory level but not knowing your file organization (and I don't really want to!!!) I don't know what to suggest.

All this is just my 2 cents worth.

Good hunting.

Regards,
Kent

*''fix" means different things for different file types. I suppose you could turn programs like mp3tag, easytag, or kid3 loose on them but I prefer using FLAC-specific command-line tools when dealing with FLAC files, and so forth.
#68
Thank you very much, I will definitely try it on Monday
#69
Just think though, how much more intimately you will know your music collection after this, how much more pleasurable it will be knowing it is clean and nicely tagged. You might even start to enjoy views other than the folder view Smile
----------------
Robert
#70
@Tim Curtis
Couldn't it be helpful to have (e.album_artist || e.artist || "missing tags") solve the issue for those "poorly tagged files"? As IMHO both tags are missing, resulting in undefined.toLowerCase() which of course does not exist...


Forum Jump: