Freshly cloned docker-compose is giving error ModuleNotFoundError: No module named 'flask._compat'
cachho opened this issue · 0 comments
cachho commented
I'm sure this can easily be fixed. I see if I can do so myself.
Full dump:
~/code/docker > git clone https://github.com/hack4impact/flask-base.git
Cloning into 'flask-base'...
remote: Enumerating objects: 2058, done.
remote: Counting objects: 100% (64/64), done.
remote: Compressing objects: 100% (48/48), done.
remote: Total 2058 (delta 23), reused 42 (delta 16), pack-reused 1994
Receiving objects: 100% (2058/2058), 14.55 MiB | 2.52 MiB/s, done.
Resolving deltas: 100% (958/958), done.
~/code/docker > cd flask-base/
~/code/docker/flask-base > docker-compose up
WARNING: The POSTGRES_USER variable is not set. Defaulting to a blank string.
WARNING: The POSTGRES_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The POSTGRES_DB variable is not set. Defaulting to a blank string.
Creating network "flask-base_default" with the default driver
Creating volume "flask-base_db-data" with default driver
Building server
Step 1/12 : FROM python:3.8-alpine
---> 31eb2697b443
Step 2/12 : RUN apk update && apk add postgresql-dev gcc python3-dev musl-dev
---> Using cache
---> b11d2f93ef4a
Step 3/12 : ENV MAIL_USERNAME=yourmail@test.com
---> Using cache
---> 1abb49c97bfd
Step 4/12 : ENV MAIL_PASSWORD=testpass
---> Using cache
---> 3b3d6748f063
Step 5/12 : ENV SECRET_KEY=SuperRandomStringToBeUsedForEncryption
---> Using cache
---> 2b97d439a81b
Step 6/12 : COPY ./requirements.txt /app/requirements.txt
---> Using cache
---> 9c180cde325d
Step 7/12 : WORKDIR /app
---> Using cache
---> 6240ef1f2686
Step 8/12 : RUN pip3 install -r requirements.txt
---> Using cache
---> 6fa9b5f9fec1
Step 9/12 : ENV PYTHONIOENCODING=UTF-8
---> Using cache
---> ff014057cf6e
Step 10/12 : RUN pip3 install sqlalchemy_utils flask_dance flask_caching python-gitlab
---> Using cache
---> 54e8a7f91577
Step 11/12 : COPY . /app
---> 27b387ec1c0b
Step 12/12 : ENTRYPOINT ["python3", "-u" ,"manage.py", "runserver"]
---> Running in 6dae1cce9a40
Removing intermediate container 6dae1cce9a40
---> 59bc1069eba0
Successfully built 59bc1069eba0
Successfully tagged flask-base_server:latest
WARNING: Image for service server was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Building worker
Step 1/12 : FROM python:3.8-alpine
---> 31eb2697b443
Step 2/12 : RUN apk update && apk add postgresql-dev gcc python3-dev musl-dev
---> Using cache
---> b11d2f93ef4a
Step 3/12 : ENV MAIL_USERNAME=yourmail@test.com
---> Using cache
---> 1abb49c97bfd
Step 4/12 : ENV MAIL_PASSWORD=testpass
---> Using cache
---> 3b3d6748f063
Step 5/12 : ENV SECRET_KEY=SuperRandomStringToBeUsedForEncryption
---> Using cache
---> 2b97d439a81b
Step 6/12 : COPY ./requirements.txt /app/requirements.txt
---> Using cache
---> 9c180cde325d
Step 7/12 : WORKDIR /app
---> Using cache
---> 6240ef1f2686
Step 8/12 : RUN pip3 install -r requirements.txt
---> Using cache
---> 6fa9b5f9fec1
Step 9/12 : ENV PYTHONIOENCODING=UTF-8
---> Using cache
---> ff014057cf6e
Step 10/12 : RUN pip3 install sqlalchemy_utils flask_dance flask_caching python-gitlab
---> Using cache
---> 54e8a7f91577
Step 11/12 : COPY . /app
---> Using cache
---> 27b387ec1c0b
Step 12/12 : ENTRYPOINT ["python3", "-u" ,"manage.py", "run_worker"]
---> Running in 9ab6d8a1080b
Removing intermediate container 9ab6d8a1080b
---> 5b374fa60503
Successfully built 5b374fa60503
Successfully tagged flask-base_worker:latest
WARNING: Image for service worker was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating flask-base_postgres_1 ... done
Creating flask-base_adminer_1 ... done
Creating flask-base_worker_1 ... done
Creating flask-base_server_1 ... done
Creating flask-base_redis_1 ... done
Attaching to flask-base_postgres_1, flask-base_server_1, flask-base_redis_1, flask-base_worker_1, flask-base_adminer_1
postgres_1 | The files belonging to this database system will be owned by user "postgres".
postgres_1 | This user must also own the server process.
postgres_1 |
postgres_1 | The database cluster will be initialized with locale "en_US.utf8".
postgres_1 | The default database encoding has accordingly been set to "UTF8".
postgres_1 | The default text search configuration will be set to "english".
postgres_1 |
postgres_1 | Data page checksums are disabled.
postgres_1 |
postgres_1 | fixing permissions on existing directory /var/lib/postgresql/data ... ok
postgres_1 | creating subdirectories ... ok
postgres_1 | selecting dynamic shared memory implementation ... posix
postgres_1 | selecting default max_connections ... 100
postgres_1 | selecting default shared_buffers ... 128MB
postgres_1 | selecting default time zone ... Etc/UTC
postgres_1 | creating configuration files ... ok
postgres_1 | running bootstrap script ... ok
adminer_1 | [Tue Oct 18 20:05:19 2022] PHP 7.4.32 Development Server (http://[::]:8080) started
redis_1 | 1:C 18 Oct 2022 20:05:19.018 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis_1 | 1:C 18 Oct 2022 20:05:19.018 # Redis version=6.2.7, bits=64, commit=00000000, modified=0, pid=1, just started
redis_1 | 1:C 18 Oct 2022 20:05:19.018 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
redis_1 | 1:M 18 Oct 2022 20:05:19.019 * monotonic clock: POSIX clock_gettime
redis_1 | 1:M 18 Oct 2022 20:05:19.019 # A key '__redis__compare_helper' was added to Lua globals which is not on the globals allow list nor listed on the deny list.
redis_1 | 1:M 18 Oct 2022 20:05:19.019 * Running mode=standalone, port=6379.
redis_1 | 1:M 18 Oct 2022 20:05:19.019 # Server initialized
redis_1 | 1:M 18 Oct 2022 20:05:19.020 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
redis_1 | 1:M 18 Oct 2022 20:05:19.020 * Ready to accept connections
server_1 | Traceback (most recent call last):
server_1 | File "manage.py", line 6, in <module>
server_1 | from flask_script import Manager, Shell, Server
server_1 | File "/usr/local/lib/python3.8/site-packages/flask_script/__init__.py", line 15, in <module>
server_1 | from flask._compat import text_type
server_1 | ModuleNotFoundError: No module named 'flask._compat'
worker_1 | Traceback (most recent call last):
worker_1 | File "manage.py", line 6, in <module>
worker_1 | from flask_script import Manager, Shell, Server
worker_1 | File "/usr/local/lib/python3.8/site-packages/flask_script/__init__.py", line 15, in <module>
worker_1 | from flask._compat import text_type
worker_1 | ModuleNotFoundError: No module named 'flask._compat'
postgres_1 | performing post-bootstrap initialization ... ok
flask-base_server_1 exited with code 1
flask-base_worker_1 exited with code 1
postgres_1 | syncing data to disk ... ok
postgres_1 |
postgres_1 |
postgres_1 | Success. You can now start the database server using:
postgres_1 |
postgres_1 | pg_ctl -D /var/lib/postgresql/data -l logfile start
postgres_1 |
postgres_1 | initdb: warning: enabling "trust" authentication for local connections
postgres_1 | initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.
postgres_1 | waiting for server to start....2022-10-18 20:05:20.769 UTC [48] LOG: starting PostgreSQL 15.0 (Debian 15.0-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
postgres_1 | 2022-10-18 20:05:20.781 UTC [48] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres_1 | 2022-10-18 20:05:20.816 UTC [51] LOG: database system was shut down at 2022-10-18 20:05:20 UTC
postgres_1 | 2022-10-18 20:05:20.835 UTC [48] LOG: database system is ready to accept connections
postgres_1 | done
postgres_1 | server started
postgres_1 | CREATE DATABASE
postgres_1 |
postgres_1 |
postgres_1 | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
postgres_1 |
postgres_1 | 2022-10-18 20:05:21.119 UTC [48] LOG: received fast shutdown request
postgres_1 | waiting for server to shut down....2022-10-18 20:05:21.131 UTC [48] LOG: aborting any active transactions
postgres_1 | 2022-10-18 20:05:21.133 UTC [48] LOG: background worker "logical replication launcher" (PID 54) exited with exit code 1
postgres_1 | 2022-10-18 20:05:21.133 UTC [49] LOG: shutting down
postgres_1 | 2022-10-18 20:05:21.143 UTC [49] LOG: checkpoint starting: shutdown immediate
postgres_1 | 2022-10-18 20:05:21.334 UTC [49] LOG: checkpoint complete: wrote 918 buffers (5.6%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.032 s, sync=0.100 s, total=0.202 s; sync files=250, longest=0.030 s, average=0.001 s; distance=4217 kB, estimate=4217 kB
postgres_1 | 2022-10-18 20:05:21.346 UTC [48] LOG: database system is shut down
postgres_1 | done
postgres_1 | server stopped
postgres_1 |
postgres_1 | PostgreSQL init process complete; ready for start up.
postgres_1 |
postgres_1 | 2022-10-18 20:05:21.474 UTC [1] LOG: starting PostgreSQL 15.0 (Debian 15.0-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
postgres_1 | 2022-10-18 20:05:21.474 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
postgres_1 | 2022-10-18 20:05:21.474 UTC [1] LOG: listening on IPv6 address "::", port 5432
postgres_1 | 2022-10-18 20:05:21.494 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres_1 | 2022-10-18 20:05:21.521 UTC [63] LOG: database system was shut down at 2022-10-18 20:05:21 UTC
postgres_1 | 2022-10-18 20:05:21.539 UTC [1] LOG: database system is ready to accept connections