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.

swarm_error

Perforce password (P4PASSWD) invalid or unset

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

Solution:

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
Email: perforce.user@TechArkit.com
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:
9B89D59291C8DCABBA702A14F8377164

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

cat /opt/perforce/swarm/data/config.php
<?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' => '192.168.1.84:1666',
'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