-
Notifications
You must be signed in to change notification settings - Fork 35
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
Errors while configuring proxy for ST2 interaction with JIRA #81
Comments
I am in no way connected to this pack. But observing the 400 error. Are you able to run a simple |
Hi @skiedude jira.get_issue also does not work with the proxy setup that i am using: Gives below error:
During handling of the above exception, another exception occurred: Traceback (most recent call last): |
Have checked and curl via proxy is working on stackstorm box. It means there is some configuration that needs to be done on pack side so that it could go through proxy. Although we did mention the use of proxy in files highlighted above but it does not work. |
@zsmanjot sorry for the delay. Thanks for testing this with curl. Have you tested the same using the python jira package directly to confirm it works how you expect? Example: https://stackoverflow.com/a/40243355 Also I observe from your initial comment you are using an Thanks! |
A bit more detail it seems like this functionality is something python-jira forwards on to the Ref: https://requests.readthedocs.io/en/latest/api/#requests.Session.proxies The only reason I think we need to dig into this with python-jira is because the st2 pack here just forwards this stuff on to the jira lib, and then requests, etc. If we can figure out the correct invocation and get this working direct in that library it should be easy to adapt the pack if needed to accommodate whatever params we need to forward on (if it is not capable of doing this currently). |
Also not sure if this is still relevant but it is open: pycontribs/jira#1138 |
Thanks for jumping on this again. Ya that was typo and not intentional. But the settings on server side are accordingly wherein we are using https url in https_proxy and http url in http_proxy. |
Sure @floatingstatic |
Just to update here, it stands sorted now. We defined environment variable in Stackstorm box and used -e option while testing it out , like below: st2 run -e jira.get_issue issue_key="OPS-12345" Without explicilty mentioning this option, it does give errors. Moreover in workflows we first had to write the core.local task to fetch the env variable and passed it in subsequent task to be used. |
@zsmanjot Either way from what I gather at the moment this is possibly something that may be an issue in the |
This is why I'd like to confirm that first and foremost the python jira package works when explicitly passed proxies instead of being reliant on environment variables. For now, if we think environment variable is the only viable and valid solution then i have no issues in closing this case. |
@zsmanjot Sorry I mean take this pack completely out of the equation, and test the python library... something like:
If you cannot get that to work I'd focus efforts on fixing that in the python library. Sorry for any confusion, I've never used JIRA via a proxy and cannot see what you see so I'm doing my best to try to understand and help guide you to a solution here. |
Got you rpoint @floatingstatic . Let me try writing the code and see if it works. Will update here. |
Tried it with explicit script but it did not help. Getting below errors:- Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): |
This is in your traceback:
You are missing |
No , i have defined it like this: `# Proxy settings jira_options = { jira = JIRA(options=jira_options, basic_auth=(jira_email, jira_api_token)) |
@zsmanjot I think thats wrong, see: https://github.com/pycontribs/jira/blob/ef10e1a481813fb134ca6232225e4734302418d8/jira/client.py#L480
|
Tried it the other way too as you have mentioned but no luck. I will again pick this up and try if i succeed but i am constantly getting errors that it cant connect to proxy. |
OK, that sounds like a problem with If that doesn't work there is little we can do about it in this pack given we just wrap everything around the |
Ok sure @floatingstatic I will open up an issue and follow up there. Thanks for all your help. I will update here once i hear from them. |
A little bit related. Our servers that run stackstorm can't reach the "public" internal facing URL for jira. So we use a DMZ DNS url to reach jira from the servers network. That means in my
Have you tried configuring the pack directly with your Proxy URL? I've submitted a PR to the Jira pip project because they don't handle certain actions when you are using a proxy or alternate URL. This causes certain pack actions here to timeout. |
We have a scenario where in our environment JIRA could not be directly accessible from ST2 but has to first go through proxy.
But when we configure the proxy settings , it does not help and gives error.
All the proxy setting done as part of using JIRA pack is as below under the highlighted files:
When trying running the action using JIRA action it gives error as below.
[root@stackstorm3 ~]# st2 run jira.create_issue summary="TEST" project="OPERATION" type="operations-framework" . id: 66c8881a97a284d989cfbfb2 action.ref: jira.create_issue context.user: st2admin parameters: project: OPERATION summary: TEST type: operations-sopframework status: failed start_timestamp: Fri, 23 Aug 2024 13:01:14 UTC end_timestamp: Fri, 23 Aug 2024 13:01:15 UTC result: exit_code: 1 result: None stderr: "/opt/stackstorm/virtualenvs/jira/lib/python3.8/site-packages/urllib3/connectionpool.py:1099: InsecureRequestWarning: Unverified HTTPS request is being made to host 'XXXXXXXX-bc-proxy1'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings warnings.warn( /opt/stackstorm/virtualenvs/jira/lib/python3.8/site-packages/urllib3/connectionpool.py:1099: InsecureRequestWarning: Unverified HTTPS request is being made to host 'XXXXXXXX-bc-proxy1'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings warnings.warn( Traceback (most recent call last): File "/opt/stackstorm/st2/lib/python3.8/site-packages/python_runner/python_action_wrapper.py", line 395, in <module> obj.run() File "/opt/stackstorm/st2/lib/python3.8/site-packages/python_runner/python_action_wrapper.py", line 214, in run output = action.run(**self._parameters) File "/opt/stackstorm/packs/jira/actions/create_issue.py", line 26, in run issue = self._client.create_issue(fields=data) File "/opt/stackstorm/virtualenvs/jira/lib/python3.8/site-packages/jira/client.py", line 1858, in create_issue r = self._session.post(url, data=json.dumps(data)) File "/opt/stackstorm/virtualenvs/jira/lib/python3.8/site-packages/requests/sessions.py", line 637, in post return self.request("POST", url, data=data, json=json, **kwargs) File "/opt/stackstorm/virtualenvs/jira/lib/python3.8/site-packages/jira/resilientsession.py", line 247, in request elif raise_on_error(response, **processed_kwargs): File "/opt/stackstorm/virtualenvs/jira/lib/python3.8/site-packages/jira/resilientsession.py", line 72, in raise_on_error raise JIRAError( jira.exceptions.JIRAError: JiraError HTTP 400 url: https://jira.xxxxxxxxxxx.com/rest/api/2/issue \t \tresponse headers = {'Date': 'Fri, 23 Aug 2024 13:01:15 GMT', xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} \tresponse text = {"errorMessages":[],"errors":{"summary":"Field 'summary' cannot be set. It is not on the appropriate screen, or unknown."}} " stdout: '' [root@stackstorm3 ~]#
The text was updated successfully, but these errors were encountered: