[p4perl] Problem Running P4Perl Based Triggers After LinuxSystemUpdate

Scott Lavender Scott.Lavender at visiprise.com
Fri May 9 05:48:42 PDT 2008


So, I will be upgrading our server to 2007.3 in the next few days. But,
in the interim, I went ahead and built and installed the 2007.3 P4Perl.
I'm having no errors, but maybe a misunderstanding on how to get a list
of all jobs in the system. Here is what I tried:

#* p4test.pl - a short test of the P4 client interface
use P4;
print P4::Identify();

# Initialisation
my $p4 = new P4;
$p4->SetApiLevel( 61 ); # Set to 2007.2 until the server upgrade
$p4->Connect or die ( "Failed to connect to Perforce Server" );

# Try getting list of all Jobs
my $jobs = $p4->RunJobs();
if ( $#jobs >= 0 )
    foreach $job ( @jobs )
        print "$job\n";
    print "There are no jobs...\n";
The output from this is as follows:

Perforce - The Fast Software Configuration Management System.
Copyright 1995-2008 Perforce Software.  All rights reserved.
Rev. P4PERL/LINUX26I386/2007.3/151416 (2007.3 API) (2008/04/09).
There are no jobs...

>From the command line, I get the entire list of Jobs. When the script
runs it takes a while to run, which I assume is when the 'p4 jobs'
command is running. But, it returns nothing. Is this a valid approach to
getting a list like this?


-----Original Message-----
From: p4perl-bounces at perforce.com [mailto:p4perl-bounces at perforce.com]
On Behalf Of Scott Lavender
Sent: Thursday, May 08, 2008 10:01 AM
To: Tony Smith; p4perl at perforce.com
Cc: Nate Harney
Subject: Re: [p4perl] Problem Running P4Perl Based Triggers After

Thanks Tony!

I think we will go with scenario #1. I've wanted to do that anyway.
Since we have three proxy servers around the globe, how does this
sequence sound?

  - Upgrade proxy servers.
  - Run backup.
  - Upgrade main server.
  - Install new P4Perl ( Is this done the same way as before, by
building against the API? )

Thanks again.....Scott...

-----Original Message-----
From: Tony Smith [mailto:tony at smee.org] 
Sent: Thursday, May 08, 2008 9:18 AM
To: p4perl at perforce.com
Cc: Scott Lavender; Nate Harney
Subject: Re: [p4perl] Problem Running P4Perl Based Triggers After Linux


> We are using 2007.2, and have been since it came out. The only thing
> that changed in this system was the Linux updates. I have not upgraded
> to 2007.3 yet. I was planning to do so in the next month or so.
> The weird thing is that I can do any Perforce command successfully
> the command line or 'p4v' on this machine. It's just when I use P4Perl
> that I have these issues. Is there something in the Linux patches that
> could be causing this problem? I have recreated the ticket already,
> after this problem started.

The issue is that you're using P4Perl built with the 2005.2 API. So it's

effectively a 2005.2 client. The 2007.2 P4 you're using stores tickets
in the 
tickets file differently, so if you run a 'p4 login' using your 2007.2
the 2005.2 P4Perl won't find the ticket and will give you a P4PASSWD

There are really three solutions:

1. Upgrade your P4Perl to the official 2007.3 release from Perforce, and
with the 2007.3 API

2. Upgrade your P4Perl to the latest Public Depot P4Perl build (3.6001),
build it with the 2007.2 API

3. Run a 'p4 login' from within a P4Perl script to get a ticket stored
in the 
way P4Perl expects it to be stored.

I'd suggest #1 is better as Public Depot P4Perl is deprecated in favour
Perforce P4Perl.



p4perl mailing list
p4perl at perforce.com

More information about the p4perl mailing list