Dec 13, 2013

How to check whats running in the perforce server or How to monitor perforce server

Like the 'top' command in Linux which helps us to see what process and commands are running in the system, perforce has 'monitor' command to list the operations running in its system.

It lists the users and their commands currently running in the perforce server

Example -

mohan@vmlinux/cygdrive/c/p4_mohan/user_informatio
5.0/output
# p4 monitor show
 7097 R mohan    00:00:00 monitor
 7098 R rama       00:00:00 labels
 7099 R arus    00:00:00 spec
28435 R perforce   00:30:31 verify

Could not connect to perforce. error 'It is possible that someone is intercepting your connection to the Perforce P4PORT '10.31.64.101:1888''

Error Message:

[mohan@spl ~]$ p4 info
******* WARNING P4PORT IDENTIFICATION HAS CHANGED! *******
It is possible that someone is intercepting your connection
to the Perforce P4PORT '10.11.64.101:1888'
If this is not a scheduled key change, then you should contact
your Perforce administrator.
The fingerprint for the mismatched key sent to your client is8A:BE:F1:B9:DC:E3:50:D1:16:D6:6D:66:BB:AE:0B:26:86:C0:60:DC
To allow connection use the 'p4 trust' command.


Reason:
This happens due to environmental changes like change of ip or mac address etc. It makes the established and stored fingerprint to mismatch. So you have to reestablish the 'trust' with the server again. so we will not be able to run any command.

You have to do this by issuing 'p4 trust -f'

[build@splash ~]$ p4 trust -f
******* WARNING P4PORT IDENTIFICATION HAS CHANGED! *******
It is possible that someone is intercepting your connection
to the Perforce P4PORT '10.11.64.101:1888'
If this is not a scheduled key change, then you should contact
your Perforce administrator.
The fingerprint for the mismatched key sent to your client is8A:BE:F1:B9:DC:E3:50:D1:16:D6:6D:66:BB:AE:0B:26:86:C0:60:DC
Are you sure you want to establish trust (yes/no)? yes
Added trust for P4PORT 'ssl:p4pserver.cmp.com:1888' (10.11.64.101:1888)


Now you can try some p4 commands to verify.

how can I find out the "source" changelist of the newly created branch in perforce?

To see details on source of branch integrated in perforce

After branching from base branch to a new branch, can we find the changelist at which the branch is created from source branch?

You can find it by using the below command with the new branch ( the child branch for whom you are interested to see the history)

p4 changes -i  //depot/child_branch


This will list  the  changes of this branch followed by the changes happened in its parent branch. By describing the changes you can get the particular parent branch name.

Syntax for p4 describe

p4 describe <changelist number>

example-
$ p4 describe 1129671
Change 7129671 by ravis1@project on 2010/06/29 06:51:50

        starting tomcat using "start startup.bat" command

Affected files ...

... //dev/env/atia/eventrepository/install/install.bat#11 edit
... //dev/env/atia/eventrepository/readme.txt#6 edit

Nov 30, 2013

How to fix Perforce error "Can't clobber writable file"

Perforce throwing below error while trying to remove folder from workspace

Error:
 Can't clobber writable file C:\thiagu\Perforce\thiagu_p4server.net_1333\dev-app\Application.Properties

Solution:
when you try to sync a file, perforce expects your files in workspace will have read-only permissions. But if a file is not checkout,(by p4 edit)but has write permission then it will throw the above error. Changing the file to read-only and syncing again will solve the issue. or try removing the workspace and get the latest revision again

Jul 29, 2013

WSAECONNREFUSED (10061) - Connection refused.

Problem:
Connect to server failed; check $P4PORT.
connect: 10.31.64.101:1888: WSAECONNREFUSED

Cause & Solution: 

This problem occurs when you are trying to connect to a server which is not running. May be the network in-between lost, or perforce must  be down due to some reason etc.

check whether the port is running  and  restart perforce server if needed

[root@p4proxyserver4 ~]# netstat -na | grep 1444
tcp        0      0 10.27.60.103:1444           0.0.0.0:*                   LISTEN


In my case it happened that the proxy server which i was trying to connect, could not connect to the main server  which is recently restarted.  So once i restarted the proxy server, i was able to connect to the proxy perforce server fine.

