Jump to content


mobileben's Content

There have been 3 items by mobileben (Search limited from 06-April 19)


By content type

See this member's

Sort by                Order  

#25097 Perforce Fingerprint Required dialog

Posted by mobileben on 19 July 2019 - 06:49 PM in P4V

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".

p4v-dialog.png



#24438 Perforce password (P4PASSWD) invalid or unset when using p4python

Posted by mobileben on 19 February 2019 - 04:49 AM in APIs

Joel, Thanks for approving. I did come across a couple of postings in the About the Forums section where a couple of people inquire about approval of postings (granted they are from early 2018).

I'm using Assembla to host Perforce, so I'd have to see what security setting they are using (when I try 'p4 configure show security' it states I don't have permissions for the operation).

I guess I'll work on the assumption that what I am doing is "correct" solely based on it works. Hopefully the documentation around this could be improved. It's pretty vague about this, although I read a SO posting where one person act replied indicated it was very clear, but I didn't see the clarity they stated existed. There are only 2 sections which refer to p4.password: "Logging into Perforce using ticket-based authentication" and "Changing your password". And in both cases they indicate password versus ticket as the value to set.

Anyways, thanks again for the approval and your help.



#24436 Perforce password (P4PASSWD) invalid or unset when using p4python

Posted by mobileben on 18 February 2019 - 05:55 AM in APIs

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