translation_layoutrecovery
translation_layoutrecovery copied to clipboard
Multiple errors
It is the first time that I use docker and honestly, I have no idea how it works, I have limited myself to following the installation instructions that you indicate but I cannot in any way get the app to work. In the installation instructions, step 3 states Important: Then, put the necessary environment files (.env) in this folder. Since I don't really know what to do in this step, I have limited myself to renaming the .env-template file to .env:
CREDENTIAL_JSON_FILE_NAME=example
STORAGE_BUCKET_NAME=example
SECRET_KEY=example
DATABASE_ENGINE=example
DATABASE_NAME=example
DATABASE_USER=example
DATABASE_PASSWORD=example
DATABASE_HOST=example
DATABASE_PORT=example
I am using a Windows 11 machine and Docker-desktop configured on wsl2
-
The first error I got was during the process
[backend 6/7] RUN pip install -r requirements.txt
:9.809 ERROR: Package 'networkx' requires a different Python: 3.8.10 not in '>=3.9'
This bug was fixed by adding 'networkx==3.1' in the requirements.txt file -
The second error I ran into took place in
[+] Running 4/3
translation-app-frontend | yarn run v1.22.19
translation-app-frontend | $ next dev
translation-app-frontend | /bin/sh: 1: next: not found
translation-app-frontend | error Command failed with exit code 127.
translation-app-frontend | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
translation-app-frontend exited with code 127
As I said at the beginning, I have no idea about docker (or next), but by consulting some related problems I was able to solve it (or so I think) by modifying the volume configuration in the services docker-compose.yml. I'm not sure if this is correct but it apparently solved the problem:
volumes:
- ./Frontend:/translation-app-frontend
- /translation-app-frontend/node_modules
- The third error also occurs in
[+] Running 4/3
:
[+] Running 4/3
✔ Container translation-app-backend Recreated 0.1s
! backend Published ports are discarded when using host network mode 0.0s
✔ Container translation-app-frontend Recreated 0.1s
! frontend Published ports are discarded when using host network mode 0.0s
I guess this is why when I access http://localhost:3000/ the page doesn't load, but although I have searched for information and it seems that using host.docker.internal instead of localhost:xxxx could be a solution as suggested in this related issue ([](https://stackoverflow.com/questions/55851632/docker-compose-network-mode -host-not-working)), I don't know where to make the modifications and therefore I haven't been able to solve it:
- Finally, in addition to the previous error that I don't know how to solve, an error message always appears in [+] Running 4/3 after
Successfully installed translation-app
. I also don't know how to fix this error:
translation-app-backend | django.core.exceptions.ImproperlyConfigured: 'example' isn't an available database backend or couldn't be imported. Check the above exception. To use one of the built-in backends, use 'django.db.backends.XXX', where XXX is one of:
translation-app-backend | 'mysql', 'oracle', 'postgresql', 'sqlite3'
translation-app-backend exited with code 1
- Full log:
[+] Building 48.8s (11/12) docker:default
[+] Building 48.9s (12/12) docker:default
[+] Building 55.9s (23/23) FINISHED docker:default
=> [backend internal] load build definition from Dockerfile.backend 0.3s
=> => transferring dockerfile: 496B 0.2s
=> [backend internal] load metadata for docker.io/nvidia/cuda:11.1.1-cudnn8-devel-ubuntu20.04 2.1s
=> [backend internal] load .dockerignore 0.1s
=> => transferring context: 61B 0.1s
=> [backend 1/7] FROM docker.io/nvidia/cuda:11.1.1-cudnn8-devel-ubuntu20.04@sha256:83e4b2841034cdf45ea5b9a5b472eb2c07b1b23d4836d32666a881db29a8dceb 0.0s
=> [backend internal] load build context 45.2s
=> => transferring context: 410.64MB 45.2s
=> CACHED [backend 2/7] RUN apt-get update && apt-get install -y python3 python3-pip cmake wget llvm 0.0s
=> CACHED [backend 3/7] RUN apt-get install -y libglib2.0-0 libsm6 ffmpeg libxext6 libxrender-dev 0.0s
=> CACHED [backend 4/7] WORKDIR /translation-app-backend/Backend/ 0.0s
=> CACHED [backend 5/7] COPY ./Backend/requirements.txt requirements.txt 0.0s
=> CACHED [backend 6/7] RUN pip install -r requirements.txt 0.0s
=> [backend 7/7] COPY . . 0.5s
=> [backend] exporting to image 0.6s
=> => exporting layers 0.6s
=> => writing image sha256:07882e1572e76b15b00cbc9d13cf2cabbf19e549e42b5958115f068bc7056ef3 0.0s
=> => naming to docker.io/library/translation_layoutrecovery-backend 0.0s
=> [frontend internal] load build definition from Dockerfile.frontend 0.0s
=> => transferring dockerfile: 685B 0.0s
=> [frontend internal] load metadata for docker.io/library/node:20.5.1 0.7s
=> [frontend internal] load .dockerignore 0.0s
=> => transferring context: 61B 0.0s
=> [frontend internal] load build context 0.1s
=> => transferring context: 5.36kB 0.0s
=> [frontend 1/6] FROM docker.io/library/node:20.5.1@sha256:8d9887b3b05d2e65598a18616c37cfc271346d12248dfcbeadd7b7bf4da1e827 0.0s
=> CACHED [frontend 2/6] WORKDIR /translation-app-frontend/ 0.0s
=> CACHED [frontend 3/6] RUN apt-get -y update && apt-get install -y nmh 0.0s
=> CACHED [frontend 4/6] COPY ./Frontend/package.json ./Frontend/yarn.lock . 0.0s
=> CACHED [frontend 5/6] RUN yarn install && yarn start 0.0s
=> [frontend 6/6] COPY ./Frontend/ . 0.1s
=> [frontend] exporting to image 0.3s
=> => exporting layers 0.2s
=> => writing image sha256:361f9517a95837f680c87c9fc28125acd2a1a5cd14c9c3be235eb4430ec51691 0.0s
=> => naming to docker.io/library/translation_layoutrecovery-frontend 0.0s
[+] Running 4/4
✔ Container translation-app-backend Recreated 1.2s
! backend Published ports are discarded when using host network mode 0.0s
✔ Container translation-app-frontend Recreated 1.1s
! frontend Published ports are discarded when using host network mode 0.0s
Attaching to translation-app-backend, translation-app-frontend
translation-app-backend |
translation-app-backend | ==========
translation-app-backend | == CUDA ==
translation-app-backend | ==========
translation-app-backend |
translation-app-backend | CUDA Version 11.1.1
translation-app-backend |
translation-app-backend | Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
translation-app-backend |
translation-app-backend | This container image and its contents are governed by the NVIDIA Deep Learning Container License.
translation-app-backend | By pulling and using the container, you accept the terms and conditions of this license:
translation-app-backend | https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license
translation-app-backend |
translation-app-backend | A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.
translation-app-backend |
translation-app-frontend | yarn run v1.22.19
translation-app-frontend | $ next dev
translation-app-backend | /usr/local/lib/python3.8/dist-packages/gdown/__main__.py:132: FutureWarning: Option `--id` was deprecated in version 4.3.1 and will be removed in 5.0. You don't need to pass it anymore to use a file ID.
translation-app-backend | warnings.warn(
translation-app-backend | Downloading...
translation-app-backend | From (original): https://drive.google.com/uc?id=1Jx2m_2I1d9PYzFRQ4gl82xQa-G7Vsnsl
translation-app-backend | From (redirected): https://drive.google.com/uc?id=1Jx2m_2I1d9PYzFRQ4gl82xQa-G7Vsnsl&confirm=t&uuid=e803f44b-b923-4895-b646-04a56c7409b9
translation-app-backend | To: /translation-app-backend/Backend/model_196000.pth
translation-app-frontend | - ready started server on 0.0.0.0:3000, url: http://localhost:3000
translation-app-frontend | - event compiled client and server successfully in 4.2s (20 modules)
translation-app-frontend | - wait compiling...
translation-app-frontend | - event compiled client and server successfully in 119 ms (20 modules)
100%|██████████| 351M/351M [00:37<00:00, 9.37MB/s]
translation-app-backend | Obtaining file:///translation-app-backend
translation-app-backend | Installing collected packages: translation-app
translation-app-backend | Running setup.py develop for translation-app
translation-app-backend | Successfully installed translation-app
translation-app-backend | Traceback (most recent call last):
translation-app-backend | File "/usr/local/lib/python3.8/dist-packages/django/db/utils.py", line 113, in load_backend
translation-app-backend | return import_module("%s.base" % backend_name)
translation-app-backend | File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
translation-app-backend | return _bootstrap._gcd_import(name[level:], package, level)
translation-app-backend | File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
translation-app-backend | File "<frozen importlib._bootstrap>", line 991, in _find_and_load
translation-app-backend | File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
translation-app-backend | File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
translation-app-backend | File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
translation-app-backend | File "<frozen importlib._bootstrap>", line 991, in _find_and_load
translation-app-backend | File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
translation-app-backend | ModuleNotFoundError: No module named 'example'
translation-app-backend |
translation-app-backend | The above exception was the direct cause of the following exception:
translation-app-backend |
translation-app-backend | Traceback (most recent call last):
translation-app-backend | File "manage.py", line 22, in <module>
translation-app-backend | main()
translation-app-backend | File "manage.py", line 18, in main
translation-app-backend | execute_from_command_line(sys.argv)
translation-app-backend | File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
translation-app-backend | utility.execute()
translation-app-backend | File "/usr/local/lib/python3.8/dist-packages/django/core/management/__init__.py", line 416, in execute
translation-app-backend | django.setup()
translation-app-backend | File "/usr/local/lib/python3.8/dist-packages/django/__init__.py", line 24, in setup
translation-app-backend | apps.populate(settings.INSTALLED_APPS)
translation-app-backend | File "/usr/local/lib/python3.8/dist-packages/django/apps/registry.py", line 116, in populate
translation-app-backend | app_config.import_models()
translation-app-backend | File "/usr/local/lib/python3.8/dist-packages/django/apps/config.py", line 269, in import_models
translation-app-backend | self.models_module = import_module(models_module_name)
translation-app-backend | File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
translation-app-backend | return _bootstrap._gcd_import(name[level:], package, level)
translation-app-backend | File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
translation-app-backend | File "<frozen importlib._bootstrap>", line 991, in _find_and_load
translation-app-backend | File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
translation-app-backend | File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
translation-app-backend | File "<frozen importlib._bootstrap_external>", line 848, in exec_module
translation-app-backend | File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
translation-app-backend | File "/usr/local/lib/python3.8/dist-packages/django/contrib/auth/models.py", line 3, in <module>
translation-app-backend | from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
translation-app-backend | File "/usr/local/lib/python3.8/dist-packages/django/contrib/auth/base_user.py", line 57, in <module>
translation-app-backend | class AbstractBaseUser(models.Model):
translation-app-backend | File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py", line 143, in __new__
translation-app-backend | new_class.add_to_class("_meta", Options(meta, app_label))
translation-app-backend | File "/usr/local/lib/python3.8/dist-packages/django/db/models/base.py", line 371, in add_to_class
translation-app-backend | value.contribute_to_class(cls, name)
translation-app-backend | File "/usr/local/lib/python3.8/dist-packages/django/db/models/options.py", line 243, in contribute_to_class
translation-app-backend | self.db_table, connection.ops.max_name_length()
translation-app-backend | File "/usr/local/lib/python3.8/dist-packages/django/utils/connection.py", line 15, in __getattr__
translation-app-backend | return getattr(self._connections[self._alias], item)
translation-app-backend | File "/usr/local/lib/python3.8/dist-packages/django/utils/connection.py", line 62, in __getitem__
translation-app-backend | conn = self.create_connection(alias)
translation-app-backend | File "/usr/local/lib/python3.8/dist-packages/django/db/utils.py", line 193, in create_connection
translation-app-backend | backend = load_backend(db["ENGINE"])
translation-app-backend | File "/usr/local/lib/python3.8/dist-packages/django/db/utils.py", line 126, in load_backend
translation-app-backend | raise ImproperlyConfigured(
translation-app-backend | django.core.exceptions.ImproperlyConfigured: 'example' isn't an available database backend or couldn't be imported. Check the above exception. To use one of the built-in backends, use 'django.db.backends.XXX', where XXX is one of:
translation-app-backend | 'mysql', 'oracle', 'postgresql', 'sqlite3'
translation-app-backend exited with code 1