I was able to resolve the problem, it seems ansible works with python2 and
by default ubuntu server has python3 rather than 2. Now I am getting a new
error which looks like this.
TASK [openwisp.openwisp2 : migrate]
*****************************************************************************************************************************
fatal: [ubuntu]: FAILED! => {"changed": false, "cmd": "./manage.py migrate
--noinput", "msg": "\n:stderr: Traceback (most recent call last):\n File
\"/opt/openwisp2/env/lib/python3.5/site-packages/django/contrib/gis/db/backends/spatialite/base.py\",
line 60, in get_new_connection\n cur.execute(\"SELECT
load_extension(%s)\", (self.spatialite_lib,))\n File
\"/opt/openwisp2/env/lib/python3.5/site-packages/django/db/backends/sqlite3/base.py\",
line 328, in execute\n return Database.Cursor.execute(self, query,
params)\nsqlite3.OperationalError:
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined symbol:
sqlite3_spatialite_init\n\nDuring handling of the above exception, another
exception occurred:\n\nTraceback (most recent call last):\n File
\"./manage.py\", line 10, in <module>\n
execute_from_command_line(sys.argv)\n File
\"/opt/openwisp2/env/lib/python3.5/site-packages/django/core/management/__init__.py\",
line 364, in execute_from_command_line\n utility.execute()\n File
\"/opt/openwisp2/env/lib/python3.5/site-packages/django/core/management/__init__.py\",
line 356, in execute\n
self.fetch_command(subcommand).run_from_argv(self.argv)\n File
\"/opt/openwisp2/env/lib/python3.5/site-packages/django/core/management/base.py\",
line 283, in run_from_argv\n self.execute(*args, **cmd_options)\n File
\"/opt/openwisp2/env/lib/python3.5/site-packages/django/core/management/base.py\",
line 330, in execute\n output = self.handle(*args, **options)\n File
\"/opt/openwisp2/env/lib/python3.5/site-packages/django/core/management/commands/migrate.py\",
line 81, in handle\n connection.prepare_database()\n File
\"/opt/openwisp2/env/lib/python3.5/site-packages/django/contrib/gis/db/backends/spatialite/base.py\",
line 72, in prepare_database\n with self.cursor() as cursor:\n File
\"/opt/openwisp2/env/lib/python3.5/site-packages/django/db/backends/base/base.py\",
line 254, in cursor\n return self._cursor()\n File
\"/opt/openwisp2/env/lib/python3.5/site-packages/django/db/backends/base/base.py\",
line 229, in _cursor\n self.ensure_connection()\n File
\"/opt/openwisp2/env/lib/python3.5/site-packages/django/db/backends/base/base.py\",
line 213, in ensure_connection\n self.connect()\n File
\"/opt/openwisp2/env/lib/python3.5/site-packages/django/db/backends/base/base.py\",
line 189, in connect\n self.connection =
self.get_new_connection(conn_params)\n File
\"/opt/openwisp2/env/lib/python3.5/site-packages/django/contrib/gis/db/backends/spatialite/base.py\",
line 65, in get_new_connection\n six.reraise(ImproperlyConfigured,
ImproperlyConfigured(new_msg), sys.exc_info()[2])\n File
\"/opt/openwisp2/env/lib/python3.5/site-packages/django/utils/six.py\",
line 685, in reraise\n raise value.with_traceback(tb)\n File
\"/opt/openwisp2/env/lib/python3.5/site-packages/django/contrib/gis/db/backends/spatialite/base.py\",
line 60, in get_new_connection\n cur.execute(\"SELECT
load_extension(%s)\", (self.spatialite_lib,))\n File
\"/opt/openwisp2/env/lib/python3.5/site-packages/django/db/backends/sqlite3/base.py\",
line 328, in execute\n return Database.Cursor.execute(self, query,
params)\ndjango.core.exceptions.ImproperlyConfigured: Unable to load the
SpatiaLite library extension \"libspatialite.so.7\" because:
/usr/lib/x86_64-linux-gnu/libspatialite.so.7: undefined symbol:
sqlite3_spatialite_init\n", "path":
"/opt/openwisp2/env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin",
"state": "absent", "syspath": ["/tmp/ansible_qw4W0_",
"/tmp/ansible_qw4W0_/ansible_modlib.zip",
"/tmp/ansible_qw4W0_/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
@/home/william/openwisp2-ansible-playbook/playbook.retry
PLAY RECAP
******************************************************************************************************************************************************
ubuntu : ok=39 changed=0 unreachable=0
failed=1
The issue seems to be specifically regarding openwisp migration and the
only post I could find similiar to this issue was this one
https://groups.google.com/forum/#!topic/openwisp/B2rdQJ8TSM4 but after
comparing the error messages I think it is not the same issue. Have any
suggestions?
On Tuesday, December 19, 2017 at 7:48:58 PM UTC-6, William Shi wrote:
>
> Hi I seem to be having trouble with the roles in installing openwisp2 like
> this post from earlier
> https://groups.google.com/forum/#!topic/openwisp/kiJfX9lD1gM, however I
> double checked and I did have the role installed already and even
> reinstalled and am still having the issue.(I am running virtual box on a
> windows 10 one instance of Ubuntu which is acting as my controller and one
> instance of Ubuntu server)
>
>
>
> <https://lh3.googleusercontent.com/-Ui0NwcXdpno/WjnAVzfzdlI/AAAAAAAAADk/0jdEi9G7FAQN2smaFM1I8Fs8GX_wh1mswCLcBGAs/s1600/openwisp%2Brole%2Bfile%2Blocation.PNG>
> When running the ansible-playbook -i hosts playbook.yml -u <user> -k
> --become -K I get
>
>
> <https://lh3.googleusercontent.com/-hGBtKRt6U_c/WjnBAck3ebI/AAAAAAAAADs/DY6Q6PoR1VIIycOEqD1lIb89O0WDFgZ5ACLcBGAs/s1600/Help.PNG>
>
>
>
> My playbook.yml looks like this
>
>
> <https://lh3.googleusercontent.com/-inAw5fbRBg4/WjnBTDlWDQI/AAAAAAAAADw/vxVFeiN778wTnHiqrv6PyReqbPB4fiu8QCLcBGAs/s1600/playbook.yml.PNG>
>
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.