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

Transport Cookies not passed -> Could not assign Workitem #61

Closed
schallinterferenz opened this issue Apr 5, 2022 · 7 comments
Closed

Comments

@schallinterferenz
Copy link

Hello,

We have a 2 server setup for Polarion in AWS, and the 2 servers run behind a load balancer.
The problem we encounter is that it happes often that we authenticate on one of the servers, and the next request goes to the other server and we get the following error:

Tag not found in polarion: Cannot find workitem <workitem_id> in project <project>
[2022-04-05 09:39:32,016] ERROR in app: Exception on /post [POST]
Traceback (most recent call last):
File "/home/eduard/.local/lib/python3.9/site-packages/flask/app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()
File "/home/eduard/.local/lib/python3.9/site-packages/flask/app.py", line 1951, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/eduard/.local/lib/python3.9/site-packages/flask/app.py", line 1820, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/eduard/.local/lib/python3.9/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/eduard/.local/lib/python3.9/site-packages/flask/app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "/home/eduard/.local/lib/python3.9/site-packages/flask/app.py", line 1935, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/eduard/Repos/efg_devops_git-polarion-bridge/./github_polarion_bridge.py", line 433, in hook_github
add_polarion_table_entry(polarion_client, work_item, commit,
UnboundLocalError: local variable 'work_item' referenced before assignment
127.0.0.1 - - [05/Apr/2022 09:39:32] "POST /post HTTP/1.1" 500 -

My question now is, how I can pass the transport cookiejar, as well as the session id, via the library, so that our load balacer knows where to route the request?

@schallinterferenz schallinterferenz changed the title Transport Cookies not passed -> Could not find Workitem Transport Cookies not passed -> Could not assign Workitem Apr 5, 2022
@jesper-raemaekers
Copy link
Owner

Hello,

I don't believe there is any way I can reproduce this, so i made a best guess. I found where the cookies should be stored once you login and copied it to all services used. From testing i can see that i found something cookie related, but it seems empty:
image
I'm unfamiliar with how that load balancer works (does it add a cookie?) so it is hard to say if this works. But please let me know.
The sessions id was already shared and should be correct for all outgoing calls.

@schallinterferenz
Copy link
Author

schallinterferenz commented Apr 11, 2022

Hello jesper,

Thank you for the quick response. Do I have to specify, define or pass the cookies somewhere, after you updated the lib?

@jesper-raemaekers
Copy link
Owner

Hi,

I expected the cookies to be assigned to the first call (logging in) and took them from there. (see dffa8ad#diff-9e4a1f402680e813c78e2a66d9b8b7ff039fa510dac419d880a8968327ce3ab8R92 )
But it seems i might misunderstand, you want to specify a cookie? How do you create this?

@schallinterferenz
Copy link
Author

schallinterferenz commented Apr 11, 2022

I have to excuse for the confusion. You have understood my issue right!

It works like a charm :) Tested it five time. No errors at all. It finds the project instantly and our load balancer gets the right cookies.

Thanks a lot!

@schallinterferenz
Copy link
Author

When do you think you will release a update?

@jesper-raemaekers
Copy link
Owner

It was released today with version 0.4.0

@schallinterferenz
Copy link
Author

Thanks a lot!

jesper-raemaekers added a commit that referenced this issue Apr 28, 2022
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

2 participants