Bug 5859 - Duplicate album and song after rescan on a couple of albums
: Duplicate album and song after rescan on a couple of albums
Status: RESOLVED WORKSFORME
Product: Logitech Media Server
Classification: Unclassified
Component: Scanner
: 7.0
: PC Windows XP
: P2 major (vote)
: ---
Assigned To: Squeezebox QA Team email alias
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-19 13:39 UTC by Robin V.
Modified: 2007-10-22 11:49 UTC (History)
0 users

See Also:
Category: ---


Attachments
tracks of the original album and duplicate one (7.74 KB, text/plain)
2007-10-19 14:18 UTC, Robin V.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robin V. 2007-10-19 13:39:49 UTC
After a (several ones in reality) full rescan with a 7.0a1 (see below for details) the library is fine except for two flac albums that appears duplicate. Those albums are flac files, tagged and were perfectly handled before (no duplicate on 6.5.x, not retagged between upgrade).

Duplicate album entries have all songs inside, but both album id and songs id are different.

The difference is that one album has artwork, while the other doesn't. The details of a song of the album entry with artwork is complete while the detrails of the same song on the duplicate album (without artwork) has limited details:

Complete song: (item=1397)
==============
Artist: Frescobaldi, Girolamo
Composer: Frescobaldi, Girolamo
Album: Frescobaldi, Couperin - Pièces pour clavecin - Leonhardt - Alpha
Genre: Classical, Clavecin, Baroque, Cl17
Year: 2002
Track: 2
Compilation: Yes
File Format: flc
Duration: 2:28
File Length: 15,553,767 Bytes
Bitrate: 837kbps CBR
Sample Rate: 44.1 kHz
Location: /espace/SB/m/CLASSIC EB/Leonhardt, Gustav/Frescobaldi, Couperin - Pièces pour clavecin - Leonhardt - Alpha/02 Ricercari. et canzoni franzese. vol.1 no.15. canzon quinta. nono tono. for keyboard.flac (Download)
Date Modified: Sunday 12 August 2007, 15:44:17 


The same, incomplete: (item=2364)
=====================
Album: Frescobaldi, Couperin - Pièces pour clavecin - Leonhardt - Alpha
Year: 2002
Track: 2
Compilation: Yes
File Format: flc
Duration: 2:28
File Length: 15,553,767 Bytes
Bitrate: 837kbps CBR
Sample Rate: 44.1 kHz
Location: /espace/SB/m/CLASSIC EB/Leonhardt, Gustav/Frescobaldi, Couperin - Pièces pour clavecin - Leonhardt - Alpha/02 Ricercari. et canzoni franzese. vol.1 no.15. canzon quinta. nono tono. for keyboard.flac (Download)
Date Modified: Sunday 12 August 2007, 15:44:17

If I "force refresh" the incomplete song page, the result is a blank page and the track seems to be removed from the database (it doesn't appear in the duplicate album anymore). The duplicate still exists, but without any song in it.

The complete album id is album.id=107 and the incomplete is album.id=171. The other with the same problem is album.id=105 (complete) and album.id=170 (incomplete)

Strangely, the two duplicates are the two last albums (it could be because they have been modified while browsing them):
170	Florentz: Concert-hommage à Notre-Dame - Nelson - Accord	FLORENTZ CONCERT HOMMAGE À NOTRE DAME NELSON ACCORD	FLORENTZ CONCERT HOMMAGE À NOTRE DAME NELSON ACCORD			2005								124
171	Frescobaldi, Couperin - Pièces pour clavecin - Leonhardt - Alpha	FRESCOBALDI COUPERIN PIÈCES POUR CLAVECIN LEONHARDT ALPHA	FRESCOBALDI COUPERIN PIÈCES POUR CLAVECIN LEONHARDT ALPHA		1	2002								199
Should I pass in debug database mode and make some copy/paste?




PS: SqueezeCenter version:

Last Changed Rev: 13881
Last Changed Date: 2007-10-18 12:52:36 +0200 (Thu, 18 Oct 2007)

SqueezeCenter Information

SqueezeCenter Version: 7.0 - TRUNK - Debian - EN - utf8
Server IP address: 192.168.1.3
Perl Version: 5.8.8 i486-linux-gnu-thread-multi
MySQL Version: 5.0.21-standard

Hostname: sun

Server Port Number: 9000

Total Players Recognised: 1
)
Comment 1 Robin V. 2007-10-19 14:18:39 UTC
Created attachment 2291 [details]
tracks of the original album and duplicate one
Comment 2 Robin V. 2007-10-19 14:19:12 UTC
After the full rescan, the two album are also duplicated, and there is another one (could have been there before).

