JIRA - Perforce Integration.

vivekbharathi Jothimani June 29, 2016

I am trying to integrate, JIRA Task with Perforce Jobs, constantly getting error saying that 

Problem connecting to Perforce: 
com.perforce.api.CommitException java.io.IOException: Perforce client error: Connect to server failed; check $P4PORT. TCP connect to url:1666 failed. No such host is known.


I am using evaluation license in JIRA, hosted locally. Need help, if any one has resolved this issue

Thanks in Advance.


1 answer

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 29, 2016

That's simple - your JIRA service is running on a machine that does not have access to, or cannot resolve the name for, your perforce server.

Can you run a perforce client, or even just "p4 info" on the JIRA machine and see if that can reach it.  I suspect it won't, and you'll need to work out why and fix that.

vivekbharathi Jothimani June 30, 2016

Thanks for your response. I tried running "p4 info", I can reach to it. I have Perforce Client and Perforce Server running locally. I am still getting the error saying that

com.perforce.api.CommitException java.io.IOException: Perforce client error: Connect to server failed; check $P4PORT. TCP connect to localhost:1666 failed. No such host is known.

Can you please help?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 30, 2016

Can you check what "p4 info" returns when you run it on the JIRA Server as I asked before?

vivekbharathi Jothimani July 1, 2016

When I run P4 info in JIRA Server, I got a response which has username, client host, client address and other fields which we normally get when I run p4 info in command prompt.

Miles Duke March 27, 2017

I am having a similar problem.  The Legacy P4 plugin worked fine on Linux (with a very old version of P4), but it would not work on a Windows server machine.

I could ping the hostname to my heart's content, and p4 info worked as expected – running as my user, running as admin, or running as jirauser (a local Windows account).

Yet, the Legacy P4 job creation always failed – I tried several versions of 32 and 64-bit p4.exe – I also tried hostname, FQDN version of hostname, and IP address of hostname.  I always included :1666 in the specification of the port – the "TCP connect failed" message would not always include the port number (depending upon which version of the p4 client I used).

Most of the time, I get the "no such host" message.  With some older versions of the p4 client, particularly when using ip.ad.dr.ess:1666, I got a slightly different message (actual IP address masked)

Caused by: java.io.IOException: Perforce client error:
    Connect to server failed; check $P4PORT.
    TCP connect to www.xxx.yyy.zzz:1666 failed.
    socket: www.xxx.yyy.zzz:1666: WSAEPROVIDERFAILEDINIT

I've adjusted the timeout (and the "p4.threshold" in the perforce-jira-plugin.properties), to no avail either.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 27, 2017

The p4info tells you that it can connect, and hence rules out a number of problems, but that's a short and simple connection.  You always need to run it.

In the original question, that was simple - the network was not allowing JIRA to reach the Perforce server, but you have a more complex problem - the server is killing the connection after it's been established and some data has been exchanged.

It probably remains a networking error, but start at http://answers.perforce.com/articles/KB/2968

vivekbharathi Jothimani March 28, 2017

Just curious to know, do you have a P4 installed on the JIRA box

Miles Duke March 28, 2017

No.  Perforce was always running on its own Linux server.  When the JIRA server starts (on Windows Server 2016), I get the following message:

2017-03-16 17:31:24,084 JIRA-Bootstrap ERROR      [c.a.jirafisheyeplugin.perforce.PerforceConfigImpl] Failed to resolve p4 server from alias: myp4server.mydomain.com:1666

Then, when I create jobs, most of the time I get the exact same message you get:

Caused by: java.io.IOException: Perforce client error:
    Connect to server failed; check $P4PORT.
    TCP connect to myp4server.mydomain.com:1666 failed.
    No such host is known. 

    at com.perforce.api.P4Process.closeProcess(P4Process.java:587)

None of these problems happened until I moved the JIRA server from Linux to Windows.

vivekbharathi Jothimani March 28, 2017

Do you have Perforce installed on JIRA Box?Try installing a P4 on box, where your JIRA server is running. In the configuration page, make sure you have your path to point to P4.exe. 

Jacek Tomaka May 18, 2017

The problem described by Miles was caused by SystemRoot variable being set to C:\WINNT.

It is reproducible outside of JIRA plugin. Just by setting SystemRoot environment variable screws p4 info, even if the rest of the parameters are set correctly.

Changing it to C:\Windows fixed the problem.

 

Suggest an answer

Log in or Sign up to answer