Perforce Public Knowledge Base - Debugging empty Swarm feeds
Perforce Software logo
Reset Search
 

 

Article

Debugging empty Swarm feeds

« Go Back

Information

 
Problem
When I open a Swarm project the 'Reviews', 'Commits' and 'Jobs' feeds are empty when I know there has been activity for this project after it was created.
Solution
The project feed data is stored as keys in the Perforce server. The Helix server notifies Swarm that there is data to be added to the feed using triggers which make calls to Swarm using 'curl' on the Helix server. Note that 'curl' is not installed on Windows by default.

The following troubleshooting steps can be taken to make sure the triggers are working correctly:

1. Check that your Swarm machine can contact the Perforce Server.
 
p4 -p P4PORT -uP4USER info
NOTE: change P4PORT and P4USER to the correct address and username.

2. Check P4D can contact the Swarm machine.
ping SWARM-HOSTNAME
ping SWARM-IP-ADDRESS

3. Check the Swarm triggers on the Perforce Server are the same version as your Swarm instance.

The triggers version string can be found at the top of most trigger scripts. The Swarm version string can be found using the URL:
http://SWARM-IP-ADRESS/about

4. Ensure that 'curl' or 'wget' is installed on the Helix Server machine.
curl -V
wget -V

5. Ensure the workers are being started.
sudo service apache restart   # Restart Apache on the Swarm server

Wait 60 second to a few minutes then check the queue status:
http://SWARM-IP-ADRESS/queue/status

The response should display that there are 3 or more 'workers'. For example:
{"tasks":0,"futureTasks":1,"workers":3,"maxWorkers":3,"workerLifetime":"595s"}

6. Ensure the Swarm token from the swarm page is in the trigger script on the Perforce Server.

Log into Swarm as a suoer user and go the the Following URL to find the 'Trigger Token':
http://SWARM-IP-ADRESS/about

Copy the token and paste into the trigger script or trigger script configuration file depending on what you're using.

7. Ensure the trigger is executable by the user running the Helix P4D process.

8. Ensure the trigger entries are correct.

To display what the trigger entries should be run:
perl swarm-trigger.pl -c swarm-trigger.conf -o

Note1: If using Windows check that the paths output by the above command are correct and are in Windows path format using '/' for path seperators.

Note2: If your Swarm server is running under HTTPS you will need to either
- install the certificates on the Perforce server OS so that curl/wget can use them by default.
- modify curl/wget requests in the trigger script to use the specific certificate.
- modify curl/wget requests in the trigger script to ignore insecure certificates (for example add '--insecure' for curl).

9. Ensure that all the directories under the 'data' folder in the Swarm install directory  are owned by the user running apache.

For example on Ubuntu if Swarm is installed to default location and Apache runs as 'www-data':
chown -R www-data:www-data /opt/perforce/swarm/data

10. Test your setup

Use the following simple test to create a pre-commit review via the triggers:
 
  • run 'tail -f on the Swarm log file' (by default under the 'data' folder of the Swarm install).
  • open and edit a file that is in one of the project branches.
  • create a review by shelving the edited file using 'p4 shelve' and putting the text '#review' in the description.
  • check the feed to see if a review has been created. For example
 
Example of review appearing in Project1 feed.

11. If test fails contact 'support@perforce.com':

If the above does not solve the problem increase the logging level in Swarm to '7' then collect the following data and send it to Perforce support:
  • the Swarm log file (by default under '/opt/perforce/swarm/data/log').
  • output from 'p4 -Ztag info'
  • output from 'p4 spec -o change' (customised change specs are not supported).
  • output from 'p4 keys -e "swarm*" | grep CHANGELIST-NUMBER    (using CL from test 10).
  • Swarm version
Related Links

Feedback

 

Was this article helpful?


   

Feedback

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

Characters Remaining: 255