Jump to content

p4 -G info gives wrong output

p4 p4 info python

  • Please log in to reply
4 replies to this topic

#1 amolode


    Advanced Member

  • Members
  • PipPipPip
  • 41 posts

Posted 23 May 2016 - 09:57 AM

In our company we use Coverity as a static analysis tool which get various info from our Perforce code base. In its queries Coverity uses p4 -G command with subsequent output parsing. And we have a problem with output of 'p4 -G info' command.
In my workspace I have .p4config file:

amolode@rome:~ >cat .p4config
amolode@rome:~ > p4 info

User name: amolode
Client name: amolode:mpls_main_dev
Client host: rome
Client root: /auto/nsd_emb/users/amolode/ccm_wa/mpls/main-dev/mpls_main_dev
Current directory: /auto/nsd_emb/users/amolode/ccm_wa/mpls/main-dev/mpls_main_dev
Peer address:
Client address:
Server address: jira.ecitele.com:1666
Server root: /user/local/perforce/server
Server date: 2016/05/23 12:47:14 +0300 IDT
Server uptime: 698:53:23
Server version: P4D/SOLARIS10X86_64/2013.3/876375 (2014/06/10)
Authorization server: jira:1999
Server license: jira:1999
Case Handling: sensitive
amolode@rome:~ >

But at the same place p4 -G info misses my username:

amolode@rome:~ >p4 -G info
{scodesstatuserNames *unknown*s
clientLocksnones clientCwds>/auto/nsd_emb/users/amolode/ccm_wa/mpls/main-dev/mpls_main_devs
serverDates2016/05/23 12:49:18 +0300 IDTs
serverVersions.P4D/SOLARIS10X86_64/2013.3/876375 (2014/06/10)sserverServicesstandards
serverLicenses  jira:1999s
  caseHandlings sensitive0amolode@rome:~ >

And this '*unknown*' causes  problems with the piped parsing ("Wildcards (*, %%x, ...) not allowed in '*unknown*' ").
The client p4 runs on ubuntu 12.04 Linux machine. The version is 2013.3.

amolode@rome:~ >p4 -V
Perforce - The Fast Software Configuration Management System.
Copyright 1995-2014 Perforce Software.  All rights reserved.
This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit (http://www.openssl.org/)
See 'p4 help legal' for full OpenSSL license information
Version of OpenSSL Libraries: OpenSSL 1.0.1g 7 Apr 2014
Rev. P4/LINUX26X86_64/2013.3/822226 (2014/04/08).
amolode@rome:~ >

How it can be fixed?

#2 Br.Bill



  • Members
  • PipPip
  • 21 posts

Posted 23 May 2016 - 07:34 PM

I know this is super basic, and I am just making sure this isn't a "whoops" problem.

In the environment in which this runs, is the environment variable "P4CONFIG" set?

#3 amolode


    Advanced Member

  • Members
  • PipPipPip
  • 41 posts

Posted 24 May 2016 - 10:58 AM

yes, P4CONFIG is set
amolode@rome:~ >echo $P4CONFIG
amolode@rome:~ >

#4 Gabor Maghera

Gabor Maghera

    Advanced Member

  • Sandbox Beta
  • PipPipPip
  • 192 posts
  • LocationElk Grove, CA

Posted 31 May 2016 - 02:59 PM

Can you run p4 set?  Although P4CONFIG is set, the .p4config file might not be found by the command, or it lacks the username.  P4 info without -G might just be returning your shell username (judging by your shell prompt).  It defaults to using that if a Perforce username is not set.  P4 set will tell you where the configuration value comes from.  I'm not sure why p4 -G info does not behave the same, but it's always a good idea to explicitly set the username.

#5 P4Giles


    Advanced Member

  • Staff Moderators
  • 22 posts

Posted 31 May 2016 - 03:21 PM

To pre-empt further discussion on this, the problem only occurs when an authorisation server is in use where the local Perforce instance does not have details of the user in its own database, therefore referring to the authorisation server.
A fix has been produced and released on to our FTP site today for 2015.2. Perforce Technical Support are in discussion with Amolode about this problem.

Also tagged with one or more of these keywords: p4, p4 info, python

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users