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
: change P4PORT and P4USER to the correct address and username.2. Check P4D can contact the Swarm machine.
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:
4. Ensure that 'curl' or 'wget' is installed on the Helix Server machine.
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:
The response should display that there are 3 or more 'workers'. For example:
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':
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
: 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.
9. Ensure that all the directories under the 'data' folder in the Swarm install directory are owned by the user running apache.
- modify curl/wget requests in the trigger script to ignore insecure certificates (for example add '--insecure' for curl).
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:
11. If test fails contact 'email@example.com':
- 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
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