firebus / splunk-jira

A Splunk Add-on for JIRA
http://apps.splunk.com/app/1438/
Other
25 stars 15 forks source link

Make JIRA SOAP port, protocol configurable #13

Closed tysonstewart closed 10 years ago

tysonstewart commented 10 years ago

I'm trying to set this up and I keep getting command="jirasoap", <urlopen error [Errno 111] Connection refused>. I can log in using curl from that Splunk machine, so the only thing I can think of is that this app is not compatible with Jira 6.0.

enthusiast commented 10 years ago

Have you looked at your python.log? I was able to see the request it was making and could see it was not correct.

I noticed in my jira_soap.py the line: url = "http://%s:8080/rpc/soap/jirasoapservice-v2?wsdl" % hostname

was not going to work for my install. I made the change and I was able to get it to work.

firebus commented 10 years ago

Enthusiast, what's wrong with the URL, and what's the correct URL for you?

Thanks!

On 10/07/2013 04:15 PM, enthusiast wrote:

Have you looked at your python.log? I was able to see the request it was making and could see it was not correct.

I noticed in my jira_soap.py the line: url = "http://%s:8080/rpc/soap/jirasoapservice-v2?wsdl" % hostname

was not going to work for my install. I made the change and I was able to get it to work.

— Reply to this email directly or view it on GitHub https://github.com/firebus/splunk-jira/issues/13#issuecomment-25853397.

russell uman firebus ((((d-_-b))))

enthusiast commented 10 years ago

I had a couple of problems out of the "box". I think they can be attributed to my environment. I was getting the refusal constantly. I had to make the following changes for my environment. There seems to be a disconnect from jira_soap to the jira script in the way the configurations are loaded.

For jira_soap.py I had to change port to 8081 for my installation: url = "http://%s:8080/rpc/soap/jirasoapservice-v2?wsdl" % hostname

For jira.py I had to add the port 8081 in the call. url = "https://%s/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?%s" % (hostname, query)

I should preface this all by that I do not own the JIRA environment. :)

firebus commented 10 years ago

Thanks enthusiast, I've changed the title of this issue, and I'll add some configuration for the port number. tysonstewart, let me know if this fix doesn't work for you!

tysonstewart commented 10 years ago

@enthusiast Thanks for that! Our Jira server is internal and we don't use HTTPS, so I changed the scheme in jira.py, so the request is at least going through.

Now, however, when I try a JQL query, I get an "invalid expression" error. Stack trace:

2013-10-08 17:22:18,451 -0500 ERROR     jira:130 - Invalid expression
Traceback (most recent call last):
  File "/opt/splunk/etc/apps/jira/bin/jira.py", line 85, in <module>
    v = elem.xpath(k)
  File "lxml.etree.pyx", line 1447, in lxml.etree._Element.xpath (src/lxml/lxml.etree.c:41728)
  File "xpath.pxi", line 321, in lxml.etree.XPathElementEvaluator.__call__ (src/lxml/lxml.etree.c:117734)
  File "xpath.pxi", line 239, in lxml.etree._XPathEvaluatorBase._handle_result (src/lxml/lxml.etree.c:116911)
  File "xpath.pxi", line 225, in lxml.etree._XPathEvaluatorBase._raise_eval_error (src/lxml/lxml.etree.c:116780)
XPathEvalError: Invalid expression
enthusiast commented 10 years ago

I forgot about that one. I figured out that if you do not set time_keys it gets a empty list. Even when I added some it did not work.

I added a negating if statement and mine worked.

next line added

     if not time_keys:
        for k in time_keys:
           logger.info(k)
           v = elem.xpath(k)
           if len(v) == 1:
              row[k] = v[0].get("seconds")
tysonstewart commented 10 years ago

@enthusiast Yep, that did it. Thanks!

firebus commented 10 years ago

I'm also looking into the JIRA 6.0 issue and I'll open a new issue for it