nansencenter / geo-spaas-vagrant

Vagrant configuration for Geo-Scientific Platform as a Service
GNU General Public License v3.0
0 stars 1 forks source link

Provisioning fails due to gdal error #6

Closed mortenwh closed 6 years ago

mortenwh commented 6 years ago

Suddenly, I can't provision my vm's. They fail at nansat installation because gdal isn't installed. Has anyone changed anything in conda?

screenshot from 2017-11-27 22-12-26

aleksandervines commented 6 years ago

Works for me, with latest master branch.

aleksandervines commented 6 years ago

Well, I was a bit fast. The provisioning of course got past all the conda/nansat stuff before it failed at least.

TASK [geospaas_catalog : Setup DB | Run makemigrations on django-geo-spaas project] ***
task path: /vagrant/provisioning/roles/geospaas_catalog/tasks/setup_db.yml:2
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/web_infrastructure/django_manage.py
<192.168.33.10> ESTABLISH LOCAL CONNECTION FOR USER: vagrant
<192.168.33.10> EXEC /bin/sh -c 'echo ~ && sleep 0'
<192.168.33.10> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/vagrant/.ansible/tmp/ansible-tmp-1511861606.38-257980606169653 `" && echo ansible-tmp-1511861606.38-257980606169653="` echo /home/vagrant/.ansible/tmp/ansible-tmp-1511861606.38-257980606169653 `" ) && sleep 0'
<192.168.33.10> PUT /tmp/tmpngfOI5 TO /home/vagrant/.ansible/tmp/ansible-tmp-1511861606.38-257980606169653/django_manage.py
<192.168.33.10> EXEC /bin/sh -c 'chmod u+x /home/vagrant/.ansible/tmp/ansible-tmp-1511861606.38-257980606169653/ /home/vagrant/.ansible/tmp/ansible-tmp-1511861606.38-257980606169653/django_manage.py && sleep 0'
<192.168.33.10> EXEC /bin/sh -c 'GDAL_DATA=/home/vagrant/miniconda/share/gdal PATH=/home/vagrant/miniconda/bin:/usr/sbin:/usr/bin:/sbin:/bin LC_ALL=en_US.UTF-8 /usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1511861606.38-257980606169653/django_manage.py; rm -rf "/home/vagrant/.ansible/tmp/ansible-tmp-1511861606.38-257980606169653/" > /dev/null 2>&1 && sleep 0'
fatal: [192.168.33.10]: FAILED! => {
    "changed": false,
    "cmd": "./manage.py makemigrations --settings=geospaas_project.settings --pythonpath=/vagrant/shared/course_vm/geospaas_project",
    "failed": true,
    "invocation": {
        "module_args": {
            "app_path": "/vagrant/shared/course_vm/geospaas_project",
            "apps": null,
            "cache_table": null,
            "clear": null,
            "command": "makemigrations",
            "database": null,
            "failfast": false,
            "fixtures": null,
            "link": null,
            "liveserver": null,
            "merge": null,
            "pythonpath": "/vagrant/shared/course_vm/geospaas_project",
            "settings": "geospaas_project.settings",
            "skip": null,
            "testrunner": null,
            "virtualenv": null
        }
    },
    "msg": "\n:stderr: Traceback (most recent call last):\n  File \"./manage.py\", line 10, in <module>\n    execute_from_command_line(sys.argv)\n  File \"/home/vagrant/miniconda/lib/python2.7/site-packages/django/core/management/__init__.py\", line 353, in execute_from_command_line\n    utility.execute()\n  File \"/home/vagrant/miniconda/lib/python2.7/site-packages/django/core/management/__init__.py\", line 327, in execute\n    django.setup()\n  File \"/home/vagrant/miniconda/lib/python2.7/site-packages/django/__init__.py\", line 18, in setup\n    apps.populate(settings.INSTALLED_APPS)\n  File \"/home/vagrant/miniconda/lib/python2.7/site-packages/django/apps/registry.py\", line 108, in populate\n    app_config.import_models(all_models)\n  File \"/home/vagrant/miniconda/lib/python2.7/site-packages/django/apps/config.py\", line 202, in import_models\n    self.models_module = import_module(models_module_name)\n  File \"/home/vagrant/miniconda/lib/python2.7/importlib/__init__.py\", line 37, in import_module\n    __import__(name)\n  File \"/home/vagrant/miniconda/lib/python2.7/site-packages/geospaas/viewer/models.py\", line 8, in <module>\n    from django.contrib.gis.db import models as geomodels\n  File \"/home/vagrant/miniconda/lib/python2.7/site-packages/django/contrib/gis/db/models/__init__.py\", line 2, in <module>\n    from django.contrib.gis.db.models.aggregates import *  # NOQA\n  File \"/home/vagrant/miniconda/lib/python2.7/site-packages/django/contrib/gis/db/models/aggregates.py\", line 1, in <module>\n    from django.contrib.gis.db.models.fields import ExtentField\n  File \"/home/vagrant/miniconda/lib/python2.7/site-packages/django/contrib/gis/db/models/fields.py\", line 1, in <module>\n    from django.contrib.gis import forms\n  File \"/home/vagrant/miniconda/lib/python2.7/site-packages/django/contrib/gis/forms/__init__.py\", line 3, in <module>\n    from .fields import (  # NOQA\n  File \"/home/vagrant/miniconda/lib/python2.7/site-packages/django/contrib/gis/forms/fields.py\", line 4, in <module>\n    from django.contrib.gis.geos import GEOSException, GEOSGeometry\n  File \"/home/vagrant/miniconda/lib/python2.7/site-packages/django/contrib/gis/geos/__init__.py\", line 18, in <module>\n    geos_version_info()\n  File \"/home/vagrant/miniconda/lib/python2.7/site-packages/django/contrib/gis/geos/libgeos.py\", line 171, in geos_version_info\n    raise GEOSException('Could not parse version info string \"%s\"' % ver)\ndjango.contrib.gis.geos.error.GEOSException: Could not parse version info string \"3.6.2-CAPI-1.10.2 0\"\n",
    "path": "/home/vagrant/miniconda/bin:/usr/sbin:/usr/bin:/sbin:/bin",
    "state": "absent",
    "syspath": [
        "/tmp/ansible_kWx1b7",
        "/tmp/ansible_kWx1b7/ansible_modlib.zip",
        "/tmp/ansible_kWx1b7/ansible_modlib.zip",
        "/usr/lib/python2.7",
        "/usr/lib/python2.7/plat-x86_64-linux-gnu",
        "/usr/lib/python2.7/lib-tk",
        "/usr/lib/python2.7/lib-old",
        "/usr/lib/python2.7/lib-dynload",
        "/usr/local/lib/python2.7/dist-packages",
        "/usr/lib/python2.7/dist-packages"
    ]
}
        to retry, use: --limit @/vagrant/provisioning/site.retry

edit: To enhance the silly error message given: Could not parse version info string \"3.6.2-CAPI-1.10.2 0\"

The issue string comes from geos. One "hack" solution is here: https://stackoverflow.com/questions/18643998/geodjango-geosexception-error

But I'm not sure who's to "blaim" here, and hence where to fix the problem :/

mortenwh commented 6 years ago

Ok - this is another issue that @korvinos is looking into. If we implement this hack, then we need to do it in ansible after installation of geodjango. Shouldn't be too difficult...

Another option is to just update Django to a later version, and this is anyway necessary.

mortenwh commented 6 years ago

I get the same error message as you on my work machine so I may need to update vagrant and virtualbox on my home computer. Will try tonight...

korvinos commented 6 years ago

@mortenwh Specification of packages (libspatialite, gdal) was a temporary solution. Today I've tried to make provision and got that the requested builds don't exist in conda (wtf!?). It seems like they just remove them.

So I jumped to the Django 1.11.7 and that solved the issue. This was fixed at Django 1.11.5 (https://code.djangoproject.com/ticket/20036). Be aware, that you need to use conda forge to or pip get the right version (in regular conda it's just 1.11.3 now)

mortenwh commented 6 years ago

I have updated vagrant and virtualbox on my home computer and the main problem referred in the heading is now solved. In order to get the provisioning running again, it remains to solve issue #5.