Auto-scan Fails

Need help? Post your questions here.

Moderator: moderators

Auto-scan Fails

Postby phred » Thu Feb 20, 2020 8:32 pm

I'm running 6.16 on a Windows 10 box and had this problem a couple of months ago, but can't remember what I did to resolve it.

I have an auto-scan set to run at 1800 every day. Yesterday I noticed that the scan hadn't taken place for about a week. I stopped and restarted the server. I uninstalled and reinstalled 6.16. I uninstalled and installed 6.15. I rebooted Windows. No matter what I have tried the scan does not complete. It halts somewhere between 125 and 160 files.
The only thing I see in the About Subsonic Log is this:
Code: Select all
[2/20/20 3:09:31 PM GMT-05:00]    INFO   MediaScannerService   Starting to scan media library.
[2/20/20 3:09:46 PM GMT-05:00]    ERROR   MediaScannerService   Failed to scan media library.
[2/20/20 3:09:46 PM GMT-05:00]    INFO   PlaylistService   Starting playlist import.


Digging a little deeper, the more detailed log shows this, which is way over my head in terms of trying to figure out the issue:
Code: Select all
[2020-02-20 15:09:31,442] INFO MediaScannerService - Starting to scan media library.
[2020-02-20 15:09:46,707] ERROR MediaScannerService - Failed to scan media library.
org.springframework.dao.TransientDataAccessResourceException: PreparedStatementCallback; SQL [select id, path, name, artist, song_count, duration_seconds, cover_art_path, year, genre, play_count, last_played, comment, created, last_scanned, present, folder_id from album where name=?]; S1000 General error java.lang.NegativeArraySizeException in statement [select id, path, name, artist, song_count, duration_seconds, cover_art_path, year, genre, play_count, last_played, comment, created, last_scanned, present, folder_id from album where name=?]; nested exception is java.sql.SQLException: S1000 General error java.lang.NegativeArraySizeException in statement [select id, path, name, artist, song_count, duration_seconds, cover_art_path, year, genre, play_count, last_played, comment, created, last_scanned, present, folder_id from album where name=?]
   at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:106)
   at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
   at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
   at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:607)
   at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:641)
   at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:670)
   at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:678)
   at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:710)
   at net.sourceforge.subsonic.dao.AbstractDao.query(AbstractDao.java:84)
   at net.sourceforge.subsonic.dao.AlbumDao.getAlbumForFile(AlbumDao.java:52)
   at net.sourceforge.subsonic.service.MediaScannerService.updateAlbum(MediaScannerService.java:264)
   at net.sourceforge.subsonic.service.MediaScannerService.scanFile(MediaScannerService.java:227)
   at net.sourceforge.subsonic.service.MediaScannerService.scanFile(MediaScannerService.java:220)
   at net.sourceforge.subsonic.service.MediaScannerService.scanFile(MediaScannerService.java:223)
   at net.sourceforge.subsonic.service.MediaScannerService.scanFile(MediaScannerService.java:223)
   at net.sourceforge.subsonic.service.MediaScannerService.doScanLibrary(MediaScannerService.java:161)
   at net.sourceforge.subsonic.service.MediaScannerService.access$000(MediaScannerService.java:31)
   at net.sourceforge.subsonic.service.MediaScannerService$2.run(MediaScannerService.java:130)
Caused by: java.sql.SQLException: S1000 General error java.lang.NegativeArraySizeException in statement [select id, path, name, artist, song_count, duration_seconds, cover_art_path, year, genre, play_count, last_played, comment, created, last_scanned, present, folder_id from album where name=?]
   at org.hsqldb.jdbc.Util.throwError(Unknown Source)
   at org.hsqldb.jdbc.jdbcPreparedStatement.executeQuery(Unknown Source)
   at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:648)
   at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:591)
   ... 14 more


Thanks to anyone who can offer some insight as to what's going on. And for suggestions for fixing the issue.
phred
 
Posts: 25
Joined: Sat Mar 19, 2016 2:50 am

Re: Auto-scan Fails

Postby phred » Mon Feb 24, 2020 1:58 pm

I assumed my database is damaged so I attempted a fix per a post I saw here on the forum. When running the fix, it threw this error
Code: Select all
S1000 General error java.util.NoSuchElementException

I then uninstalled and reinstalled Java and tried a scan of all files which still fails around file 150 give or take 20.
phred
 
Posts: 25
Joined: Sat Mar 19, 2016 2:50 am

Re: Auto-scan Fails

Postby phred » Mon Feb 24, 2020 2:23 pm

For myself, and anyone else who may run into this issue, I resolved it with a database restore. (At least I think it's fixed - currently scanning file 6638 with a total of approximately 35,000. But this is the first time in weeks, the scan got passed 150.
Here's what I did:
Code: Select all
1 Stop the Subsonic service
2 Copy the content of folder Subsonic\db.backup to Subsonic\db
3 Start the service.
4 If that doesn't solve your problem;
5 Stop the Subsonic service
6 Delete file Subsonic.data (which is your database) in the folder Subsonic\db.
7 Start the service.
*** YOU WILL LOSE ALL YOUR SETTINGS, USERS AND COMMENTS AND YOU'LL HAVE TO CONFIGURE SUBSONIC FROM SCRATCH.***

Note that it was steps 5, 6, and 7 that did the trick. If it happens to me again, I won't bother with the first four steps. Also note that I did not lose any settings. All my users and settings were still there when I restated the service.
phred
 
Posts: 25
Joined: Sat Mar 19, 2016 2:50 am


Return to Help

Who is online

Users browsing this forum: Bing [Bot] and 24 guests