For one of the album, I noticed this in the logs:
[22:52:06.8144] Slim::Schema::Track::coverArt (299) Error: Exception when trying to call readCoverArt() for [file:///espace/SB/m/CLASSIC%20NG/Meneses,%20Antonio/Brahms%20Cello%20Sonata%20No.%201%20Op.%2038,%20Schubert%20Sonata%20Arpeggione%20-%20Meneses%20-%20Est%FAdio%20Eldorado/01%20Sonata%20for%20cello%20&%20piano%20no.%201%20in%20e%20minor,%20op.%2038%20-%20allegro%20non%20troppo.flac] : [[/espace/SB/m/CLASSIC NG/Meneses, Antonio/Brahms Cello Sonata No. 1 Op. 38, Schubert Sonata Arpeggione - Meneses - Estúdio Eldorado/01 Sonata for cello & piano no. 1 in e minor, op. 38 - allegro non troppo.flac] does not exist or cannot be read: No such file or directory at /usr/local/squeezebox/SlimServer_v7-13333-20070928/lib/Audio/FLAC/Header.pm line 67.
]

Or:
[22:59:43.8491] Slim::Schema::Debug::query_start (26) SELECT contributor.id, contributor.name, contributor.namesort, contributor.musicmagic_mixable, contributor.namesearch, contributor.musicbrainz_id FROM contributor_track me  JOIN contributors contributor ON ( contributor.id = me.contributor ) WHERE ( ( ( role IN ( ?, ? ) ) AND ( me.track = ? ) ) ) GROUP BY contributor.id ORDER BY role desc: '1', '6', '2385'
[22:59:43.8598] Slim::Schema::Track::coverArt (299) Error: Exception when trying to call readCoverArt() for [file:///espace/SB/m/CLASSIC%20EB/Leonhardt,%20Gustav/Frescobaldi,%20Couperin%20-%20Pi%E8ces%20pour%20clavecin%20-%20Leonhardt%20-%20Alpha/01%20Il%20primo%20libro%20d%27intavolatura%20di%20toccate%20di%20cimbalo%20et%20organo.%20no.2.%20toccata%20seconda.flac] : [[/espace/SB/m/CLASSIC EB/Leonhardt, Gustav/Frescobaldi, Couperin - Pièces pour clavecin - Leonhardt - Alpha/01 Il primo libro d'intavolatura di toccate di cimbalo et organo. no.2. toccata seconda.flac] does not exist or cannot be read: No such file or directory at /usr/local/squeezebox/SlimServer_v7-13333-20070928/lib/Audio/FLAC/Header.pm line 67.
]
[22:59:43.8632] Slim::Schema::Debug::query_start (26) SELECT me.name, me.value FROM metainformation me WHERE ( name = ? ): 'isScanning'
[22:59:43.8739] Slim::Schema::Debug::query_start (26) SELECT COUNT( DISTINCT( tracks.id ) ) FROM albums me LEFT JOIN tracks tracks ON ( tracks.album = me.id ) WHERE ( me.id = ? ): '168'

When I display album details.


Here are the logs when I click on the track of a duplicate album (track that should vanish from the album after this click):

