LuteOrg / lute-v3

LUTE = Learning Using Texts: learn languages through reading.
https://luteorg.github.io/lute-manual/
MIT License
491 stars 46 forks source link

Docker image fails to start - ModuleNotFoundError: No module named 'ahocorapy' #490

Closed unickq closed 1 month ago

unickq commented 1 month ago

Description

On docker compose up for

services:
  lute:
    image: jzohrab/lute3:latest
    ports:
      - 5010:5000
    volumes:
      - ./data:/lute_data
      - ./backups:/lute_backup

Log

Attaching to lute-1
lute-1  | Traceback (most recent call last):
lute-1  |   File "<frozen runpy>", line 198, in _run_module_as_main
lute-1  |   File "<frozen runpy>", line 88, in _run_code
lute-1  |   File "/usr/local/lib/python3.11/site-packages/lute/main.py", line 17, in <module>
lute-1  |     from lute.app_factory import create_app
lute-1  |   File "/usr/local/lib/python3.11/site-packages/lute/app_factory.py", line 30, in <module>
lute-1  |     import lute.db.demo
lute-1  |   File "/usr/local/lib/python3.11/site-packages/lute/db/demo.py", line 14, in <module>
lute-1  |     from lute.book.stats import refresh_stats
lute-1  |   File "/usr/local/lib/python3.11/site-packages/lute/book/stats.py", line 6, in <module>
lute-1  |     from lute.read.render.service import get_multiword_indexer, get_textitems
lute-1  |   File "/usr/local/lib/python3.11/site-packages/lute/read/render/service.py", line 12, in <module>
lute-1  |     from lute.read.render.multiword_indexer import MultiwordTermIndexer
lute-1  |   File "/usr/local/lib/python3.11/site-packages/lute/read/render/multiword_indexer.py", line 5, in <module>
lute-1  |     from ahocorapy.keywordtree import KeywordTree
lute-1  | ModuleNotFoundError: No module named 'ahocorapy'
lute-1 exited with code 1
thelazyoxymoron commented 1 month ago

Facing the same issue

unickq commented 1 month ago

@thelazyoxymoron the solution for now is to use older version

services:
  lute:
    image: jzohrab/lute3:3.5.3
    ports:
      - 5010:5000
    volumes:
      - ./data:/lute_data
      - ./backup:/lute_backup

But @jzohrab, please check your recent changes in 3.5.4 and 3.5.5

jzohrab commented 1 month ago

Thanks guys! I botched release 3.5.4 and I guess that docker used that bad version. Sorry, will rebuild today.

jzohrab commented 1 month ago

Need to fix the release process too to prevent future issues.

jzohrab commented 1 month ago

Thanks @unickq and @thelazyoxymoron -- I've just re-pushed image 3.5.5 and tested it out.

The problem was that during the build, it was fetching what it thought was the latest available Lute release from pypi, but actually a newer release was pushed, it just wasn't visible yet. Now the docker image build requires a specific version, so going forward this shouldn't happen again.

Cheers and thanks again. I'll leave this issue open for a while in case anyone else has the same problem.

unickq commented 1 month ago

Thanks for fixing it, @jzohrab

Just curious, why do you install your app with Pypi in docker? I mean instead of building it from sources.

jzohrab commented 1 month ago

Hi @unickq - I should change it back to building from source. :-) I switched to pypi for the wrong reasons, but then that prevents people from using the dockerfile to build their own images if they hack the code.

jzohrab commented 1 month ago

Changed back to build using source code, not pypi.

jzohrab commented 1 month ago

Launched in 3.5.6.