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

Rules Decision throwing errors in container #18

Open
hawk4031 opened this issue Feb 18, 2022 · 2 comments
Open

Rules Decision throwing errors in container #18

hawk4031 opened this issue Feb 18, 2022 · 2 comments

Comments

@hawk4031
Copy link
Member

Using the Docker Compose instructions, I have successfully built all containers. When running docker-compose up, I see the following stack trace in the Rules Decision logs:

pyrrha-rulesdecision    | [2022-02-18 19:04:42 +0000] [1] [INFO] Starting gunicorn 19.7.1
pyrrha-rulesdecision    | [2022-02-18 19:04:42 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)
pyrrha-rulesdecision    | [2022-02-18 19:04:42 +0000] [1] [INFO] Using worker: sync
pyrrha-rulesdecision    | /usr/local/lib/python3.8/os.py:1023: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used
pyrrha-rulesdecision    |   return io.open(fd, *args, **kwargs)
pyrrha-rulesdecision    | [2022-02-18 19:04:42 +0000] [8] [INFO] Booting worker with pid: 8
pyrrha-rulesdecision    | [2022-02-18 19:04:42 +0000] [8] [ERROR] Exception in worker process
pyrrha-rulesdecision    | Traceback (most recent call last):
pyrrha-rulesdecision    |   File "/usr/app/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 578, in spawn_worker
pyrrha-rulesdecision    |     worker.init_process()
pyrrha-rulesdecision    |   File "/usr/app/venv/lib/python3.8/site-packages/gunicorn/workers/base.py", line 126, in init_process
pyrrha-rulesdecision    |     self.load_wsgi()
pyrrha-rulesdecision    |   File "/usr/app/venv/lib/python3.8/site-packages/gunicorn/workers/base.py", line 135, in load_wsgi
pyrrha-rulesdecision    |     self.wsgi = self.app.wsgi()
pyrrha-rulesdecision    |   File "/usr/app/venv/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
pyrrha-rulesdecision    |     self.callable = self.load()
pyrrha-rulesdecision    |   File "/usr/app/venv/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
pyrrha-rulesdecision    |     return self.load_wsgiapp()
pyrrha-rulesdecision    |   File "/usr/app/venv/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
pyrrha-rulesdecision    |     return util.import_app(self.app_uri)
pyrrha-rulesdecision    |   File "/usr/app/venv/lib/python3.8/site-packages/gunicorn/util.py", line 352, in import_app
pyrrha-rulesdecision    |     __import__(module)
pyrrha-rulesdecision    |   File "/usr/app/src/core_decision_flask_app.py", line 2, in <module>
pyrrha-rulesdecision    |     from flask import Flask, Response, jsonify, abort
pyrrha-rulesdecision    |   File "/usr/app/venv/lib/python3.8/site-packages/flask/__init__.py", line 21, in <module>
pyrrha-rulesdecision    |     from .app import Flask, Request, Response
pyrrha-rulesdecision    |   File "/usr/app/venv/lib/python3.8/site-packages/flask/app.py", line 25, in <module>
pyrrha-rulesdecision    |     from . import cli, json
pyrrha-rulesdecision    |   File "/usr/app/venv/lib/python3.8/site-packages/flask/json/__init__.py", line 21, in <module>
pyrrha-rulesdecision    |     from itsdangerous import json as _json
pyrrha-rulesdecision    | ImportError: cannot import name 'json' from 'itsdangerous' (/usr/app/venv/lib/python3.8/site-packages/itsdangerous/__init__.py)
pyrrha-rulesdecision    | [2022-02-18 19:04:42 +0000] [8] [INFO] Worker exiting (pid: 8)
pyrrha-rulesdecision    | [2022-02-18 19:04:42 +0000] [1] [INFO] Shutting down: Master
pyrrha-rulesdecision    | [2022-02-18 19:04:42 +0000] [1] [INFO] Reason: Worker failed to boot.
pyrrha-rulesdecision exited with code 3

No modifications have been made to this code; it is running out-of-the-box. It appears there's a package issue according to the stack trace.

@hawk4031
Copy link
Member Author

One of the packages that's installed as a dependency of Flask is itsdangerous. This dependency was updated on 2022-02-17 and removed the json import. You can see the changelog here. A recommendation I saw was to ping itsdangerous to the previous release of 2.0.1.

Information gathered from this StackOverflow post.

@upkarlidder
Copy link
Member

Thank you @hawk4031! Appreciate your work here.

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