For detailed and related information refer below URL
http://answers.perforce.com/articles/KB_Article/Common-Windows-Server-Network-Errors

Jul 11, 2013

How to abort shutdown scheduled in windows

You may know that we can schedule a shutdown or hibernate after some time by

shutdown /s /t 3600

In case if you want to cancel it,  you can do that by below command,

shutdown /a


For your reference, the complete help details of shutdown command listed below,


C:\Users\mohan>shutdown /?
Usage: shutdown [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f]
    [/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]]

    No args    Display help. This is the same as typing /?.
    /?         Display help. This is the same as not typing any options.
    /i         Display the graphical user interface (GUI).
               This must be the first option.
    /l         Log off. This cannot be used with /m or /d options.
    /s         Shutdown the computer.
    /r         Shutdown and restart the computer.
    /g         Shutdown and restart the computer. After the system is
               rebooted, restart any registered applications.
    /a         Abort a system shutdown.
               This can only be used during the time-out period.
    /p         Turn off the local computer with no time-out or warning.
               Can be used with /d and /f options.
    /h         Hibernate the local computer.
               Can be used with the /f option.
    /e         Document the reason for an unexpected shutdown of a computer.
    /m \\computer Specify the target computer.
    /t xxx     Set the time-out period before shutdown to xxx seconds.
               The valid range is 0-315360000 (10 years), with a default of 30.
               If the timeout period is greater than 0, the /f parameter is
               implied.
    /c "comment" Comment on the reason for the restart or shutdown.
               Maximum of 512 characters allowed.
    /f         Force running applications to close without forewarning users.
               The /f parameter is implied when a value greater than 0 is
               specified for the /t parameter.
    /d [p|u:]xx:yy  Provide the reason for the restart or shutdown.
               p indicates that the restart or shutdown is planned.
               u indicates that the reason is user defined.
               If neither p nor u is specified the restart or shutdown is
               unplanned.
               xx is the major reason number (positive integer less than 256).
               yy is the minor reason number (positive integer less than 65536).

Reasons on this computer:
(E = Expected U = Unexpected P = planned, C = customer defined)
Type    Major   Minor   Title

 U      0       0       Other (Unplanned)
E       0       0       Other (Unplanned)
E P     0       0       Other (Planned)
 U      0       5       Other Failure: System Unresponsive
E       1       1       Hardware: Maintenance (Unplanned)
E P     1       1       Hardware: Maintenance (Planned)
E       1       2       Hardware: Installation (Unplanned)
E P     1       2       Hardware: Installation (Planned)
E       2       2       Operating System: Recovery (Planned)
E P     2       2       Operating System: Recovery (Planned)
  P     2       3       Operating System: Upgrade (Planned)
E       2       4       Operating System: Reconfiguration (Unplanned)
E P     2       4       Operating System: Reconfiguration (Planned)
  P     2       16      Operating System: Service pack (Planned)
        2       17      Operating System: Hot fix (Unplanned)
  P     2       17      Operating System: Hot fix (Planned)
        2       18      Operating System: Security fix (Unplanned)
  P     2       18      Operating System: Security fix (Planned)
E       4       1       Application: Maintenance (Unplanned)
E P     4       1       Application: Maintenance (Planned)
E P     4       2       Application: Installation (Planned)
E       4       5       Application: Unresponsive
E       4       6       Application: Unstable
 U      5       15      System Failure: Stop error
 U      5       19      Security issue
E       5       19      Security issue
E P     5       19      Security issue
E       5       20      Loss of network connectivity (Unplanned)
 U      6       11      Power Failure: Cord Unplugged
 U      6       12      Power Failure: Environment
  P     7       0       Legacy API shutdown

Apr 17, 2013

error C4335: Mac file format detected: please convert the source file to either DOS or UNIX format

Problem:
error C4335: Mac file format detected: please convert the source file to either DOS or UNIX format

Solution:
if you are compiling in cygwin or unix\linux you can apply dos2uinx on files to remove this issue.


mohan@MOHANTL1C ~
$ dos2unix.exe test.txt
dos2unix: converting file test.txt to Unix format ...