[23:01:05.9816] Slim::Schema::Debug::query_start (26) SELECT me.id, me.url, me.content_type, me.title, me.titlesort, me.titlesearch, me.album, me.tracknum, me.timestamp, me.filesize, me.disc, me.remote, me.audio, me.audio_size, me.audio_offset, me.year, me.secs, me.cover, me.vbr_scale, me.bitrate, me.samplerate, me.samplesize, me.channels, me.block_alignment, me.endian, me.bpm, me.tagversion, me.drm, me.musicmagic_mixable, me.musicbrainz_id, me.playcount, me.lastplayed, me.lossless, me.lyrics, me.rating, me.replay_gain, me.replay_peak FROM tracks me WHERE ( ( me.id = ? ) ): '2366'
[23:01:05.9892] Slim::Schema::Debug::query_start (26) DELETE FROM tracks WHERE ( id = ? ): '2366'
[23:01:06.0034] Slim::Schema::Debug::query_start (26) SELECT me.role, me.contributor, me.track FROM contributor_track me WHERE ( me.track = ? ): '2366'
[23:01:06.0095] Slim::Schema::Debug::query_start (26) SELECT me.id, me.track, me.value FROM comments me WHERE ( me.track = ? ): '2366'
[23:01:06.0156] Slim::Schema::Debug::query_start (26) SELECT me.genre, me.track FROM genre_track me WHERE ( me.track = ? ): '2366'
[23:01:06.0241] Slim::Schema::Debug::query_start (26) SELECT me.id, me.track, me.value FROM comments me WHERE ( me.track = ? ): '2366'
[23:01:06.0295] Slim::Schema::Track::coverArt (299) Error: Exception when trying to call readCoverArt() for [file:///espace/SB/m/CLASSIC%20EB/Leonhardt,%20Gustav/Frescobaldi,%20Couperin%20-%20Pi%E8ces%20pour%20clavecin%20-%20Leonhardt%20-%20Alpha/01%20Il%20primo%20libro%20d%27intavolatura%20di%20toccate%20di%20cimbalo%20et%20organo.%20no.2.%20toccata%20seconda.flac] : [[/espace/SB/m/CLASSIC EB/Leonhardt, Gustav/Frescobaldi, Couperin - Pièces pour clavecin - Leonhardt - Alpha/01 Il primo libro d'intavolatura di toccate di cimbalo et organo. no.2. toccata seconda.flac] does not exist or cannot be read: No such file or directory at /usr/local/squeezebox/SlimServer_v7-13333-20070928/lib/Audio/FLAC/Header.pm line 67.
]
[23:01:06.0382] Slim::Schema::Debug::query_start (26) SELECT me.id, me.titlesort, me.contributor, me.compilation, me.year, me.artwork, me.disc, me.discc, me.musicmagic_mixable, me.titlesearch, me.replay_gain, me.replay_peak, me.musicbrainz_id, me.title FROM albums me WHERE ( ( ( me.id = ? ) ) ): '168'
[23:01:06.0652] Slim::Schema::Track::coverArt (299) Error: Exception when trying to call readCoverArt() for [file:///espace/SB/m/CLASSIC%20EB/Leonhardt,%20Gustav/Frescobaldi,%20Couperin%20-%20Pi%E8ces%20pour%20clavecin%20-%20Leonhardt%20-%20Alpha/01%20Il%20primo%20libro%20d%27intavolatura%20di%20toccate%20di%20cimbalo%20et%20organo.%20no.2.%20toccata%20seconda.flac] : [[/espace/SB/m/CLASSIC EB/Leonhardt, Gustav/Frescobaldi, Couperin - Pièces pour clavecin - Leonhardt - Alpha/01 Il primo libro d'intavolatura di toccate di cimbalo et organo. no.2. toccata seconda.flac] does not exist or cannot be read: No such file or directory at /usr/local/squeezebox/SlimServer_v7-13333-20070928/lib/Audio/FLAC/Header.pm line 67.
]
[23:01:06.0724] Slim::Schema::Debug::query_start (26) SELECT contributor.id, contributor.name, contributor.namesort, contributor.musicmagic_mixable, contributor.namesearch, contributor.musicbrainz_id FROM contributor_track me  JOIN contributors contributor ON ( contributor.id = me.contributor ) WHERE ( ( ( role IN ( ? ) ) AND ( me.track = ? ) ) ) GROUP BY contributor.id ORDER BY role desc: '5', '2366'
[23:01:06.0825] Slim::Schema::Debug::query_start (26) SELECT contributor.id, contributor.name, contributor.namesort, contributor.musicmagic_mixable, contributor.namesearch, contributor.musicbrainz_id FROM contributor_track me  JOIN contributors contributor ON ( contributor.id = me.contributor ) WHERE ( ( ( role IN ( ? ) ) AND ( me.track = ? ) ) ) GROUP BY contributor.id ORDER BY role desc: '1', '2366'
[23:01:06.0932] Slim::Schema::Debug::query_start (26) SELECT contributor.id, contributor.name, contributor.namesort, contributor.musicmagic_mixable, contributor.namesearch, contributor.musicbrainz_id FROM contributor_track me  JOIN contributors contributor ON ( contributor.id = me.contributor ) WHERE ( ( ( role IN ( ? ) ) AND ( me.track = ? ) ) ) GROUP BY contributor.id ORDER BY role desc: '4', '2366'
[23:01:06.1039] Slim::Schema::Debug::query_start (26) SELECT contributor.id, contributor.name, contributor.namesort, contributor.musicmagic_mixable, contributor.namesearch, contributor.musicbrainz_id FROM contributor_track me  JOIN contributors contributor ON ( contributor.id = me.contributor ) WHERE ( ( ( role IN ( ? ) ) AND ( me.track = ? ) ) ) GROUP BY contributor.id ORDER BY role desc: '2', '2366'
[23:01:06.1145] Slim::Schema::Debug::query_start (26) SELECT contributor.id, contributor.name, contributor.namesort, contributor.musicmagic_mixable, contributor.namesearch, contributor.musicbrainz_id FROM contributor_track me  JOIN contributors contributor ON ( contributor.id = me.contributor ) WHERE ( ( ( role IN ( ? ) ) AND ( me.track = ? ) ) ) GROUP BY contributor.id ORDER BY role desc: '3', '2366'
[23:01:06.1253] Slim::Schema::Debug::query_start (26) SELECT contributor.id, contributor.name, contributor.namesort, contributor.musicmagic_mixable, contributor.namesearch, contributor.musicbrainz_id FROM contributor_track me  JOIN contributors contributor ON ( contributor.id = me.contributor ) WHERE ( ( ( role IN ( ? ) ) AND ( me.track = ? ) ) ) GROUP BY contributor.id ORDER BY role desc: '6', '2366'
[23:01:06.1369] Slim::Schema::Debug::query_start (26) SELECT genre.id, genre.name, genre.namesort, genre.namesearch, genre.musicmagic_mixable FROM genre_track me  JOIN genres genre ON ( genre.id = me.genre ) WHERE ( me.track = ? ): '2366'
[23:01:06.1619] Slim::Schema::Track::coverArt (299) Error: Exception when trying to call readCoverArt() for [file:///espace/SB/m/CLASSIC%20EB/Leonhardt,%20Gustav/Frescobaldi,%20Couperin%20-%20Pi%E8ces%20pour%20clavecin%20-%20Leonhardt%20-%20Alpha/01%20Il%20primo%20libro%20d%27intavolatura%20di%20toccate%20di%20cimbalo%20et%20organo.%20no.2.%20toccata%20seconda.flac] : [[/espace/SB/m/CLASSIC EB/Leonhardt, Gustav/Frescobaldi, Couperin - Pièces pour clavecin - Leonhardt - Alpha/01 Il primo libro d'intavolatura di toccate di cimbalo et organo. no.2. toccata seconda.flac] does not exist or cannot be read: No such file or directory at /usr/local/squeezebox/SlimServer_v7-13333-20070928/lib/Audio/FLAC/Header.pm line 67.
]

