Perforce password (P4PASSWD) invalid or unset | Arkit

Issue: Unable to Open a swarm web page, after migrating the swarm application to a new IP address.  Swarm has detected an error Please investigate the below PHP error: Command failed: Perforce password (P4PASSWD) invalid or unset. /opt/perforce/swarm/library/P4/Connection/AbstractConnection.php on line 1153 error message.


Perforce password (P4PASSWD) invalid or unset

Root Cause:  Swarm application is unable to reach to perforce server and unable to query P4PORT


Check-in Perforce server, Open a Command prompt and check below things

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

U:\>p4 -ztag info

U:\>p4 user -o swarmuser
User: swarmuser
Update: 2016/09/30 02:02:03
Access: 2021/05/24 01:00:01
FullName: swarmuser
Password: ******

U:\>p4 -u swarmuser login -a
Enter password:
User swarmuser logged in.

U:\>p4 -u swarmuser login -ap
Enter password:

Check-in Swarm application server and update the correct token value in config.php file

cat /opt/perforce/swarm/data/config.php
/* WARNING: The contents of this file is cached by Swarm. Changes to
* it will not be picked up until the cached versions are removed.
* See the documentation on the 'Swarm config cache'.
return array(
'environment' => array(
'hostname' => 'swarm-server',
'p4' => array(
'port' => '',
'user' => 'swarmuser',
'password' => '9B89D59291C8DCABBA702A14F8377164',
'auto_register_url' => false,

Now delete cache from Swarm server

cd /opt/perforce/swarm/data/
rm -rf cache

Restart apache server

service apache2 restart

Few more commands to check the status from the Swarm application. below command works then token is working fine.

/opt/perforce/bin/p4 -u swarmuser -p perforce-server:1666 -P 9B89D59291C8DCABBA702A14F8377164 login -s
User SwarmAdmin ticket expires in 146009 hours 54 minutes.

Another way to generate a new token value as below

1. login the swarm user
/opt/perforce/bin/p4 -p perforce-server:1666 -u swarmuser login -a

2. get the user’s ticket
/opt/perforce/bin/p4 -p perforce-server:1666 -u swarmuser login -ap

3. Clear the cache
curl -u “swarmuser:ticket-value” -X DELETE “https://myswarm.url/api/v9/cache/config/”
# substitute ticket-value with the output from step 2

That’s it. it will resolve the issue.

Related Articles

p4search installation

Best code review softwares

Thanks for your wonderful Support and Encouragement

Ravi Kumar Ankam

My Name is ARK. Expert in grasping any new technology, Interested in Sharing the knowledge. Learn more & Earn More

Leave a Reply

Your email address will not be published. Required fields are marked *