Validate your P4 Code Review installation
When P4 Code Review starts for the first time it verifies the Redis cache. During this verification you cannot log in to P4 Code Review. The time required to verify the Redis cache depends on the number of users, groups, and projects present in P4 Code Review.
With P4 Code Review is fully installed, check the P4 Code Review installation is working correctly. To check the installation, follow these steps:
- Create a new changelist that:
- Contains at least one modified file
- Contains the #review keyword in the changelist description
- Right click on the new changelist in P4V and click Shelve Files...
- Check that a new review is created for the changelist.
- If a review is created, the P4 Server extension is working. If you are using P4 Code Review triggers instead of the P4 Server extension and the review is created, the triggers are working.
- If a review is not created, see Troubleshooting: Review not created.
Do not select Request New Review... because this method uses the API and will not fully test the P4 Server extension.
This is also true if you are using P4 Code Review triggers instead of the P4 Server extension.
P4 Code Review is now installed and ready to use. For more information on the next steps, see Quickstart.
Troubleshooting: Azure Application Gateway issues with P4 Code Review and P4V
When running P4 Code Review behind an Azure Application Gateway (such as when using a load balancer with P4V), you may encounter authentication issues due to missing client IP information.
To resolve this, you need to configure the Azure Application Gateway to include an X-Forwarded-For header. Specifically, add a rewrite rule to insert or preserve the X-Forwarded-For header so that P4 Code Review can correctly identify the original client IP address. This can only be done by the Azure administrator managing your environment. It is not performed by P4 Remote Administration.
For more information, see Configuring Azure Application Gateway for accessing Kibana.
Troubleshooting: Review not created
If you are using the P4 Server extension
If a new review is not created when you validate your installation, your P4 Server extension is probably not working correctly on the P4 Server.
Option 1: Check the P4 Server extension is working
To check that the P4 Server extension is working, run the following command on your P4 Server:
p4 extension --run swarm ping
Example success message:
OK
Example failure message:
BAD (Cannot reach https://swarm-example.com/)
For information about extension on your P4 Server, see the P4 Server Administration Documentation.
Option 2: Check installed versions
To check your P4 Code Review version and your P4 Server extension version, run the following command on your P4 Server:
p4 extension --run swarm version
Example response:
Swarm Version: SWARM/2022.1/2226999 (2022/03/20) Extension Version: 2022.1.20221215
If you are using P4 Code Review triggers
If a new review is not created when you validate your installation, your P4 Code Review triggers are probably not installed correctly on the P4 Server. For instructions on how to install the P4 Code Review triggers on your P4 Server, see Installing triggers.
Troubleshooting: Review cannot be updated using triggers
It is unlikely reviews cannot be updated using triggers, but it can happen if your P4 Code Review server is configured for SSL.
Cause of this issue
The swarm-trigger.pl script uses the Perl HTTP::Tiny module for HTTP requests when the module is available. In certain environments, HTTP::Tiny may encounter issues related to SSL/TLS certificate validation, which can result in a HTTP 599 error.
The HTTP::Tiny module requires two other Perl modules to work properly with HTTPS. These modules are:
-
IO::Socket::SSL
(version 1.42 or higher) -
Net::SSLeay
(version 1.49 or higher)
If these modules are missing or out of date, you may encounter a HTTP 599 error.
To verify if this is the cause of the issue, review the operating system log of your P4 Server for any error messages logged by swarm-trigger.pl. Depending on which operating system you are using, find the system logs in the following locations:
-
For Windows operating systems, find the system logs using Event Viewer.
-
For Linux operating systems, find the system logs in the following locations:
- For Ubuntu or Debian operating systems, look in /var/log/syslog.
- For Red Hat operating systems, look in /var/log/messages.
The error message logged by swarm-trigger.pl starts with the following text: Error: (599/Internal Exception) (probably invalid SSL certificate) ......
Workaround for issue
If you see the 599 error, there are two available fixes:
-
Fix 1: Edit the P4 Code Review trigger script file on the P4 Server so that it uses Curl instead of HTTP::Tiny.
-
Fix 2: Install the required Perl modules. This fixes
HTTP::Tiny
so it can work as intended.
Fix 1: Modify the trigger script to use Curl:
There are two lines in the swarm-trigger.pl
script that enable the use of HTTP::Tiny
. Modify these two lines so the script reverts to using Curl:
- In the
swarm-trigger.pl
, find the following line: - Add ! to $HAVE_TINY. The new line should look like the following:
- Save the trigger script file.
if ($HAVE_TINY) {
if (!$HAVE_TINY) {
Fix 2: Install the required Perl modules:
-
Run the following script to check if the required modules are installed or are using an outdated version
Copyuse HTTP::Tiny;
my $response = HTTP::Tiny->new->get('<instance_URL>');
print $response->{content} if length $response->{content};
die "Failed!\n" unless $response->{success};Replace
<instance_URL>
with the URL to your P4 Code Review instance. -
If these modules are missing or outdated, you will see the following output.
CopyIO::Socket::SSL 1.42 must be installed for https support
Net::SSLeay 1.49 must be installed for https support -
To install these two modules on your P4 Server ,use the appropriate method for your OS and Perl installation, for example using Perl's CPAN module on the command line.