[p4perl] Trigger Script Issue

Scott Lavender Scott.Lavender at visiprise.com
Tue Sep 2 07:21:44 PDT 2008


Got it! All I has to do was add the following after load the
credentials:

    $p4->SetUser( $userName );
    $p4->SetPassword( $password );

Sorry for the trouble... 

-----Original Message-----
From: Scott Lavender 
Sent: Tuesday, September 02, 2008 10:04 AM
To: Scott Lavender; 'G Barthelemy'
Cc: 'p4perl at perforce.com'
Subject: RE: [p4perl] Trigger Script Issue

Actually, I have never used the user and password for this subroutine. I
have only needed to use them when executing the 'p4' and 'p4d' commands:

    our $p4cmd = "/usr/local/bin/p4 -u $p4user -P $p4ticket";
    our $p4dcmd = "/usr/local/bin/p4d -r $p4root";

Maybe that is the difference. It could be that they are now required.
How would I graph them into this call to FetchJob?

-----Original Message-----
From: Scott Lavender 
Sent: Tuesday, September 02, 2008 9:58 AM
To: 'G Barthelemy'
Cc: 'p4perl at perforce.com'
Subject: RE: [p4perl] Trigger Script Issue

The user is being passed in for reporting purposes only. The trigger
script reads the credentials(username/ticket) from a file:

userCredentials.txt
# Perforce username of superuser used to execute trigger scripts
username=build
# Perforce ticket to validate login of above username
ticket=B740A553FDFAAE9A3C85DFD19485DE5F

I have verified that this is the current ticket:

[root at perforce test]# p4 tickets
192.168.1.61:1666 (build) B740A553FDFAAE9A3C85DFD19485DE5F

Anything else that might be causing this?


-----Original Message-----
From: G Barthelemy [mailto:gb.perforce at googlemail.com] 
Sent: Tuesday, September 02, 2008 9:51 AM
To: Scott Lavender
Cc: p4perl at perforce.com
Subject: Re: [p4perl] Trigger Script Issue

2008/9/2 Scott Lavender <Scott.Lavender at visiprise.com>:
> I have a problem with part of my trigger script. It runs fine from the
> command line, but fails for some unknown reason when run by the server
by a
> trigger event. I have a trigger associated with submits to verify that
the
> user has associated a valid job/incident. This has worked in the
past(2006.1
> - 7003.2), but has not worked since moving to 2007.3.

Whenever I experienced issues with a script running from command line
but failing in trigger context, it turned out to be authentication
related.

For example, I see that you are passing %user% to the trigger script.
Why ? Are you setting that user for subsequent API calls (i.e.
$p4->SetUser()) ? In which case, could this be an authentication issue
(i.e. the user doesn't have a running ticket on the server host where
the trigger is running from) ?

-- 
Guillaume




More information about the p4perl mailing list