Open hc128168 opened 4 years ago
same problem here
Does first_superuser have to be an email address? yes. I think it is a source of your issue. BTW - don't forget to remove all containers and volumes related to DB before rebuilding to actually change to new. Good luck
Does first_superuser have to be an email address? yes. I think it is a source of your issue. BTW - don't forget to remove all containers and volumes related to DB before rebuilding to actually change to new. Good luck
I don't have any container running at the moment.
It seems like FastAPI fullstack package just created one volume called [project name]_app-db-data?
$ sudo docker volume ls
DRIVER VOLUME NAME
local 5db6c8c42230d6892643286ef3d61fc4f28c55bb8ff8b9543b355ffea9d2796c
local 89df075ad9e1e8e870943eb21484fc882a79cafacb4f416478834b03e418fd26
local cac365b3a936b96bc2671d28e3e7c75921d66edd12c1e89f97779c462c55c65a
local ddc7df9f2430bdc4baad691d79be2cea16750464224e13d6cebaed4c2ae6da14
local whitequeen_app-db-data
Maybe you should clean up volumes and reinstall app
Use docker volume prune
(https://docs.docker.com/engine/reference/commandline/volume_prune/)
I did docker volume prune
then retry docker-compose up -d
The problem is my both backend and celeryworker fail to run, so I checked my logs
backend_1 | Checking for script in /app/prestart.sh
backend_1 | Running script /app/prestart.sh
backend_1 | Traceback (most recent call last):
backend_1 | File "/app/app/backend_pre_start.py", line 5, in <module>
backend_1 | from app.db.session import SessionLocal
backend_1 | File "/app/app/db/session.py", line 4, in <module>
backend_1 | from app.core.config import settings
backend_1 | File "/app/app/core/config.py", line 89, in <module>
backend_1 | settings = Settings()
backend_1 | File "pydantic/env_settings.py", line 33, in pydantic.env_settings.BaseSettings.__init__
backend_1 | File "pydantic/main.py", line 346, in pydantic.main.BaseModel.__init__
backend_1 | pydantic.error_wrappers.ValidationError: 2 validation errors for Settings
backend_1 | BACKEND_CORS_ORIGINS -> 0
backend_1 | invalid or missing URL scheme (type=value_error.url.scheme)
backend_1 | FIRST_SUPERUSER
backend_1 | value is not a valid email address (type=value_error.email)
backend_1 | Checking for script in /app/prestart.sh
backend_1 | Running script /app/prestart.sh
backend_1 | Traceback (most recent call last):
backend_1 | File "/app/app/backend_pre_start.py", line 5, in <module>
backend_1 | from app.db.session import SessionLocal
backend_1 | File "/app/app/db/session.py", line 4, in <module>
backend_1 | from app.core.config import settings
backend_1 | File "/app/app/core/config.py", line 89, in <module>
backend_1 | settings = Settings()
backend_1 | File "pydantic/env_settings.py", line 33, in pydantic.env_settings.BaseSettings.__init__
backend_1 | File "pydantic/main.py", line 346, in pydantic.main.BaseModel.__init__
backend_1 | pydantic.error_wrappers.ValidationError: 2 validation errors for Settings
backend_1 | BACKEND_CORS_ORIGINS -> 0
backend_1 | invalid or missing URL scheme (type=value_error.url.scheme)
backend_1 | FIRST_SUPERUSER
backend_1 | value is not a valid email address (type=value_error.email)
backend_1 | Checking for script in /app/prestart.sh
backend_1 | Running script /app/prestart.sh
backend_1 | Traceback (most recent call last):
backend_1 | File "/app/app/backend_pre_start.py", line 5, in <module>
backend_1 | from app.db.session import SessionLocal
backend_1 | File "/app/app/db/session.py", line 4, in <module>
backend_1 | from app.core.config import settings
backend_1 | File "/app/app/core/config.py", line 89, in <module>
backend_1 | settings = Settings()
backend_1 | File "pydantic/env_settings.py", line 33, in pydantic.env_settings.BaseSettings.__init__
backend_1 | File "pydantic/main.py", line 346, in pydantic.main.BaseModel.__init__
backend_1 | pydantic.error_wrappers.ValidationError: 2 validation errors for Settings
backend_1 | BACKEND_CORS_ORIGINS -> 0
backend_1 | invalid or missing URL scheme (type=value_error.url.scheme)
backend_1 | FIRST_SUPERUSER
backend_1 | value is not a valid email address (type=value_error.email)
From logs, I trace where is backend_pre_start.py
locate, but I can't find this file
Here is my trace stack
First
@5SMNOONMS5 how did you reinstall? The log seems to complain BACKEND_CORS_ORIGINS
and FIRST_SUPERUSER
are not valid.
I have a similar issue, all containers are running:
I can access the frontend, pgAdmin, dashboard and flower. However, the login is not working and is returning a 404 response. The same is true for /docs
.
Has anyone an idea what the problem is or how to locate it?
I've deployed the app using jenkins. Here is my Jenkinsfile which is inspired by the .gitlab-ci.yml
file:
pipeline {
agent any
stages {
stage("Prepare") {
steps {
sh """
python3.8 -m venv venv
. venv/bin/activate
pip install docker-auto-labels
"""
echo 'Pulling... ' + env.GIT_BRANCH
}
}
stage("Build") {
stages {
stage("Build Stage") {
when {
expression { env.GIT_BRANCH == 'origin/dev' }
}
steps {
sh """
. venv/bin/activate
TAG=stag FRONTEND_ENV=staging sh ./scripts/build-push.sh
"""
}
}
stage("Build Prod") {
when {
expression { env.GIT_BRANCH == 'origin/main' }
}
steps {
sh """
. venv/bin/activate
TAG=prod FRONTEND_ENV=production sh ./scripts/build-push.sh
"""
}
}
}
}
stage("Deploy") {
stages {
stage("Build Stage") {
when {
expression { env.GIT_BRANCH == 'origin/dev' }
}
steps {
sh """
. venv/bin/activate
DOMAIN=stag.leadxtend.de TRAEFIK_TAG=stag.leadxtend.de STACK_NAME=stag-leadxtend-de TAG=stag sh ./scripts/deploy.sh
"""
}
}
stage("Build Prod") {
when {
expression { env.GIT_BRANCH == 'origin/main' }
}
steps {
sh """
. venv/bin/activate
DOMAIN=leadxtend.de TRAEFIK_TAG=leadxtend.de STACK_NAME=leadxtend-de TAG=prod sh ./scripts/deploy.sh
"""
}
}
}
}
}
}
The deployment of the backend seems to work at least to some point as the pgAdmin shows my initial user and correct tables:
Did you add in backend/app/app/core/config.py
FIRST_SUPERUSER: EmailStr = os.environ.get("FIRST_SUPERUSER", "test@example.com")
FIRST_SUPERUSER_PASSWORD: str = os.environ.get("FIRST_SUPERUSER_PASSWORD", "test-password")
?
I ran into this issue when my first_superuser wasn't formatted as an email. I updated the .env
file and added @app.com
to the FIRST_SUPERUSER
variable and restarted the containers. The next time I logged in I was successful.
@msmith93 Thank you! I was questioning my sanity before that point :D! Definitely worked for me
Hi,
I followed the wiki page to install:
And then set
first_superuser
andfirst_superuser_password
(this step I just created my own secret key and password without using the generator as suggested by wiki, does it matter?).But when I open http://localhost/login, and enter the user name and password, it keeps saying 'Incorrect email or password'.
I checked the frontend log in my container:
I don't see anything obvious.
Idea?
Does
first_superuser
have to be an email address?I set
pgadmin_default_user
to the same username, and I can log onto pgadmin tho.I also noticed that there was another ticket last year for similar issue.
I have tried to access http://localhost/docs (as suggested by the ticket), but an "404" error is returned.
And the ticket seems to suggest that I should have
backend/.env
but it doesn't exist.And I noticed that there is no container for the backend?
Is it normal?