JIRA - Perforce Integration.

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

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.

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?

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

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.

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.

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

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

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.

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. 

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jun 14, 2018 in Jira Service Desk

How the Telegram Integration for Jira helps Sergey's team take their support efficiency to the bank

...+ reading Fantasy). The same is true for him at the bank he works for: Efficiency is key when time literally equals money. Read on to learn how Sergey makes most of the time he has by...

463 views 2 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you