KnowageLabs/Knowage-Server

Python server fails to start with "from jinja2 import escape"

seajhawk opened this issue · 2 comments

Describe the bug
The python server fails to start becauseit is using Flask 1.1.1 which tries to import escape from jinja2, but it has been removed from that package.
See: https://stackoverflow.com/questions/71718167/importerror-cannot-import-name-escape-from-jinja2

To Reproduce

  1. Start the docker-compose.yml
  2. view python container CLI
  3. see error ImportError: cannot import name 'escape' from 'jinja2' (/usr/local/lib/python3.7/site-packages/jinja2/__init__.py)

Expected behavior
I expect the python server to start without error.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: NA
  • Version [e.g. 22]

Additional context
I suggest upgrading to Flask 2 to minimize errors of this sort in the future.

Hi @seajhawk,
I have locked the version of Jinja2 in requirements.txt (see commit c4519).

This should solve the issue, thanks for your collaboration!

@marcob1995 - I'm quite impressed by the quick turnaround as I'm looking forward to trying out Knowage and seeing if it will help with some campaign finance information I want to make available for others to analyze.

Since my hope is to use the docker images in production, I'm concerned that the versions are locked. Is there an established process I can follow for applying security fixes for the various components in the images?

Thank you!