I think I have the beginning of an answer... complete album tracks url are utf8 encoded while url of the incomplete duplicate album are iso-8859 encoded as you can see in the track table (see attachment):
1926, 'file:///espace/SB/m/CLASSIC%20NG/Meneses,%2(...) 20-%20Est%C3%BAdio%20Eldorado/06%20Sonata%20for%20arpeggione%20&%20piano%20in%20a%20minor%20(arpeggione%20sonata),%20d.%20821%20-%20allegretto.flac'
        ^^^^^^^^^^^^^^
2361, 'file:///espace/SB/m/CLASSIC%20NG/Meneses,%2(...) 20-%20Est%FAdio%20Eldorado/03%20Sonata%20for%20cello%20&%20piano%20no.%201%20in%20e%20minor,%20op.%2038%20-%20allegro.flac', 
       ^^^^^^^^^^^^

Comment 3 Robin V. 2007-10-20 07:55:56 UTC
Today, those duplicate album have disappeared... maybe the nightly database update delete this ghost albums. It's almost certain they will appear again the next full rescan...
Comment 4 Chris Owens 2007-10-22 09:28:29 UTC
Please reopen if this continues causing you problems.
Comment 5 Robin V. 2007-10-22 11:49:18 UTC
It will remain close. I've done several full rescan without being able to reproduce the bug. I don't understand. Be it passing from 6.5 to 7.0 or doing a simple "full rescan", the database should have been wiped each time... I had it with different albums, then with same album for several full rescans. Even saw the strange character in database... now, there's nothing. 

It could be related to SC being launched sometimes in utf-8 (when launched manually for development) and sometimes in iso-8859 (when launched from init.d). If I find something else, I'll let you know by reopening it. Sorry for the false alert ;).