Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 7 of 7
  1. #1
    Senior Member
    Join Date
    Aug 2013
    Posts
    202

    Media scan terminated unexpectedly

    Maybe someone could help with a problem with the media scanner:

    Regardless of choosing "Looking for new and changed media files" or "clear library and rescan everything", the scan does not finish. The scan runs till "Database Optimize (1 of 2)", then the server doesn't respond for a few minutes and after that it says "Media scan terminated unexpectedly (Scanning Progress)"
    After that the new Albums do not appear under "New Music" or "Artist". But I can find them by searching for the Album Title.

    I'm running "Logitech Media Server Version: 7.9.1 - 1499900819 @ Wed Jul 12 23:26:54 UTC 2017" on a Raspberry Pi 3 (Raspbian). Maybe This has to do with any Plugins? I'm using Bookmarks, Music and Artist Information, Music Walk With Me, What Was That Tune? and Spotty. I recently tried some of the erland isaksson plugins but uninstalled them all. And I deactivated Full text search because I get much better results without it.

    These are the last lines in the scanner.log just before the scan terminates unexpectedly:
    Code:
    [17-08-02 07:29:32.2778] Slim::Utils::SQLiteHelper::updateProgress (463) Notify to server OK
    [17-08-02 07:29:32.2787] Slim::Music::Artwork::__ANON__ (738) precacheArtwork finished in 3.99443387985229
    [17-08-02 07:29:32.2793] Slim::Music::Import::endImporter (643) Completed precacheArtwork Scan in 4 seconds.
    [17-08-02 07:29:32.2802] Slim::Schema::forceCommit (2158) Syncing to the database.
    [17-08-02 07:29:32.4737] Slim::Music::Import::runScanPostProcessing (435) Starting Database optimization.
    [17-08-02 07:29:32.4753] Slim::Schema::optimizeDB (402) Start schema_optimize
    [17-08-02 07:30:46.5224] Slim::Utils::SQLiteHelper::updateProgress (439) Notify to server: ["progress:1501651772.47674||importer||dboptimize||1||2||"]
    [17-08-02 07:30:46.5393] Slim::Utils::SQLiteHelper::updateProgress (463) Notify to server OK
    [17-08-02 07:30:46.5404] Slim::Schema::forceCommit (2158) Syncing to the database.
    [17-08-02 07:30:46.6083] Slim::Utils::SQLiteHelper::vacuum (522) Start VACUUM library.db
    I could send the whole scanner.log if necessary.

  2. #2
    Senior Member
    Join Date
    Aug 2013
    Posts
    202
    The RAM usage is very hight just before the scan terminates. Maybe there is something wrong with the RAM?

  3. #3
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,734
    How large is your library? What's your memory configuration in Settings/Advanced/Performance? Do you have swap enabled?
    Michael

    "It doesn't work - what shall I do?" - "Please check your server.log and/or scanner.log file!"
    (LMS: Settings/Information)

  4. #4
    Senior Member
    Join Date
    Aug 2013
    Posts
    202
    Quote Originally Posted by mherger View Post
    What's your memory configuration in Settings/Advanced/Performance?
    It was set to "Maximum". I tried "Normal" and the problem was solved. The scan took a little longer but it ran through without Problems. Thank you for the hint. I have to remember to set it to normal before starting a scan and set it back to Maximum after the scan (for the spotty plugin).
    Quote Originally Posted by mherger View Post
    Do you have swap enabled?
    Is it a LMS or a raspbian setting? What do you recommend?

  5. #5
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,734

    Media scan terminated unexpectedly

    >> What's your memory configuration in Settings/Advanced/Performance?
    > It was set to "Maximum". I tried "Normal" and the problem was solved.
    > The scan took a little longer but it ran through without Problems. Thank


    Did you try "High", too?

    >> Do you have swap enabled?

    > Is it a LMS or a raspbian setting? What do you recommend?


    That would be on the OS level (Raspbian). It might help to iron out that
    peak memory usage. But in general you shouldn't run a configuration
    which needs swap space all the time, as it can wear out the SD card (and
    would be slow, too).

    I'm using "Maximum" with piCorePlayer. But then there's nothing else
    running on that device. I don't even use the audio part. The description
    for that setting says "if you have more than 1GB of RAM" :-). Using it
    with less memory obviously comes with some risks.

    --

    Michael

  6. #6
    Senior Member
    Join Date
    Aug 2013
    Posts
    202
    Quote Originally Posted by mherger View Post
    Did you try "High", too?
    Yes, the scan terminated with both, High and Maximum. Only normal was fine.

    Quote Originally Posted by mherger View Post
    That would be on the OS level (Raspbian). It might help to iron out that
    peak memory usage. But in general you shouldn't run a configuration
    which needs swap space all the time, as it can wear out the SD card (and
    would be slow, too).
    I don't remember if I changed the raspbian default settings. Sounds like changing the performance to normal for the scan is the best solution.

    Quote Originally Posted by mherger View Post
    I'm using "Maximum" with piCorePlayer. But then there's nothing else
    running on that device. I don't even use the audio part. The description
    for that setting says "if you have more than 1GB of RAM" :-). Using it
    with less memory obviously comes with some risks.
    I have a Pi Zero with piCorePlayer in the bedroom. (I can use a timer that pulls the plug without worrying).
    Maybe I should try piCorePlayer for the server, too. But I feel much more comfortable with raspbian, most of the terminal commands are the same as in ubuntu and I can easily install other stuff with apt-get. I wouldn't know how to install or configure anything on piCore linux.

  7. #7
    Junior Member
    Join Date
    Jul 2022
    Posts
    1

    Thanks!

    Thank you both for posting this solution. Nine years later, it solved my problem with LMS on a NetGear ReadyNAS:

    Logitech Media Server Version: 7.9.0 - TRUNK @ UNKNOWN
    Operating system: Debian - EN - utf8
    Platform Architecture: x86_64-linux
    Perl Version: 5.20.2 - x86_64-linux-gnu-thread-multi
    Audio::Scan: 0.95
    Database Version: DBD::SQLite 1.34_01 (sqlite 3.7.7.1)

    I had been adding a lot of content to the library lately, and at some point it could no longer successfully complete a scan. The symptoms were the same as in the OP:

    The scan runs till "Database Optimize (1 of 2)", then the server doesn't respond for a few minutes and after that it says "Media scan terminated unexpectedly (Scanning Progress)"
    After that the new Albums do not appear under "New Music" or "Artist".

    I changed "Advanced" -> "Performance" -> "Database Memory Config" to "Normal" and the library was successfully scanned (completely).
    Last edited by wspd; 2022-07-03 at 08:00.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •