PDA

View Full Version : Playlists not being saved



glashoppah
2007-08-28, 20:29
When we choose to save playlists from the GUI web page, a file with the playlist name is created in the playlist directory but it's empty. I checked the permissions and everyone is set to full control of the directory and files therein.

I've tried everything I can think of - I hope there's an easy fix.

g.

p.s. I also noticed that, although the directory in question only contains a single copy of each playlist file, the Slim web page shows multiple playlists of the same name. In any case, all the files are empty of songs - they are all 23 bytes in length no matter how large the playlist I'm trying to save.

Siduhe
2007-08-29, 01:35
A few more details about your system would help:

What OS (I'm guessing some flavour of Linux from your post)?

What version of Slimserver?

How do you store your music files - on the same box as Slimserver or on an external drive?

Are you trying to save the playlists on the same box that Slimserver is installed on, or on an external or different drive?

What is the setting of your Music Folder and Playlist Folder?

What permissions do you have set for the folder / files and directories?

If you create a playlist using another program like Winamp or Foobar, put this in your playlist directory and do a scan for new playlists, does Slimserver pick it up and will it play it?

glashoppah
2007-08-29, 09:33
Here are the details:

Win2003 server is running Slim, hosting the files and the playlists. The directory structure with my media files has read permission for the music and full control for the playlists folder for the Everyone group. Music plays just fine.

Slim server version is 6.5.4 - 12568

Music folder is D:\ShareRoot\Common\Media Files\Audio\Music\Organized

Playlist folder is D:\ShareRoot\Common\Media Files\Audio\Music\Slim Playlists

Permissions for the Media Files tree is everyone gets all permissions except Full Control, Modify and Delete (I like people to be able to post, but I don't want anything removed).

Subpermission for the Slim Playlists folder is everyone gets full control

I don't have Winamp or Foobar installed - I guess I could hand build a playlist file. What I find puzzling is when I go to the server webpage, it shows two copies of two playlists (four total), even though the folder only has a single playlist file in it. In any case, none of them contain any items. The two playlists are the two I've been experimenting with. Why there are two copies I could not say.

Update: If I click "download" instead of "save" on the playlist links, and save the file to my local PC, it's fine - it is 2.5k in length and contains the items. If I then move that file to the server folder with a new name - it doesn't show up in the playlists display. The original four (two copies of two playlists) are all that are there, and they're all empty.

Thanks for your time,

g.

Siduhe
2007-08-29, 09:42
Ah, don't know that much about Windows Server 2003, sorry.

One immediate thought - If you change the permissions on the Music Folder to Full Control or Modify as a test, can you then write the playlists?

Also, not sure how it works on Windows Server 2003, but is Slimserver running as a user?

glashoppah
2007-08-29, 10:22
Slimserver is running as the System account, which has the required permissions. I've tried full access, but no go.

I created some m3u playlists and put them in the directory, and rescanned, they show up just fine. But I can't save anything new from the web UI - it just saves blank files.

g.

Siduhe
2007-08-29, 11:27
Ok, go to Server SEttings / Debugging and enable d_playlist. Then open up the logfile (hyperlink marked "here" on the Debugging page).

Create and try to save a playlist - what does the logfile show? Any error messages? My hunch is this has to be something to do with permissions, but it's difficult to see what it could be.

Also, sorry if this is grandmother sucking eggs - you have you tried doing a rescan for playlists have you?

glashoppah
2007-08-29, 12:09
I admit that I hadn't rescanned playlists when I started this thread (didn't realize it was required at the time), doing so eliminated list names that didn't match files in the folder, so the "duplicate item" problem was solved. And it allowed me to see the new lists I'd hand-created. But the basic problem, that of the server writing blank files, is still with us. Here is a snip of the log.txt file:

******* START INCLUDED LOG FILE PORTION

ERROR: 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 C:\Program Files\SlimServer\server\CPAN/DBIx/Class/Storage/DBI.pm line 771.

ERROR: Backtrace follows:

Backtrace:

frame 0: Slim::Schema::Storage::throw_exception (C:\Program Files\SlimServer\server\CPAN/DBIx/Class/Storage/DBI.pm line 773)
frame 1: DBIx::Class::Storage::DBI::_execute (C:\Program Files\SlimServer\server\CPAN/DBIx/Class/Storage/DBI.pm line 788)
frame 2: DBIx::Class::Storage::DBI::insert (C:\Program Files\SlimServer\server\CPAN/DBIx/Class/Row.pm line 75)
frame 3: DBIx::Class::Row::insert (C:\Program Files\SlimServer\server\CPAN/DBIx/Class/PK/Auto.pm line 43)
frame 4: DBIx::Class::PK::Auto::insert (C:\Program Files\SlimServer\server\CPAN/DBIx/Class/ResultSet.pm line 1335)
frame 5: DBIx::Class::ResultSet::create (C:\Program Files\SlimServer\server/Slim/Schema/Playlist.pm line 108)
frame 6: Slim::Schema::Playlist::_addTracksToPlaylist (C:\Program Files\SlimServer\server/Slim/Schema/Playlist.pm line 45)
frame 7: Slim::Schema::Playlist::__ANON__ (/<C:\Program Files\SlimServer\server\slim.exe>DBIx/Class/Schema.pm line 584)
frame 8: (eval) (/<C:\Program Files\SlimServer\server\slim.exe>DBIx/Class/Schema.pm line 572)
frame 9: DBIx::Class::Schema::txn_do (C:\Program Files\SlimServer\server/Slim/Schema/Playlist.pm line 46)
frame 10: (eval) (C:\Program Files\SlimServer\server/Slim/Schema/Playlist.pm line 39)
frame 11: Slim::Schema::Playlist::setTracks (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Control/Commands.pm line 701)
frame 12: Slim::Control::Commands::playlistSaveCommand (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Control/Request.pm line 1483)
frame 13: (eval) (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Control/Request.pm line 1483)
frame 14: Slim::Control::Request::execute (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Control/Request.pm line 772)
frame 15: Slim::Control::Request::executeRequest (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Web/Pages/EditPlaylist.pm line 126)
frame 16: Slim::Web::Pages::EditPlaylist::saveCurrentPlaylis t (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Web/Pages/EditPlaylist.pm line 39)
frame 17: Slim::Web::Pages::EditPlaylist::editplaylist (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Web/HTTP.pm line 843)
frame 18: Slim::Web::HTTP::generateHTTPResponse (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Web/HTTP.pm line 709)
frame 19: Slim::Web::HTTP::processURL (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Web/HTTP.pm line 555)
frame 20: Slim::Web::HTTP::processHTTP (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Networking/Select.pm line 238)
frame 21: (eval) (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Networking/Select.pm line 238)
frame 22: Slim::Networking::Select::select (slimserver.pl line 499)
frame 23: main::idle (slimserver.pl line 42)
frame 24: PerlSvc::Startup (perlsvc line 850)
frame 25: PerlSvc::_startup (slimserver.pl line 0)
frame 26: (eval) (slimserver.pl line 0)

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 C:\Program Files\SlimServer\server\CPAN/DBIx/Class/Storage/DBI.pm line 771.

ERROR: Backtrace follows:

Backtrace:

frame 0: Slim::Schema::throw_exception (/<C:\Program Files\SlimServer\server\slim.exe>DBIx/Class/Schema.pm line 606)
frame 1: DBIx::Class::Schema::txn_do (C:\Program Files\SlimServer\server/Slim/Schema/Playlist.pm line 46)
frame 2: (eval) (C:\Program Files\SlimServer\server/Slim/Schema/Playlist.pm line 39)
frame 3: Slim::Schema::Playlist::setTracks (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Control/Commands.pm line 701)
frame 4: Slim::Control::Commands::playlistSaveCommand (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Control/Request.pm line 1483)
frame 5: (eval) (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Control/Request.pm line 1483)
frame 6: Slim::Control::Request::execute (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Control/Request.pm line 772)
frame 7: Slim::Control::Request::executeRequest (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Web/Pages/EditPlaylist.pm line 126)
frame 8: Slim::Web::Pages::EditPlaylist::saveCurrentPlaylis t (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Web/Pages/EditPlaylist.pm line 39)
frame 9: Slim::Web::Pages::EditPlaylist::editplaylist (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Web/HTTP.pm line 843)
frame 10: Slim::Web::HTTP::generateHTTPResponse (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Web/HTTP.pm line 709)
frame 11: Slim::Web::HTTP::processURL (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Web/HTTP.pm line 555)
frame 12: Slim::Web::HTTP::processHTTP (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Networking/Select.pm line 238)
frame 13: (eval) (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Networking/Select.pm line 238)
frame 14: Slim::Networking::Select::select (slimserver.pl line 499)
frame 15: main::idle (slimserver.pl line 42)
frame 16: PerlSvc::Startup (perlsvc line 850)
frame 17: PerlSvc::_startup (slimserver.pl line 0)
frame 18: (eval) (slimserver.pl line 0)

scheduleWriteOfPlaylist: Not writing out untitled playlist.
modifyPlaylistCallback: savecurrsong is 0
currentPlaylistChangeTime : Tue Aug 28 21:09:48 2007
currentPlaylistRender : Wed Aug 29 12:06:36 2007
currentPlaylistRenderSkin :
currentPlaylistRenderStart: 0
skinOverride:
start: 0
Returning cached playlist html - not modified.
currentPlaylistChangeTime : Tue Aug 28 21:09:48 2007
currentPlaylistRender : Wed Aug 29 12:06:36 2007
currentPlaylistRenderSkin :
currentPlaylistRenderStart: 0
skinOverride:
start: 0
Returning cached playlist html - not modified.
currentPlaylistChangeTime : Tue Aug 28 21:09:48 2007
currentPlaylistRender : Wed Aug 29 12:06:36 2007
currentPlaylistRenderSkin :
currentPlaylistRenderStart: 0
skinOverride:
start: 0
Returning cached playlist html - not modified.
currentPlaylistChangeTime : Tue Aug 28 21:09:48 2007
currentPlaylistRender : Wed Aug 29 12:06:36 2007
currentPlaylistRenderSkin :
currentPlaylistRenderStart: 0
skinOverride:
start: 0
Returning cached playlist html - not modified.

******* END INCLUDED LOG FILE PORTION

g.

Siduhe
2007-08-29, 12:21
You haven't manually corrected the SB database have you? Or using any plugins like Itunes / Dynamic Playlist / TrackStat?

I ask because AFAIK, "foreign key constraint" means that some row in some other table refers to the primary key of the entry you are trying to modify.

This could be a sign of a corrupted database. I would try stopping Slimserver, deleting the contents of the cache folder, and then restarting Slimserver. This should allow Slimserver to build a fresh database. Does that improve things?

UPDATE - you don't have any Chinese or non-western characters in any files do you?

Just that this looks a bit like your issue and is on a similar set up:

http://forums.slimdevices.com/showthread.php?t=30368&highlight=Error+executing+%27INSERT+playlist_track

Siduhe
2007-08-29, 12:24
And see this bug which looks a possible match to what you are experiencing:

http://bugs.slimdevices.com/show_bug.cgi?id=2475

glashoppah
2007-08-29, 12:47
You haven't manually corrected the SB database have you? Or using any plugins like Itunes / Dynamic Playlist / TrackStat?

I ask because AFAIK, "foreign key constraint" means that some row in some other table refers to the primary key of the entry you are trying to modify.

This could be a sign of a corrupted database. I would try stopping Slimserver, deleting the contents of the cache folder, and then restarting Slimserver. This should allow Slimserver to build a fresh database. Does that improve things?

UPDATE - you don't have any Chinese or non-western characters in any files do you?

Just that this looks a bit like your issue and is on a similar set up:

http://forums.slimdevices.com/showthread.php?t=30368&highlight=Error+executing+%27INSERT+playlist_track

I don't know enough to have manually done anything at this point, and no, I've not messed with any plugins. This is as simple and as vanilla as an install can be, with everything local to the server software.

I definitely don't have any unusual characters in any file names. The first attempt made to save a playlist was about 5 songs, all normal ASCII A-Z, a-z characters. And I'm not having any problems playing music or scanning folders.

Which cache folder should I be deleting?

g.

Siduhe
2007-08-29, 13:02
Typically the cache folder is at C:\Program Files\SlimServer\server\Cache. You can either delete the contents entirely, or (a more cautious approach) rename the file called "slimserversql.db". This is your library database.

Slimserver must be stopped when you do this.

Having renamed it, slim will now build a brand new one (e.g. will build a new library DB, which should remove any dodgy or duplicate entries). You can revert back to the old one, should you need to, by restoring the old slimserversql.db you renamed previously.

glashoppah
2007-08-29, 13:47
Typically the cache folder is at C:\Program Files\SlimServer\server\Cache. You can either delete the contents entirely, or (a more cautious approach) rename the file called "slimserversql.db". This is your library database.

Slimserver must be stopped when you do this.

Having renamed it, slim will now build a brand new one (e.g. will build a new library DB, which should remove any dodgy or duplicate entries). You can revert back to the old one, should you need to, by restoring the old slimserversql.db you renamed previously.

Do I need to rescan my library after doing this?

g.

Mark Lanctot
2007-08-31, 06:04
No, rebuilding the database is the same as a clear & rescan.

jkouns
2007-09-01, 15:59
I have just hit a similar issue..... was building a large playlist for an upcoming party. Had saved the playlist multiple times without any issues. Added a bunch more songs while also listening to the playlist. Then when I went to save the final playlist it was blank....

Everything in this thread seems to point to the same situation. Haven't done anything else yet except get logs:

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 C:\Program Files\SlimServer\server\CPAN/DBIx/Class/Storage/DBI.pm line 771.

ERROR: Backtrace follows:

Backtrace:

frame 0: Slim::Schema::throw_exception (/<C:\Program Files\SlimServer\server\slim.exe>DBIx/Class/Schema.pm line 606)
frame 1: DBIx::Class::Schema::txn_do (C:\Program Files\SlimServer\server/Slim/Schema/Playlist.pm line 46)
frame 2: (eval) (C:\Program Files\SlimServer\server/Slim/Schema/Playlist.pm line 39)
frame 3: Slim::Schema::Playlist::setTracks (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Player/Playlist.pm line 757)
frame 4: Slim::Player::Playlist::modifyPlaylistCallback (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Control/Request.pm line 1645)
frame 5: (eval) (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Control/Request.pm line 1645)
frame 6: Slim::Control::Request::notify (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Control/Request.pm line 751)
frame 7: Slim::Control::Request::checkNotifications (slimserver.pl line 476)
frame 8: main::idle (slimserver.pl line 42)
frame 9: PerlSvc::Startup (perlsvc line 850)
frame 10: PerlSvc::_startup (slimserver.pl line 0)
frame 11: (eval) (slimserver.pl line 0)

ERROR: 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 C:\Program Files\SlimServer\server\CPAN/DBIx/Class/Storage/DBI.pm line 771.

ERROR: Backtrace follows:

Backtrace:

frame 0: Slim::Schema::Storage::throw_exception (C:\Program Files\SlimServer\server\CPAN/DBIx/Class/Storage/DBI.pm line 773)
frame 1: DBIx::Class::Storage::DBI::_execute (C:\Program Files\SlimServer\server\CPAN/DBIx/Class/Storage/DBI.pm line 788)
frame 2: DBIx::Class::Storage::DBI::insert (C:\Program Files\SlimServer\server\CPAN/DBIx/Class/Row.pm line 75)
frame 3: DBIx::Class::Row::insert (C:\Program Files\SlimServer\server\CPAN/DBIx/Class/PK/Auto.pm line 43)
frame 4: DBIx::Class::PK::Auto::insert (C:\Program Files\SlimServer\server\CPAN/DBIx/Class/ResultSet.pm line 1335)
frame 5: DBIx::Class::ResultSet::create (C:\Program Files\SlimServer\server/Slim/Schema/Playlist.pm line 108)
frame 6: Slim::Schema::Playlist::_addTracksToPlaylist (C:\Program Files\SlimServer\server/Slim/Schema/Playlist.pm line 45)
frame 7: Slim::Schema::Playlist::__ANON__ (/<C:\Program Files\SlimServer\server\slim.exe>DBIx/Class/Schema.pm line 584)
frame 8: (eval) (/<C:\Program Files\SlimServer\server\slim.exe>DBIx/Class/Schema.pm line 572)
frame 9: DBIx::Class::Schema::txn_do (C:\Program Files\SlimServer\server/Slim/Schema/Playlist.pm line 46)
frame 10: (eval) (C:\Program Files\SlimServer\server/Slim/Schema/Playlist.pm line 39)
frame 11: Slim::Schema::Playlist::setTracks (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Player/Playlist.pm line 757)
frame 12: Slim::Player::Playlist::modifyPlaylistCallback (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Control/Request.pm line 1645)
frame 13: (eval) (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Control/Request.pm line 1645)
frame 14: Slim::Control::Request::notify (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Control/Request.pm line 751)
frame 15: Slim::Control::Request::checkNotifications (slimserver.pl line 476)
frame 16: main::idle (slimserver.pl line 42)
frame 17: PerlSvc::Startup (perlsvc line 850)
frame 18: PerlSvc::_startup (slimserver.pl line 0)
frame 19: (eval) (slimserver.pl line 0)

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 C:\Program Files\SlimServer\server\CPAN/DBIx/Class/Storage/DBI.pm line 771.

ERROR: Backtrace follows:

Backtrace:

frame 0: Slim::Schema::throw_exception (/<C:\Program Files\SlimServer\server\slim.exe>DBIx/Class/Schema.pm line 606)
frame 1: DBIx::Class::Schema::txn_do (C:\Program Files\SlimServer\server/Slim/Schema/Playlist.pm line 46)
frame 2: (eval) (C:\Program Files\SlimServer\server/Slim/Schema/Playlist.pm line 39)
frame 3: Slim::Schema::Playlist::setTracks (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Player/Playlist.pm line 757)
frame 4: Slim::Player::Playlist::modifyPlaylistCallback (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Control/Request.pm line 1645)
frame 5: (eval) (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Control/Request.pm line 1645)
frame 6: Slim::Control::Request::notify (/<C:\Program Files\SlimServer\server\slim.exe>Slim/Control/Request.pm line 751)
frame 7: Slim::Control::Request::checkNotifications (slimserver.pl line 476)
frame 8: main::idle (slimserver.pl line 42)
frame 9: PerlSvc::Startup (perlsvc line 850)
frame 10: PerlSvc::_startup (slimserver.pl line 0)
frame 11: (eval) (slimserver.pl line 0)

jkouns
2007-09-03, 10:54
Just a quick update now I have had some more time to play...

A simple restart of Slimserver corrects the issue. However, a good portion of the playlist that was current (unable to save) was lost. I am going to see if it was a particular song added that caused the issue.

If so, then it might correlate to another existing bug or provide some more information on the root cause.

Does not appear that you need to delete any cache files, etc.
Just a restart... =)