problem storing largefile

sanados sanados at
Tue Apr 22 06:40:01 UTC 2008

jeff thompson wrote:
> I have a command line script that tries to store a large file (~400mb) 
> in mogile, using MogileFS::ClientHTTPFile, but it's erroring out when 
> I try to close the file with the following error:
> Can't call method "close" on an undefined value at (eval 11) line 1,
>  <F> line 1.
>  at (eval 11) line 1
>     IO::WrapTie::Master::close('IO::WrapTie::Master=GLOB(0x85dc4d4)')
>  called at line 69
> Can't call method "close" on an undefined value at (eval 11) line 1,
>  <F> line 1.
> I've checked and my is the lastest version (2.110), so 
> I'm at a bit of a loss. It seems to be the "tied(*$s)" call in the 
> close method created by PRELOAD that is causing the error. Anyone know 
> how I can fix this?
> Here's the relevant part of my script (which I'm sure will look very 
> familar):
> my ($file,$key,$size,$args) = ($ARGV[0],$ARGV[1], -s $file, { 
> largefile => 1 });
> open(F,"< $file") || die "Can't open file[$file]";
> my $fh = $mogfs->new_file($key, "bigFile",$size,$args);
> die "Unable to allocate filehandle.\n" unless $fh;
> while (my $x = <F>) {
>   $fh->print($x);
> }
> die "Unable to save file to MogileFS.\n" unless $fh->close;
> ------------------------------------------------------------------------
> Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try 
> it now. 
> <*;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ%20>

Got that error too (or a similar)

Found out that this error occurs when the comp is completly out of 
(load of 4 and 70% waiting I/O)

so the timeouts trigger.
In my case this happened to my old IDE-harddisks combined with a 
db-slave running on the same comp.
Also if you got a db (slave) ran on this comp you are connecting to you 
can get a similar error that mogile got no key.

More information about the mogilefs mailing list