Perforce Public Knowledge Base - How to force users to upgrade their client software
× PRODUCTS SOLUTIONS CUSTOMERS LEARN SUPPORT
Downloads Blog Company Integrations Careers Contact Try Free
Menu Search
Perforce
Reset Search
 

 

Article

How to force users to upgrade their client software

« Go Back

Information

 
Problem

How can you force end users to upgrade their old Perforce client software?

Solution

Starting with the 2010.1 server release, the system counter minClient may be set to a release name or client protocol level which the server will enforce as a minimum Perforce client version to work with.  Another counter, minClientMessage may also be set to supply a message to users of Perforce client programs that are at a lower release level than minClient.  This message can tell users how to obtain newer client software.

Setting minClient and minClientMessage

Server version 2010.2 and later

With the 2010.2 and later versions of the Perforce Server, you use the p4 configure command to set minClient and minClientMessage. For example, using a release name for the minClient setting:

$ p4 configure set minClient=2008.2
$ p4 configure set minClientMessage="Please upgrade to 2008.2 or higher."

or alternatively using a client protocol level for the minClient setting:

$ p4 configure set minClient=64
$ p4 configure set minClientMessage="Please upgrade to 2008.2 or higher."

A server restart is not required when using p4 configure to set the values.

Please note, using 'p4 configure set' to set minClient is dynamic, so you cannot set it to a release newer than the version of the p4 client being used when calling p4 configure.
For example:

$ p4 -V
Perforce - The Fast Software Configuration Management System.
Copyright 1995-2009 Perforce Software.  All rights reserved.
Rev. P4/DARWIN80U/2009.2/228098 (2009/12/16).

$ p4 configure set minClient=2010.2
You may not set minClient to a release newer than your client.

Server version 2010.1

With Perforce Server 2010.1, you use the p4 counter command to set minClient and minClientMessage. For example, to disallow Perforce clients older than 2008.2 and provide a message about upgrading, using a release name for the minClient setting:

$ p4 counter -f minClient 2008.2
$ p4 counter -f minClientMessage "Please upgrade to 2008.2 or higher."

Alternatively, you can do the same using a client protocol level for the minClient setting:

$ p4 counter -f minClient 64
$ p4 counter -f minClientMessage "Please upgrade to 2008.2 or higher."

The server must be restarted after changing these counters for the changes to take affect.

Client Behavior

Once a minClient setting is in place, clients not a the minimum version will now receive a message:

$ p4 files //depot/path/...
Client is too old to use this server.  Please upgrade to 2008.2 or higher.

If minClientMessage is not set, the default message is displayed.

$ p4 files //depot/path/...
Client is too old to use this server.

When the p4 info command is run, the user of an older Perforce client program will see an additional line as part of the output:

$ p4 info
...
Minimum Client Level: 2008.2: 64

 

Server releases prior to 2010.1

One way to implement this behavior in an older Perforce Server release is to deploy a command handler using Perforce Broker and to configure it to reject all commands coming from old client software.  With a Perforce Broker installed, add a command handler as follows:

1.  Add to your broker configuration (broker.conf) with this command handler:

 

command: *
{
    action  = filter;
    execute = "/path/to/check_client.pl";
}


2.  Add the filter program 'check_client.pl' (as stated in the above configuration) to your path.

#!/usr/bin/perl

my $debug  = 1;
my $hash = ();

open(F,">/path/to/logs/check_client.out") if $debug;

while (defined(my $line = <STDIN>)) {
    chomp($line);
    my ($key, $val) = split(":",$line);
    $hash{$key} = $val;
}

if ($hash{clientProtocol} > 63 ) {
    print F "$hash{user}:$hash{clientVersion}:PASS\n" if $debug;
    print "action:PASS";
} else {
    print F "$hash{user}:$hash{clientVersion}:REJECT\n" if $debug;
    print "action:REJECT";
    print "\n";
    print "message: Commands rejected because client software is older than 2008.2 ";
}    

close(F) if $debug;

exit(0);

 

Notes

  • All commands running with a client protocol that is 63 (2008.1) or older will be rejected.
  • You can learn more about client protocol and the corresponding client release in the article Helix Client Protocol Levels.
  • With debug=1 enabled, you can find out a list of all offending and conforming user / client in the debug log file.
  • As an idea, you can change the logic to allow for a grace period that passes all commands with a warning message. After a certain date, you change the logic to reject all commands.
     
Related Links

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255