gislab-npo / gislab

GIS.lab - total reduction of deployment and maintenance costs for complete free and open source geospatial infrastructure
http://gislab-npo.github.io/gislab/
GNU General Public License v3.0
40 stars 14 forks source link

unit installation fails (sync db) #479

Closed landam closed 8 years ago

landam commented 8 years ago

When installing unit from scratch the installation process fails with

TASK [client-web : Sync database] **********************************************
fatal: [gislab-unit-roudnice]: FAILED! => {"changed": false, "cmd": "./manage.py syncdb --noinput --settings=djproject.settings", "failed": true, "msg": "[Errno 13] Permission denied", "rc": 13}

RUNNING HANDLER [client-web : service gislab-web restart] **********************

PLAY RECAP *********************************************************************
gislab-unit-roudnice       : ok=316  changed=262  unreachable=0    failed=1   
imincik commented 8 years ago

Can't replicate using Vagrant.

Can you try to run "./manage.py syncdb --noinput --settings=djproject.settings" by hand ?

landam commented 8 years ago

like this?

 sudo python /opt/gislab/system/clients/web/www/manage.py syncdb --noinput --settings=djproject.settings
Traceback (most recent call last):
  File "/opt/gislab/system/clients/web/www/manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
imincik commented 8 years ago

@landam, Python virtualenv must be activated before:

$ source /opt/gislab/clients/web/virtualenv/gislab-web/bin/activate
landam commented 8 years ago
/opt/gislab/clients/web/virtualenv/gislab-web/bin/activate

is not found at my unit. I used:

source /opt/gislab/system/clients/web/virtualenv/gislab-web/bin/activate
python /opt/gislab/system/clients/web/www/manage.py syncdb --noinput --settings=djproject.settings
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table django_content_type
Creating table django_session
Creating table viewer_gislabuser_groups
Creating table viewer_gislabuser_user_permissions
Creating table viewer_gislabuser
Creating table viewer_project_registry
Creating table storage_ball
Creating table storage_drawing
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)

works OK. I tried ansible again and it failed with same error message.

TASK [client-web : Sync database] **********************************************
fatal: [gislab-unit-roudnice]: FAILED! => {"changed": false, "cmd": "./manage.py syncdb --noinput --settings=djproject.settings", "failed": true, "msg": "[Errno 13] Permission denied", "rc": 13}

PLAY RECAP *********************************************************************
gislab-unit-roudnice       : ok=287  changed=97   unreachable=0    failed=1   
imincik commented 8 years ago

@landam , I have no idea. Can you SSH to machine and try to look where "Permission denied" is coming from (Django or from PostgreSQL database) ? Try to look at /storage/log/syslog

imincik commented 8 years ago

@landam, can you try once again with GISLAB_DEBUG_INSTALL: yes ?

Also, please check your Ansible version - $ ansible --version

It seems that my Ansible is executing this command differently:

cmd": "python manage.py syncdb --noinput --settings=djproject.settings
imincik commented 8 years ago

Similar issue: https://github.com/lorin/ansiblebook/issues/5

landam commented 8 years ago

From documentation (all) I don't know where debug message should go, the output of ansible is the same, so probably somewhere else then to stdout?

I have

ansible 2.0.0.1
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
imincik commented 8 years ago

@landam, Ansible 2 is most probably the issue. Please downgrade to Ansible 1. I hope it will be OK than.

imincik commented 8 years ago

Wiki updated: https://github.com/gislab-npo/gislab/wiki/Quick-Start/_compare/321e7c470660679120896f22a98760c9bd4b7b89...e3c92a31588dca8c82690477ed0e06eb98babd8b

landam commented 8 years ago

Thanks, I downgraded Ansible to 1.7 and it works.