Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIRA hosted #10

Closed
daroczig opened this issue Feb 17, 2015 · 10 comments
Closed

JIRA hosted #10

daroczig opened this issue Feb 17, 2015 · 10 comments
Labels

Comments

@daroczig
Copy link

First of all, thank you very much for this great project! Quick question: do hamster-bridge supposed to work with hosted JIRA as well? Right after the Lookup issue for activity ... I always get a Resetting dropped connection... error message.

@kraiz
Copy link
Owner

kraiz commented Feb 17, 2015

I'm glad you enjoy it.

I'm using it together with our company jira instance and never tried the hosted one. But as this tool just speaks to the rest api, it should just work. Maybe the authentication method of the hosted jira api is more restricted or just differs.

Can you provide a full stacktrace?

@daroczig
Copy link
Author

​I'd love to as being really eager to push the logged times to JIRA :) But can you please give me some hint on how to capture a full stack trace? What I see while running hamster-bridge jira in a console is is:

2015-02-13 09:33:29,039    INFO: Lookup issue for activity "***-1"
2015-02-13 09:33:29,039    INFO: Resetting dropped connection: ***.atlassian.net
2015-02-13 09:33:32,518    INFO: Resetting dropped connection: ***.atlassian.net
2015-02-13 12:25:20,929    INFO: Lookup issue for activity "***-1"
2015-02-13 12:25:20,930    INFO: Resetting dropped connection: ***.atlassian.net
2015-02-13 12:25:21,142    INFO: Resetting dropped connection: ***.atlassian.net
2015-02-13 12:25:22,363    INFO: Logged work: 171m to ***-1
2015-02-13 15:51:40,297    INFO: Lookup issue for activity "***-5"
2015-02-13 15:51:40,298    INFO: Resetting dropped connection: ***.atlassian.net
2015-02-13 15:51:41,294    INFO: Resetting dropped connection: ***.atlassian.net
2015-02-13 15:51:43,915    INFO: Logged work: 11m to ***-5

I replaced a few characters with stars for privacy issues. API access is enabled in JIRA, and the URL is correct. Not sure what could be the problem, but these logged times did not show up in JIRA.

@kraiz
Copy link
Owner

kraiz commented Feb 19, 2015

I had a short look into this. Seems like atlassian put out a new python package for communicating with the jira api and the hamster-bridge is still using the old one.

old: https://pypi.python.org/pypi/jira-python/
new: https://pypi.python.org/pypi/jira/

think my company is still using jira 5 and i didn't run into problems. hosted jira should be latest version, 6.x. porting to the new library shoudn't be that hard, but i like to test it before with your help: please install the new package and run something like this on the console:

$ pip install jira
$ python
>>> from jira import JIRA
>>> jira = JIRA('https://jira.atlassian.com', basic_auth=('username', 'password'))
>>> jira.add_worklog('JRA-9', '13m')

I'm checking this tomorrow against my company's jira, too. If we both succeed, there should be a new hamster-bridge version soon :)

@kraiz kraiz added the bug label Feb 19, 2015
@daroczig
Copy link
Author

Wow, this is great! Just checked the above code (replacing the URL to my company URL), and it works like a charm. I hope it works fine with your local install as well, and I'm eagerly looking forward to the new version :) Let me know if I can help with e.g. testing. Thanks, Gergely

kraiz added a commit that referenced this issue Feb 20, 2015
BEWARE: untested code, need to verify next week
@kraiz
Copy link
Owner

kraiz commented Feb 20, 2015

Ok, my test was successful, too. I made some changes but mostly blind because i can't test it from home. I will test it monday, you can too by installing the new hamster-bridge version from github via:

$ pip install https://github.com/kraiz/hamster-bridge/zipball/master

But be sure to uninstall jira-python before or setup a new virtualenv for this test.

@daroczig
Copy link
Author

Thank you, sir! I've just installed the new version from GH (after removing jira-python), but the symptoms are the same: I get the Resetting dropped connection message in the console and no time is logged to JIRA. So the console output is exactly the same as I posted previously :( Not sure what the problem might be.

@kraiz
Copy link
Owner

kraiz commented Feb 21, 2015

Hm, that's a pitty. Seems like the problem lies very deep inside:

  • hamster-bridge uses
    • jira uses

This is usually no problem at all. The first request (searching for a matching jira ticket) opens a http connection to the jira rest api. This connection is kept alive and pooled. The next request (add_worklog) should reuse this pooled connection. When reusing it detects this pooled connection is dropped for whatever reason (maybe hosted jira is configured to prevent keep alive connection (unusual) or you are using proxy which did that?) but no matter it just should create a new connection for perform the worklog request. But then without further error message the request is done and hamster-bridge logged success.

As the problem seems to lie this deep, i can't really configure this but i'll make a change to log the requests result. Maybe we get more insight. If your not tired already, please update again from github (with the command above), try again and send the log.

@daroczig
Copy link
Author

The log seems to be okay for me, not sure what could be the problem:

$ bin/hamster-bridge jira
2015-02-21 08:03:41,250    INFO: Starting hamster bridge
2015-02-21 08:03:41,252    INFO: Activating listener: jira
2015-02-21 08:03:41,252    INFO: Registering <hamster_bridge.listeners.jira.JiraHamsterListener object at 0x7f1af878ea50>
2015-02-21 08:03:41,258    INFO: Starting new HTTP connection (1): ***.atlassian.net
2015-02-21 08:03:41,522    INFO: Starting new HTTPS connection (1): ***.atlassian.net
2015-02-21 08:03:43,571    INFO: Starting new HTTP connection (1): pypi.python.org
2015-02-21 08:03:43,995    INFO: Starting new HTTPS connection (1): pypi.python.org
2015-02-21 08:04:09,947    INFO: Lookup issue for activity "***-1"
2015-02-21 08:04:11,881    INFO: Logged work: 1m to ***-1 (created <JIRA Worklog at 0x7f1aeb473950>)

But I cannot see the logged time at the referenced JIRA ticket. Please let me know how I can help testing and debugging, I won't be tired of any related task :) Thanks!

@kraiz
Copy link
Owner

kraiz commented Feb 22, 2015

Seems like it tries to connect via http. What's the jira server url? Did it begin with http oder https?

@daroczig
Copy link
Author

Ah, right, thanks for the help -- everything works fine after updating the server_url in ~/.hamster-bridge.cfg to use https instead of http. This is awesome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants