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

Errors while configuring proxy for ST2 interaction with JIRA #6281

Closed
zsmanjot opened this issue Nov 18, 2024 · 7 comments
Closed

Errors while configuring proxy for ST2 interaction with JIRA #6281

zsmanjot opened this issue Nov 18, 2024 · 7 comments

Comments

@zsmanjot
Copy link

Hi Team,

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 as per below , it does not help and gives error.

image

[root@stackstorm3 ~]# st2 run jira.create_issue summary="TEST" project="OPS" type="ops-sopframework" . id: 66c8881a97a284d989cfbfb2 action.ref: jira.create_issue context.user: st2admin parameters: project: OPS summary: TEST type: ops-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 'cops-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 'cops-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.**********.com/rest/api/2/issue \t \tresponse headers = {'Date': 'Fri, 23 Aug 2024 13:01:15 GMT', xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} \tresponse text = {"errorMessages":[],"errors":{"summary":"Field 'summary' cannot be set. It is not on the appropriate screen, or unknown."}} " stdout: '' [root@stackstorm3 ~]#

Could anyone help here?
Normal curl does work.

@fdrab
Copy link
Contributor

fdrab commented Nov 18, 2024

You probably need to clone the Jira pack and update the JiraBaseAction in lib folder to accept proxies. The Jira library that this pack uses does allow for that, it's just not done in the pack (for some reason).

@zsmanjot
Copy link
Author

Hi @fdrab

Yes i did those changes as well but no luck.. defined proxy to be used but still the same error

@nzlosh
Copy link
Contributor

nzlosh commented Nov 18, 2024

It appears to me that you're asking for proxy support in the jira pack, not StackStorm. If this is the case you, should open an issue against the jira pack for assistance https://github.com/StackStorm-Exchange/stackstorm-jira as the pack installation behind a proxy documentation is specific to st2 core and not the jira pack.

@zsmanjot
Copy link
Author

zsmanjot commented Nov 18, 2024

Noted @nzlosh But even on our end we tried making some changes in base package of JIRA to include proxy configuration but it appears stackstorm is not taking them .
For example:
In /opt/stackstorm/packs/jira/config.schema.yaml: Did the following addition:
image

In /opt/stackstorm/packs/jira/actions/lib/base.py:
image

If you say i might open an issue under https://github.com/StackStorm-Exchange/stackstorm-jira

++ @floatingstatic

@floatingstatic
Copy link
Contributor

@zsmanjot guessing you tagged me here as the jira pack maintainer. I agree this should probably be raised in that repo but a quick observation:

response text = {"errorMessages":[],"errors":{"summary":"Field 'summary' cannot be set. It is not on the appropriate screen, or unknown."}}

It seems you actually get a 400 response from JIRA behind proxy otherwise you probably wouldn't see the above ^^. I have no idea what action you are running to produce this but would suggest gathering that detail into an issue here: https://github.com/StackStorm-Exchange/stackstorm-jira/issues

@zsmanjot
Copy link
Author

Thanks @floatingstatic

I have opened an issue under stackstorm-jira/issues --> StackStorm-Exchange/stackstorm-jira#81

I have mentioned all the settings that we have done in order to communicate with JIRA from ST2 box.

@nzlosh
Copy link
Contributor

nzlosh commented Nov 18, 2024

Thanks for stepping in @floatingstatic. 👍 Closed this issue since it is now tracked at the jira pack repository.

@nzlosh nzlosh closed this as completed Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants