Bugzilla – Bug 5943
Database constraint errors
Last modified: 2008-12-18 11:12:53 UTC
This has now happened in my setup a number of times in SqueezeCenter 7.0. I currently have no idea how to reproduce it, but when it happens I need to make a full rescan to get rid of the problems. I usually see the problem when it starts to appears tracks in the current playlist with no cover art and when I click on the song title it just shown an empty Song Info page. I suspect the reason somehow is that the track party exist and party doesn't exist in the database. I'm just logging this as a bug report in case anyone with more knowledge of SqueezeCenter internals have any ideas what the cause could be and how it might be possible to reproduce. It has happened several times, over the last months, so something is wrong somewhere, the problem is just that I haven't found a way to reproduce the problem. I have the music on a mounted network drive so I'm not sure if network issues or something could cause problems like this. Anyway, if anyone have any ideas what to try to reproduce it, I'll do my best to help. If you don't want this as a bug report until I know a way to reproduce it, please just close it. This is the error I'm getting in the logs: ======================== [07:32:22.2064] Slim::Schema::Storage::throw_exception (67) Backtrace: frame 0: Slim::Utils::Log::logBacktrace (/usr/src/slimserver70/server/Slim/Schema/Storage.pm line 67) frame 1: Slim::Schema::Storage::throw_exception (/usr/src/slimserver70/server/CPAN/DBIx/Class/Storage/DBI.pm line 773) frame 2: DBIx::Class::Storage::DBI::_execute (/usr/src/slimserver70/server/CPAN/DBIx/Class/Storage/DBI.pm line 788) frame 3: DBIx::Class::Storage::DBI::insert (/usr/src/slimserver70/server/CPAN/DBIx/Class/Row.pm line 75) frame 4: DBIx::Class::Row::insert (/usr/src/slimserver70/server/CPAN/DBIx/Class/PK/Auto.pm line 43) frame 5: DBIx::Class::PK::Auto::insert (/usr/src/slimserver70/server/CPAN/DBIx/Class/ResultSet.pm line 1335) frame 6: DBIx::Class::ResultSet::create (/usr/src/slimserver70/server/Slim/Schema/Playlist.pm line 108) frame 7: Slim::Schema::Playlist::_addTracksToPlaylist (/usr/src/slimserver70/server/Slim/Schema/Playlist.pm line 45) frame 8: Slim::Schema::Playlist::__ANON__ (/usr/src/slimserver70/server/CPAN/DBIx/Class/Schema.pm line 584) frame 9: (eval) (/usr/src/slimserver70/server/CPAN/DBIx/Class/Schema.pm line 572) frame 10: DBIx::Class::Schema::txn_do (/usr/src/slimserver70/server/Slim/Schema/Playlist.pm line 46) frame 11: (eval) (/usr/src/slimserver70/server/Slim/Schema/Playlist.pm line 39) frame 12: Slim::Schema::Playlist::setTracks (/usr/src/slimserver70/server/Slim/Player/Playlist.pm line 811) frame 13: Slim::Player::Playlist::modifyPlaylistCallback (/usr/src/slimserver70/server/Slim/Control/Request.pm line 1889) frame 14: (eval) (/usr/src/slimserver70/server/Slim/Control/Request.pm line 1889) frame 15: Slim::Control::Request::notify (/usr/src/slimserver70/server/Slim/Control/Request.pm line 786) frame 16: Slim::Control::Request::checkNotifications (/opt/slimserver70/slimserver.pl line 466) frame 17: main::idle (/opt/slimserver70/slimserver.pl line 437) frame 18: main::main (/opt/slimserver70/slimserver.pl line 979) [07:32:22.2274] Slim::Schema::throw_exception (217) Error: Carp::Clan::__ANON__(): Error executing 'INSERT INTO playlist_track (playlist, position, track) VALUES (?, ?, ?)': DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`slimserver/playlist_track`, CONSTRAINT `playlist_track_ibfk_1` FOREIGN KEY (`track`) REFERENCES `tracks` (`id`) ON DELETE CASCADE) at /usr/src/slimserver70/server/CPAN/DBIx/Class/Storage/DBI.pm line 771. ========================
Please search for comments that contain: CPAN/DBIx/Class/Storage/DBI.pm line 771 You'll find a number of reports, some open some closed as not reproduceable. One of these may match.
We'll see if we can come up with reliable repro instructions.
This problem might have been corrected by this fix: http://svn.slimdevices.com/?rev=14469&view=rev I'm not sure yet, but I've tried to stress SqueezeCenter a bit during the last hour and I haven't got the database constraints issues yet. I'll mark this as fixed if I don't see the problem during the next week or two. If I see the problem I'll post a new message regarding this here again.
I think we can consider this as fixed by this change: http://svn.slimdevices.com/?rev=14469&view=rev I've tried to reproduce it a couple of time the last weeks but haven't succeed after this correction, so that was probably the problem. So I think it would be safe to consider this as fixed unless someone else has been able to reproduce the problem.
change 14469 it is then. We'll mark as fixed and leave it to QA to verify or it can be requested reopened if anyone finds a recurring case with more recent builds.
This bug is being closed since it was resolved for a version which is now released! Please download the new version of SqueezeCenter (formerly SlimServer) at http://www.slimdevices.com/su_downloads.html If you are still seeing this bug, please re-open it and we will consider it for a future release.