Jump to content


mobileben

Member Since 18 Feb 2019
Offline Last Active Jul 26 2019 08:08 PM
-----

Topics I've Started

Perforce Fingerprint Required dialog

19 July 2019 - 06:49 PM

This is a minor bug to report. Not sure where to report it. I've tried to report bugs directly to Perforce but they cite as I'm not a paying customer they won't accept the bug report and to post here.

In either case, I recently purged a bunch of keys/cleaned up my KnownHosts  from my .ssh folder. And as expected, the next time I logged in the P4V, I got a warning about fingerprints. I've attached an image of it. This is version 2018 August 06 Rev. P4V/MACOSX1013X86_64/2018.2/1687764

My complaint on it is it makes it look like it's a hack/fake.

"The fingerprint send by the server" should be "The fingerprint sent by the server".

I realize it sound picayune, but given this is Perforce, one would hope parts like this don't make it look like the app has been compromised.

It would also be nice in this case for the warning to change. At this point, there was never an associated fingerprint since I deleted it from the KnownHosts files. The message is slightly misleading by indicating "does not match the fingerprint you previously trusted".

Attached File  p4v-dialog.png   147.65K   14 downloads

Perforce password (P4PASSWD) invalid or unset when using p4python

18 February 2019 - 05:55 AM

I'm using p4python for an automated build script. This script builds art assets, so it is a long running process (it can take 6-12 hours overall). As it processes artwork, it will either add or edit files with in Perforce. And in the end it will submit the CL. Given the overall duration of the process, the 12 hour ticket has been known to expire. Currently this is running on my machine, but I plan on migrating it to Jenkins soon. I getting ready for this transition, I added support to login if the ticket has expired. I've encountered some odd behavior.

The documentation around this as well as other people with similar issues doesn't seem to correspond to what I'm seeing.

I should note that prior to adjusting the script to login, I was manually logging into Perforce either through a bash shell or p4v (I'm on a Mac) prior to running the script. Usually it can finish in time, but I have encountered times when it has not.

My first pass was to setup the password in the P4 object as follows.

p4.host = p4_config.host
p4.port = p4_config.port
p4.user = p4_config.user
if p4_config.password:
    p4.password = p4_config.password
p4.client = p4_config.client

p4.connect()


and then later call p4.run_login()

What I determined was that this would log me in, however any other subsequent Perforce call within the Python script would result in:

[Error]: 'Perforce password (PASSWD) invalid or unset'

For example, even this would cause the problem.
results = p4.run_login('-s')

Note that from my shell, I could execute any p4 command I wanted, because I was logged in. And if I relaunched the script, the problem would still occur. When a re-ran the script, it is not logging into Perforce (ie. calling run_login). but it is still populating p4.password. This seems like this source of the problem.

What I have discovered was that the safer approach seems to be to never populate p4.password

p4.host = p4_config.host
p4.port = p4_config.port
p4.user = p4_config.user
#if p4_config.password:
#    p4.password = p4_config.password
p4.client = p4_config.client

p4.connect()


and to call run_login explicitly with the password like the following:

results = p4.run_login(password=p4_config.password)


Then it works no problem. I can force logout while the script is running and it can recover properly.

Is this the expected behavior? The documentation provided (https://www.perforce...rogramming.html) really doesn't do a very good job in documenting logging in. I get that it is "simple" in theory. But if you google logging into Perforce via p4python you do actually find a few questions  ... most of which have no real/definitive answer.

As an FYI, I'm using Python 3.7 and version 2018.2.1743033 of p4python