Perforce password (P4PASSWD) invalid or unset on JIRA Fisheye plugin
症状
When setting Perforce Jobs integration with the JIRA Fisheye plugin, an error comes to the Perforce Job Integration menu.
atlassian-jira.log
に次のメッセージが表示される。
2013-11-07 10:45:30,649 http-bio-8080-exec-3 ERROR username 645x18395x1 anw7p 127.0.0.1 /secure/admin/EditPerforceConfig.jspa [web.admin.perforce.EditPerforceConfiguration] There was a problem connecting to your Perforce server
com.perforce.api.CommitException
at com.perforce.api.Job.commit(Job.java:365)
at com.atlassian.jirafisheyeplugin.perforce.PerforceManagerImpl.testConnection(PerforceManagerImpl.java:312)
at com.atlassian.jirafisheyeplugin.web.admin.perforce.EditPerforceConfiguration.doExecute(EditPerforceConfiguration.java:107)
at webwork.action.ActionSupport.execute(ActionSupport.java:165)
at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:87) <+7> (DefaultInterceptorChain.java:39)
...
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: error: Perforce password (P4PASSWD) invalid or unset.
at com.perforce.api.P4Process.closeProcess(P4Process.java:587)
at com.perforce.api.Job.commit(Job.java:361)
... 174 more
原因
The JIRA Fisheye Plugin uses either the P4PASSWD variable or the -P command line option to pass the password to p4.exe. When an external authentication trigger is used in Perforce (such as CROWD), passwords can not be passed on the command line as plain text or stored in P4PASSWD, so the JIRA Fisheye Plugin cannot log in.
回避策
The only way around this is by generating a ticket (using the -p option as explained here: p4 login) and using it in place of the password in the JIRA Fisheye Plugin.
Example of creating a ticket:
$ ./p4 -p 127.0.0.1:1666 -u admin login -a
Enter password:
User admin logged in.
$ ./p4 -p 127.0.0.1:1666 tickets
127.0.0.1:1666 (admin) C6ECBBDF9439F5F76B91BD24191086F1
The P4USER is admin and P4PASSWD C6ECBBDF9439F5F76B91BD24191086F1