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

St2Stream service broken when using SSL with mongodb #5078

Closed
ghost opened this issue Nov 17, 2020 · 6 comments · Fixed by #5091
Closed

St2Stream service broken when using SSL with mongodb #5078

ghost opened this issue Nov 17, 2020 · 6 comments · Fixed by #5091

Comments

@ghost
Copy link

ghost commented Nov 17, 2020

SUMMARY

This issue is an extension to #4832 however this time it is the st2stream service, I have looked that the code and can see the same monkey patch code hasn't been applied to the st2stream app

STACKSTORM VERSION

Paste the output of st2 --version: 3.3.0

OS, environment, install method

Docker compose with the split services and mongo db references commented out so that an external db can be used https://github.com/StackStorm/st2-docker/blob/master/docker-compose.yml

All other services correctly connected to mongodb.net test instance with the exception of st2stream.

Steps to reproduce the problem

use docker yaml at https://github.com/StackStorm/st2-docker/blob/master/docker-compose.yml, comment out mongo container and references, adjust files/st2-docker.conf to point to external DB with SSL = True enabled.
docker-compose up

Expected Results

What did you expect to happen when running the steps above?

st2stream to operate correctly

Actual Results

What happened? What output did you get?

2020-11-16 05:48:55,053 WARNING [-] Retry on ConnectionError - Cannot connect to database default :
maximum recursion depth exceeded

Adding monkey patch code to st2stream app resolves the issue (manually injected into container to test).

file: st2stream/cmd/api.py
Code:
from st2common.util.monkey_patch import monkey_patch
monkey_patch()

@arm4b
Copy link
Member

arm4b commented Nov 17, 2020

Thanks for the report!

Considering there is an example PR to fix it for other services, we'd love to accept external contributions to fix this for str2stream as well. Help wanted.

@arm4b arm4b added the mongodb label Nov 17, 2020
@punkrokk punkrokk self-assigned this Nov 17, 2020
@punkrokk
Copy link
Member

What line did you put the monkey patch in?

@ghost
Copy link
Author

ghost commented Nov 20, 2020

Hey, I added the line just below the copyright

from st2common.util.monkey_patch import monkey_patch
monkey_patch()

@arm4b
Copy link
Member

arm4b commented Nov 20, 2020

@Christopher-Russell should be easy to submit a PR then. Can you do it?

@ghost
Copy link
Author

ghost commented Nov 22, 2020

No worries, I'll submit a PR

@ghost
Copy link
Author

ghost commented Nov 24, 2020

I've submitted in #5091

arm4b added a commit that referenced this issue Nov 26, 2020
ticket #5078 fix: Resolves issue where st2stream crashes with a max depth error when connecting to a mongodb via SSL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants