deeplook / svglib

Read SVG files and convert them to other formats.
GNU Lesser General Public License v3.0
315 stars 80 forks source link

Svglib is breaking Gunicorn #243

Closed igormcsouza closed 4 years ago

igormcsouza commented 4 years ago

I'm using svglib on a backend environment, alongside with Flask. After installing it, I got an error on gunicorn.

usage: gunicorn [-h] [-f FOLDER] [-it INPUT_TYPE]
gunicorn: error: unrecognized arguments: -b 0.0.0.0:2002 --access-logfile - --reload app:app

That is not happening when svglib is not installed. I'm using python 3, there is also Keras and Tensorflow installed on the environment. I'm using docker to build environment. My Gunicorn version is 19.9.0

claudep commented 4 years ago

I'm sorry for you, but with so few information, it's impossible for us to debug the issue, or even tell if svglib is really the culprit. Feel free to reopen if you can give more details on the error.

igormcsouza commented 4 years ago

@claudep Well.. I'm not sure what more is needed to debug it! Just create an environment with svglib, gunicorn==19.9.0 and flask. Create a simple application and run with gunicorn. The error will come up!

claudep commented 4 years ago

With the simple error line you reported above, it's simply impossible to find out what's the problem.

deeplook commented 4 years ago

@igormcsouza If you want anybody to reproduce an error you kind of have to make it as easy as possible. Even saying "Create a simple application and run with gunicorn." might be too complicated if there is nobody among the maintainers using gunicorn. For myself I can say I'm not.

If you say your gunicorn apps break after installing svglib it kind of reminds me of some features I've heard about gunicorn like applying monkey patches to Python or whatever else. Svglib has not too many direct dependencies. I would suggest you try your apps in a fresh environment with reportlab only installed, too, instead of svglib. I remember this also had some issues with thread-safety a long while ago. But maybe that has improved.

I hope this gives some helpful clues, otherwise I don't think we can provide much else.

igormcsouza commented 4 years ago

Hey @deeplook, I follow your instruction and tried to isolate the issue with the reportlib. After some tries I figured this versions bellow solved my problem!

RUN pip install reportlab==3.5.42
RUN pip install svglib==1.0.0

I guess the incompatibility was caused by reportlib anyway! Thank you for the advice!!