Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server error first login as admin using docker #59

Open
ehallein opened this issue Aug 20, 2019 · 5 comments
Open

Server error first login as admin using docker #59

ehallein opened this issue Aug 20, 2019 · 5 comments

Comments

@ehallein
Copy link

I have tried to get the docker branch version up and running for testing using docker desktop for Mac. I am able to start Biosys no problem, however logging in using admin/admin username and password I get a server error. The console outputs the following error multiple times:

pg_1 | 2019-08-20 03:18:48.215 UTC [29] ERROR: relation "auth_user" does not exist at character 280
pg_1 | 2019-08-20 03:18:48.215 UTC [29] STATEMENT: SELECT "auth_user"."id", "auth_user"."password", "auth_user"."last_login", "auth_user"."is_superuser", "auth_user"."username", "auth_user"."first_name", "auth_user"."last_name", "auth_user"."email", "auth_user"."is_staff", "auth_user"."is_active", "auth_user"."date_joined" FROM "auth_user" WHERE "auth_user"."username" = 'admin'

Any clue as to what the issue is?

@ropable
Copy link
Member

ropable commented Aug 20, 2019

Have you defined the DATABASE_URL environment variable for the running container? Is there a database created for the project?

@ehallein
Copy link
Author

I've used the defaults, so it's possible it's wrong.
docker-compose.yml file has a database_url defined as postgis://postgres:pass@pg:5432/postgres
docker-compose.yml.txt

The readme seems to suggest that running "docker build -t dbca-wa/biosys ." should have built the database? There were no errors when running the build. Do I need to run another script to fill the database?
The log output the following on startup:

Starting biosys-docker_pg_1 ... done
Starting biosys-docker_biosys_1 ... done
Attaching to biosys-docker_pg_1, biosys-docker_biosys_1
pg_1 | 2019-08-20 05:44:16.966 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
pg_1 | 2019-08-20 05:44:16.966 UTC [1] LOG: listening on IPv6 address "::", port 5432
pg_1 | 2019-08-20 05:44:16.975 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
pg_1 | 2019-08-20 05:44:17.063 UTC [24] LOG: database system was shut down at 2019-08-20 03:32:28 UTC
pg_1 | 2019-08-20 05:44:17.140 UTC [1] LOG: database system is ready to accept connections
biosys_1 | [2019-08-20 13:44:27 +0800] [1] [INFO] Starting gunicorn 19.9.0
biosys_1 | [2019-08-20 13:44:27 +0800] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)
biosys_1 | [2019-08-20 13:44:27 +0800] [1] [INFO] Using worker: sync
biosys_1 | [2019-08-20 13:44:27 +0800] [11] [INFO] Booting worker with pid: 11
biosys_1 | [2019-08-20 13:44:27 +0800] [12] [INFO] Booting worker with pid: 12
biosys_1 | [2019-08-20 13:44:27 +0800] [13] [INFO] Booting worker with pid: 13
biosys_1 | [2019-08-20 13:44:27 +0800] [14] [INFO] Booting worker with pid: 14
biosys_1 | [2019-08-20 13:44:27 +0800] [15] [INFO] Booting worker with pid: 15

@ropable
Copy link
Member

ropable commented Aug 21, 2019

Note that docker build biosys only builds the biosys docker image locally. It does nothing related to generating the database. Thereafter the image needs to be run as a container with environment variables, e.g. docker container run --publish 8080:8080 --env DEBUG=True --env DATABASE_URL=postgis://user:pass@host/database biosys

@ropable
Copy link
Member

ropable commented Aug 21, 2019

Belay what I said earlier: reviewing the Dockerfile, it runs a bunch of commands on build (including piping env vars into a .env file). This is contrary to how the Dockerfile should be written (which should be able to build the application "stateless", with no environment vars defined), and is not according to our (DBCA) current practices. You may need to pester the author of that file about the issue (via git blame).

@ehallein
Copy link
Author

I have ended up using the normal (non-docker) python setup and it works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants