Hi Alvaro,

I'm sorry to see you incurred in this case.

I see you are using postgres, is that correct? I did test the migration on
sqlite and mysql but not on postgres, I naively supposed it would work but
that didn't seem the case.

Is yours a production system or a test installation?

Federico

On Wed, May 3, 2017 at 6:51 PM Alvaro Mendez <[email protected]>
wrote:

> Dear folks,
>
> when trying to upgrade i got this error:
>
>
> TASK [openwisp.openwisp2 : migrate]
> ********************************************
> task path: /etc/ansible/roles/openwisp.openwisp2/tasks/django.yml:74
> Using module file
> /usr/local/lib/python2.7/dist-packages/ansible/modules/core/web_infrastructure/django_manage.py
> <132.148.88.35> ESTABLISH SSH CONNECTION FOR USER: tabako
> <132.148.88.35> SSH: EXEC sshpass -d12 ssh -C -o ControlMaster=auto -o
> ControlPersist=60s -o User=tabako -o ConnectTimeout=10 -o
> ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r 132.148.88.35 '/bin/sh
> -c '"'"'( umask 77 && mkdir -p "` echo
> /tmp/ansible-tmp-1493829936.07-247563188619561 `" && echo
> ansible-tmp-1493829936.07-247563188619561="` echo
> /tmp/ansible-tmp-1493829936.07-247563188619561 `" ) && sleep 0'"'"''
> <132.148.88.35> PUT /tmp/tmpSFeZpN TO
> /tmp/ansible-tmp-1493829936.07-247563188619561/django_manage.py
> <132.148.88.35> SSH: EXEC sshpass -d12 sftp -o BatchMode=no -b - -C -o
> ControlMaster=auto -o ControlPersist=60s -o User=tabako -o
> ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r
> '[132.148.88.35]'
> <132.148.88.35> ESTABLISH SSH CONNECTION FOR USER: tabako
> <132.148.88.35> SSH: EXEC sshpass -d12 ssh -C -o ControlMaster=auto -o
> ControlPersist=60s -o User=tabako -o ConnectTimeout=10 -o
> ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r 132.148.88.35 '/bin/sh
> -c '"'"'setfacl -m u:www-data:r-x
> /tmp/ansible-tmp-1493829936.07-247563188619561/
> /tmp/ansible-tmp-1493829936.07-247563188619561/django_manage.py && sleep
> 0'"'"''
> <132.148.88.35> ESTABLISH SSH CONNECTION FOR USER: tabako
> <132.148.88.35> SSH: EXEC sshpass -d12 ssh -C -o ControlMaster=auto -o
> ControlPersist=60s -o User=tabako -o ConnectTimeout=10 -o
> ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -tt 132.148.88.35
> '/bin/sh -c '"'"'sudo -H -S  -p "[sudo via ansible,
> key=eoclcccijryxechynwgnbcpbjpxzdrcn] password: " -u www-data /bin/sh -c
> '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-eoclcccijryxechynwgnbcpbjpxzdrcn;
> /usr/bin/python
> /tmp/ansible-tmp-1493829936.07-247563188619561/django_manage.py'"'"'"'"'"'"'"'"'
> && sleep 0'"'"''
> <132.148.88.35> ESTABLISH SSH CONNECTION FOR USER: tabako
> <132.148.88.35> SSH: EXEC sshpass -d12 ssh -C -o ControlMaster=auto -o
> ControlPersist=60s -o User=tabako -o ConnectTimeout=10 -o
> ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r 132.148.88.35 '/bin/sh
> -c '"'"'rm -f -r /tmp/ansible-tmp-1493829936.07-247563188619561/ >
> /dev/null 2>&1 && sleep 0'"'"''
> fatal: [132.148.88.35]: FAILED! => {
>     "changed": false,
>     "cmd": "./manage.py migrate --noinput",
>     "failed": true,
>     "invocation": {
>         "module_args": {
>             "app_path": "/opt/openwisp2",
>             "apps": null,
>             "cache_table": null,
>             "clear": null,
>             "command": "migrate",
>             "database": null,
>             "failfast": false,
>             "fixtures": null,
>             "link": null,
>             "liveserver": null,
>             "merge": null,
>             "pythonpath": null,
>             "settings": null,
>             "skip": null,
>             "testrunner": null,
>             "virtualenv": "/opt/openwisp2/env"
>         },
>         "module_name": "django_manage"
>     },
>     "msg": "stdout: Operations to perform:\n  Apply all migrations:
> account, admin, auth, config, contenttypes, openwisp_users, pki, reversion,
> sessions, sites, socialaccount\nRunning migrations:\n  Applying
> config.0002_config_settings_uuid...\n:stderr: Traceback (most recent call
> last):\n  File \"./manage.py\", line 10, in <module>\n
> execute_from_command_line(sys.argv)\n  File
> \"/opt/openwisp2/env/local/lib/python2.7/site-packages/django/core/management/__init__.py\",
> line 367, in execute_from_command_line\n    utility.execute()\n  File
> \"/opt/openwisp2/env/local/lib/python2.7/site-packages/django/core/management/__init__.py\",
> line 359, in execute\n
> self.fetch_command(subcommand).run_from_argv(self.argv)\n  File
> \"/opt/openwisp2/env/local/lib/python2.7/site-packages/django/core/management/base.py\",
> line 294, in run_from_argv\n    self.execute(*args, **cmd_options)\n  File
> \"/opt/openwisp2/env/local/lib/python2.7/site-packages/django/core/management/base.py\",
> line 345, in execute\n    output = self.handle(*args, **options)\n  File
> \"/opt/openwisp2/env/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py\",
> line 204, in handle\n    fake_initial=fake_initial,\n  File
> \"/opt/openwisp2/env/local/lib/python2.7/site-packages/django/db/migrations/executor.py\",
> line 115, in migrate\n    state = self._migrate_all_forwards(state, plan,
> full_plan, fake=fake, fake_initial=fake_initial)\n  File
> \"/opt/openwisp2/env/local/lib/python2.7/site-packages/django/db/migrations/executor.py\",
> line 145, in _migrate_all_forwards\n    state = self.apply_migration(state,
> migration, fake=fake, fake_initial=fake_initial)\n  File
> \"/opt/openwisp2/env/local/lib/python2.7/site-packages/django/db/migrations/executor.py\",
> line 244, in apply_migration\n    state = migration.apply(state,
> schema_editor)\n  File
> \"/opt/openwisp2/env/local/lib/python2.7/site-packages/django/db/migrations/migration.py\",
> line 129, in apply\n    operation.database_forwards(self.app_label,
> schema_editor, old_state, project_state)\n  File
> \"/opt/openwisp2/env/local/lib/python2.7/site-packages/django/db/migrations/operations/fields.py\",
> line 204, in database_forwards\n    schema_editor.alter_field(from_model,
> from_field, to_field)\n  File
> \"/opt/openwisp2/env/local/lib/python2.7/site-packages/django/db/backends/base/schema.py\",
> line 495, in alter_field\n    old_db_params, new_db_params, strict)\n  File
> \"/opt/openwisp2/env/local/lib/python2.7/site-packages/django/db/backends/postgresql/schema.py\",
> line 117, in _alter_field\n    new_db_params, strict,\n  File
> \"/opt/openwisp2/env/local/lib/python2.7/site-packages/django/db/backends/base/schema.py\",
> line 649, in _alter_field\n    params,\n  File
> \"/opt/openwisp2/env/local/lib/python2.7/site-packages/django/db/backends/base/schema.py\",
> line 112, in execute\n    cursor.execute(sql, params)\n  File
> \"/opt/openwisp2/env/local/lib/python2.7/site-packages/django/db/backends/utils.py\",
> line 64, in execute\n    return self.cursor.execute(sql, params)\n  File
> \"/opt/openwisp2/env/local/lib/python2.7/site-packages/django/db/utils.py\",
> line 94, in __exit__\n    six.reraise(dj_exc_type, dj_exc_value,
> traceback)\n  File
> \"/opt/openwisp2/env/local/lib/python2.7/site-packages/django/db/backends/utils.py\",
> line 64, in execute\n    return self.cursor.execute(sql,
> params)\ndjango.db.utils.ProgrammingError: cannot cast type integer to
> uuid\nLINE 1: ...igsettings\" ALTER COLUMN \"id\" TYPE uuid USING
> \"id\"::uuid,
> AL...\n                                                             ^\n\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_RFedDl",
>         "/tmp/ansible_RFedDl/ansible_modlib.zip",
>         "/tmp/ansible_RFedDl/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"
>     ]
> }
>
>
> Thanks for your time!
>
> --
> 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.
>

-- 
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.

Reply via email to