Closed martnst closed 5 years ago
Hi there! Have you created a data directory and run the associated Postgres database container? There are instructions here on how to get going with the Docker images and docker-compose file:
https://github.com/quru/qis/blob/master/doc/running.md#docker
But briefly a minimal setup is:
$ mkdir qis
$ cd qis
$ mkdir data
$ docker pull quru/qis-as
$ docker pull quru/qis-postgres
$ docker pull quru/qis-memcached
$ wget https://raw.githubusercontent.com/quru/qis/master/deploy/docker/docker-compose.yml
<remove the "build" lines from docker-compose.yml>
$ echo -e "QIS_HOSTNAME=localhost\nQIS_DATA_DIR=./data" > .env
$ docker-compose up -d
<wait 30 seconds -- first time around only>
$ curl --insecure https://localhost/
<!DOCTYPE html>
<html>
...[snip]
$ grep 'admin user' data/logs/qis/qis.log
2019-10-02 13:34:10,221 qis_31 INFO Created default admin user with password 831z96M1wu
<browse to https://localhost/ and login as admin with password 831z96M1wu>
Hi, yeah actually I faced an issue of The PGDATA directory is not writable for the container
from the qis_db
as I tried to set it up on Ubuntu 18.04 LTS with docker-compose.
Because of this error I then tried installing postgres natively on Ubuntu on. Then hooking in via adding 127.0.0.1 qis_db
to /etc/hosts
and network_mode: host
in the docker-compose.yml
(also removing the qis_db
service from it). Finally I was able to have the qis-as up and browse the admin login page. However there is no data/logs/qis/qis.log
file.
There are such logs in data/logs/apache/error.log
:
[Wed Oct 02 12:58:42.220279 2019] [wsgi:error] [pid 161:tid 139730637281024] Stats server exited: [Errno 13] Permission denied: '/opt/qis/images/.metadata'
[Wed Oct 02 12:58:42.240174 2019] [wsgi:error] [pid 163:tid 139730637281024] Task server exited: [Errno 13] Permission denied: '/opt/qis/images/.metadata'
So all in all I think there is some permission setup going wrong or missing.
OK I understand. The difference is I'm running Docker for Mac whereas you're running proper Docker on Linux. On Linux when mounting a directory from the host into the container, the directory on the host must be owned by the correct user ID otherwise you'll get these "permission denied" errors. The documentation is missing this part. I'll find out what the correct IDs should be and update the docs with the fix.
I have revised the running.md
document with the additional setup instructions, briefly:
$ mkdir -p qis/data
$ cd qis
$ mkdir data/data && sudo chown 105:109 data/data
$ mkdir data/images && sudo chown 999:999 data/images
$ mkdir -p data/logs/qis && sudo chown 999:999 data/logs/qis
with the rest being as before.
This fixes the permissions errors. But in testing this I've found an intermittent timing problem whereby sometimes the first few log file entries are lost. Since the first logs include the generated password for logging in, this is a problem. You might get lucky and not hit this, but there's another fix to come yet.
Hopefully these issues are all fixed now. Please can you run a docker pull quru/qis-as
to bring down the latest Docker image and try again?
@fozcode Thanks for the updates. It works without issues now. 🙂
Looks like there is a missing configuration in the docker image?
Logs: