PDA

View Full Version : "Error writing file '/tmp/MY5pGgvS'" when searching



smst
2007-07-06, 09:17
Hi all. I'm having a problem with my installation of SlimServer 6.5.2 (plus change 12074 (http://svn.slimdevices.com/?rev=12074&view=rev) to fix an earlier searching problem) on a Debian install on a LinkStation Pro.

When I use "Advanced Search" (searching for an artist containing the word "Kings" in this example) I get no results, and the following backtrace is logged:
2007-07-06 16:59:52.9516 Backtrace:

frame 0: Slim::Schema::Storage::throw_exception (/usr/share/perl5/DBIx/Class/Storage/DBI.pm line 775)
frame 1: DBIx::Class::Storage::DBI::_execute (/usr/share/perl5/DBIx/Class/Storage/DBI.pm line 828)
frame 2: DBIx::Class::Storage::DBI::_select (/usr/share/perl5/DBIx/Class/Storage/DBI/Cursor.pm line 79)
frame 3: DBIx::Class::Storage::DBI::Cursor::next (/usr/share/perl5/DBIx/Class/ResultSet.pm line 731)
frame 4: DBIx::Class::ResultSet::next (/usr/share/perl5/Slim/Web/Pages/Search.pm line 346)
frame 5: Slim::Web::Pages::Search::fillInSearchResults (/usr/share/perl5/Slim/Web/Pages/Search.pm line 265)
frame 6: Slim::Web::Pages::Search::advancedSearch (/usr/share/perl5/Slim/Web/HTTP.pm line 828)
frame 7: Slim::Web::HTTP::generateHTTPResponse (/usr/share/perl5/Slim/Web/HTTP.pm line 694)
frame 8: Slim::Web::HTTP::processURL (/usr/share/perl5/Slim/Web/HTTP.pm line 540)
frame 9: Slim::Web::HTTP::processHTTP (/usr/share/perl5/Slim/Networking/Select.pm line 238)
frame 10: (eval) (/usr/share/perl5/Slim/Networking/Select.pm line 238)
frame 11: Slim::Networking::Select::select (/usr/sbin/slimserver line 493)
frame 12: main::idle (/usr/sbin/slimserver line 446)
frame 13: main::main (/usr/sbin/slimserver line 1072)

2007-07-06 16:59:52.9928 Select task failed: Carp::Clan::__ANON__(): Error executing '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.thumb, 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.moodlogic_id, me.moodlogic_mixable, 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 LEFT JOIN contributor_track contributorTracks ON ( contributorTracks.track = me.id ) JOIN contributors contributor ON ( contributor.id = contributorTracks.contributor ) WHERE ( ( ( contributor.namesearch LIKE ? ) ) AND ( ( contributorTracks.role = ? ) OR ( contributorTracks.role = ? ) ) ) ORDER BY me.disc, me.titlesort': DBD::mysql::st execute failed: Error writing file '/tmp/MY5pGgvS' (Errcode: 28) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 773.

(In case anyone's browser or mail client doesn't like that very long line at the end, it ends with this error: DBD::mysql::st execute failed: Error writing file '/tmp/MY5pGgvS' (Errcode: 28) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 773.)

The "Search Music" search works fine. Searching from the SqueezeBox itself (either with the basic search or with the LazySearch plugin) gives no results, although I haven't enabled debug output for that yet -- I thought I'd start with this one.

I note that I've seen a similar error message when trying to re-index the music library. The nightly scheduled rescan never seems to pick anything up. I've tried running slimserver-scanner at the command line, but if I'm not root when I do so I get that error message (although the backtrace may differ; I'm currently trying to reproduce that!).

I therefore wonder if I have a permissions problem. I'm quite familiar with linux but I'm weak on permissions, so would appreciate any advice. The slimserver process runs as the user 'slimserver'; if I change to that user in a shell, I can write to the /tmp directory. The /tmp directory is in its own partitition with about 10M of space free; could these searches be generating so much data that the temporary file is that large? (My library has ~16000 tracks in it, but only 4 artists would match my "kings" search.)

Thanks in advance for any ideas.

snarlydwarf
2007-07-06, 09:46
I therefore wonder if I have a permissions problem. I'm quite familiar with linux but I'm weak on permissions, so would appreciate any advice.

As root:
chown root.root /tmp
chmod 1777 /tmp

That should make /tmp look like (with "ls -ld /tmp"):
drwxrwxrwt 13 root root 4096 2007-07-06 09:39 /tmp
which is what you want. root owns it, anyone can create files there, but only owner of the file can delete it/modify etc. (that is what the "t" permission does on directories.)


The slimserver process runs as the user 'slimserver'; if I change to that user in a shell, I can write to the /tmp directory. The /tmp directory is in its own partitition with about 10M of space free; could these searches be generating so much data that the temporary file is that large? (My library has ~16000 tracks in it, but only 4 artists would match my "kings" search.)

Thanks in advance for any ideas.

10M is pretty small for free space on /tmp. I don't know what slimserver/mysql use there, but I get paged by my servers as an emergency if it's less than 30M free. Is the partition that small? Or is there some junky log file or something that could be deleted? I would feel claustrophobic with that little. (And, yes, mysql uses /tmp for making files when it is doing some operations.)

smst
2007-07-06, 10:43
As root:
chown root.root /tmp
chmod 1777 /tmp

That should make /tmp look like (with "ls -ld /tmp"):
drwxrwxrwt 13 root root 4096 2007-07-06 09:39 /tmp
which is what you want. root owns it, anyone can create files there, but only owner of the file can delete it/modify etc. (that is what the "t" permission does on directories.)

Thanks for that, and for the explanation. I made those changes but the problem persists (and I believe '/tmp' already had the correct permissions after all, since the 'ls' output didn't change). So I guess it's not a permissions problem!


10M is pretty small for free space on /tmp. I don't know what slimserver/mysql use there, but I get paged by my servers as an emergency if it's less than 30M free. Is the partition that small? Or is there some junky log file or something that could be deleted? I would feel claustrophobic with that little. (And, yes, mysql uses /tmp for making files when it is doing some operations.)

It's the partition -- all the partitions were set up for me by installing FreeLink (http://www.linkstationwiki.net/index.php/FreeLink_for_the_Linkstation_Pro), which replaces the LS Pro's firmware and installs a Debian distribution. Space is tight on the primary partition, and I didn't re-partition after installing (although now I wish I had!) -- I just moved large libraries into a partial mirror on the big data partition and linked to them from the directories in /var, /usr and so on.

Here's what 'df' says:

Filesystem Size Used Avail Use% Mounted on
tmpfs 10M 224K 9.8M 3% /tmp

Might that be in RAM, and not on the disk at all?

I'm wondering whether I might be able to point /tmp at a location somewhere on the big data partition. I'll give that a whirl later (although if I can't do it while the system is running, I may need to wait a bit).

Thanks for your help!

smst
2007-07-07, 12:13
Changing /tmp from being a tmpfs partition to just a directory in the root partition (90M free instead of 10M) seems to have made it possible to search again. I say "seems"... I had to reboot the box to make the change (since I couldn't unmount /tmp), and when it started up again, SlimServer had lost most of its database.

I have no idea how that can happen; I went into mysql and asked it how many albums there were, and it said there were about 17. So I pointed SlimServer at a fairly small directory and rescanned, after which I could find things with "Advanced Search". (Foolishly I didn't check whether the SqueezeBox was also able to search now.)

I'm now trying to have it rescan the full library, but it's hit another snag. I'll mention it here on the offchance anybody reading has any ideas, but I'll check through the bugs db later.

The scanner has been hanging for 2 hours. The debug output shows this before the hang:

.2007-07-07 18:13:34.8908 mp3 file type for file:///mnt/disk1/share/Music/Downloaded%20Illicitly/R/Ricky%20Gervais,%20Stephen%20Merchant,%20Karl%20Pi lkington%20-%20[2002]%20XFM%20Show%20(Season%201,%20Episode%2018)/01%20-%20Part%2001.mp3
2007-07-07 18:13:34.8950 ScanDirectory: Adding file:///mnt/disk1/share/Music/Downloaded%20Illicitly/R/Ricky%20Gervais,%20Stephen%20Merchant,%20Karl%20Pi lkington%20-%20[2002]%20XFM%20Show%20(Season%201,%20Episode%2018)/01%20-%20Part%2001.mp3 to database.
2007-07-07 18:13:34.8982
2007-07-07 18:13:34.9012 newTrack(): New Track: [file:///mnt/disk1/share/Music/Downloaded%20Illicitly/R/Ricky%20Gervais,%20Stephen%20Merchant,%20Karl%20Pi lkington%20-%20[2002]%20XFM%20Show%20(Season%201,%20Episode%2018)/01%20-%20Part%2001.mp3]
2007-07-07 18:13:34.9041 newTrack(): readTags is 1
2007-07-07 18:13:34.9171 mp3 file type for /mnt/disk1/share/Music/Downloaded Illicitly/R/Ricky Gervais, Stephen Merchant, Karl Pilkington - [2002] XFM Show (Season 1, Episode 18)/01 - Part 01.mp3
2007-07-07 18:13:35.1431 newTrack(): Created track 'Part 01' (id: [1627])
2007-07-07 18:13:35.1497 -- Track is a local track
2007-07-07 18:13:35.3580 -- Track has genre 'ARRAY(0x17764b4)'
2007-07-07 18:13:35.3612 -- Contributor 'ARRAY(0x15b4640)' of role 'ARTIST' transformed to role 'TRACKARTIST'
2007-07-07 18:13:35.4406 -- Track has contributor 'Karl Pilkington' of role 'ALBUMARTIST'
2007-07-07 18:13:35.6708 -- Track has contributor 'ARRAY(0x15b4640)' of role 'TRACKARTIST'
2007-07-07 18:13:35.6740 -- Track has 2 contributor(s)
2007-07-07 18:13:35.6797 -- Track primary contributor is 'Karl Pilkington' (id: [367])
2007-07-07 18:13:35.6839 -- Checking for discs
Looking back through the log, it seems to be stuck before it can do something like this (from the previous album):

2007-07-07 18:13:17.9994 -- Searching for an album with:
2007-07-07 18:13:18.0178 --- tracks.url : {
like => "file:///mnt/disk1/share/Music/Downloaded%20Illicitly/R/Ricky%20Gervais,%20Stephen%20Merchant,%20Karl%20Pi lkington%20-%20[2002]%20XFM%20Show%20(Season%201,%20Episode%2017)%",
}

mysqld and slimserver are both using lots of CPU. I'm going to kill it, and investigate some more tomorrow. As I said: just mentioning it in case it rings any bells.