LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-24-2014, 03:19 PM   #1
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Mint, MX, antiX, SystemRescue
Posts: 2,337

Rep: Reputation: 358Reputation: 358Reputation: 358Reputation: 358
PERL question, Storable.pm module


I have a perl script deployed on many hundreds of servers at work. Occassionally, on a few servers, I see two different errors when trying to retrieve() a stored file (these different failure modes occur on different servers):

(1) "File is not a perl storable"

and

(2) "Byte order is not compatible"

This is NOT because I am moving stored files from system to system, perl version to perl version, etc. The file is saved using store() in one run of the script. Then, five minutes later the exact same scripts runs again (this is all under cron control), and tries to retrieve what it stored during its previous run. This is not trying to move/reuse a stored file across different OS'es/versions. It is the same server, running the same version of perl, running the same script, using same version of the Storable.pm module, etc.

There is no chance the stored file is being created/updated by any other process that could be corrupting it. It is very uniquely named, and only writeable by root.

On most of the 800+ servers this script is deployed on, Storable.pm works just fine. But on a handful of servers, I'm seeing these unexpected errors. Any ideas what may be going on?

If have temporarily worked around this by doing the following (using eval to trap the fatal error), but this is just hiding the problem, not fixing it:
Code:
store(\%current, $filename);

... the later, in the next run of the script

if (-e $filename) {
    eval {
        $previous = retrieve($filename);
    };
    if ($@) {
        unlink($filename)
        $previous = {};
    }
}
else {
    $previous = {};
}
 
Old 11-24-2014, 06:32 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,258

Rep: Reputation: 1310Reputation: 1310Reputation: 1310Reputation: 1310Reputation: 1310Reputation: 1310Reputation: 1310Reputation: 1310Reputation: 1310Reputation: 1310
The current version of Storable is 2.51. You can print the version with the command:
Code:
perl -MStorable -e 'print $Storable::VERSION."\n"'
 
Old 11-24-2014, 06:43 PM   #3
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Mint, MX, antiX, SystemRescue
Posts: 2,337

Original Poster
Rep: Reputation: 358Reputation: 358Reputation: 358Reputation: 358
Thanks, but that doesn't help.

No doubt, with 800+ servers, I have different versions of PERL and different versions of Storable installed. However, whatever version of Storable is out there on a given server, it should be able to store() and retrieve() its own files. It is always the same version of Storable that is doing the store()-ing and retrieve()-ing on any given server.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
list perl module & install perl module DBD::mysql linson_85 Linux - Newbie 4 06-22-2009 11:42 AM
How to program the CGI module in Perl (newbie question) resetreset Programming 3 12-01-2008 03:08 AM
perl module installation question 2007fld Programming 5 07-20-2007 01:50 PM
Perl Module question stash1071 Programming 1 12-28-2006 12:44 PM
Problem with perl module for w3c validator to work on my local Apache+PHP+perl instal tbamt Linux - Software 0 12-16-2004 06:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration