[GeoNode-users] database update error

Eugenio Trumpy frippe12573 at hotmail.com
Thu Jun 23 02:22:06 PDT 2016


Hi Simone,

django is at 1.8.7 version, is that correct for the master? how can I check the version of the data model?

However, from empty geonode db I run manage.py migrate auth:

 System check identified some issues:

WARNINGS:
account.EmailConfirmation.created: (fields.W161) Fixed default value provided.
    HINT: It seems you set a fixed date / time / datetime value as default for this field. This may not be what you want. If you want to have the current date as default, use `django.utils.timezone.now`
dialogos.Comment.ip_address: (fields.W900) IPAddressField has been deprecated. Support for it (except in historical migrations) will be removed in Django 1.9.
    HINT: Use GenericIPAddressField instead.
Operations to perform:
  Apply all migrations: auth
Running migrations:
  Rendering model states... DONE
  Applying contenttypes.0001_initial... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0001_initial... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
Traceback (most recent call last):
  File "manage.py", line 29, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 346, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 394, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 226, in handle
    emit_post_migrate_signal(created_models, self.verbosity, self.interactive, connection.alias)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/sql.py", line 280, in emit_post_migrate_signal
    using=db)
  File "/usr/local/lib/python2.7/dist-packages/django/dispatch/dispatcher.py", line 189, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/usr/local/lib/python2.7/dist-packages/django/contrib/sites/management.py", line 20, in create_default_site
    if not Site.objects.using(using).exists():
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 586, in exists
    return self.query.has_results(using=self.db)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/query.py", line 484, in has_results
    return compiler.has_results()
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 811, in has_results
    return bool(self.execute_sql(SINGLE))
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 840, in execute_sql
    cursor.execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 79, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 98, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "django_site" does not exist
LINE 1: SELECT (1) AS "a" FROM "django_site" LIMIT 1

then I run manage.py migrate sites:

System check identified some issues:

WARNINGS:
account.EmailConfirmation.created: (fields.W161) Fixed default value provided.
    HINT: It seems you set a fixed date / time / datetime value as default for this field. This may not be what you want. If you want to have the current date as default, use `django.utils.timezone.now`
dialogos.Comment.ip_address: (fields.W900) IPAddressField has been deprecated. Support for it (except in historical migrations) will be removed in Django 1.9.
    HINT: Use GenericIPAddressField instead.
Operations to perform:
  Apply all migrations: sites
Running migrations:
  Rendering model states... DONE
  Applying sites.0001_initial... OK
Traceback (most recent call last):
  File "manage.py", line 29, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 346, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 394, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 226, in handle
    emit_post_migrate_signal(created_models, self.verbosity, self.interactive, connection.alias)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/sql.py", line 280, in emit_post_migrate_signal
    using=db)
  File "/usr/local/lib/python2.7/dist-packages/django/dispatch/dispatcher.py", line 189, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/usr/local/lib/python2.7/dist-packages/guardian/management/__init__.py", line 32, in create_anonymous_user
    User.objects.get(pk=guardian_settings.ANONYMOUS_USER_ID)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py", line 127, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 328, in get
    num = len(clone)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 144, in __len__
    self._fetch_all()
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 965, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 238, in iterator
    results = compiler.execute_sql()
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 840, in execute_sql
    cursor.execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 79, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 98, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "people_profile" does not exist
LINE 1: ...ofile"."zipcode", "people_profile"."country" FROM "people_pr...

then manage.py migrate people:

System check identified some issues:

WARNINGS:
account.EmailConfirmation.created: (fields.W161) Fixed default value provided.
    HINT: It seems you set a fixed date / time / datetime value as default for this field. This may not be what you want. If you want to have the current date as default, use `django.utils.timezone.now`
dialogos.Comment.ip_address: (fields.W900) IPAddressField has been deprecated. Support for it (except in historical migrations) will be removed in Django 1.9.
    HINT: Use GenericIPAddressField instead.
Operations to perform:
  Apply all migrations: people
Running migrations:
  Rendering model states... DONE
  Applying taggit.0001_initial... OK
  Applying taggit.0002_auto_20150616_2121... OK
  Applying people.0001_initial... OK
  Applying people.0002_auto_20160623_0404... OK
Traceback (most recent call last):
  File "manage.py", line 29, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 346, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 394, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 226, in handle
    emit_post_migrate_signal(created_models, self.verbosity, self.interactive, connection.alias)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/sql.py", line 280, in emit_post_migrate_signal
    using=db)
  File "/usr/local/lib/python2.7/dist-packages/django/dispatch/dispatcher.py", line 189, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/usr/local/lib/python2.7/dist-packages/guardian/management/__init__.py", line 39, in create_anonymous_user
    user.save()
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 734, in save
    force_update=force_update, update_fields=update_fields)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 771, in save_base
    update_fields=update_fields, raw=raw, using=using)
  File "/usr/local/lib/python2.7/dist-packages/django/dispatch/dispatcher.py", line 189, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/usr/local/lib/python2.7/dist-packages/account/models.py", line 106, in user_post_save
    Account.create(user=user)
  File "/usr/local/lib/python2.7/dist-packages/account/models.py", line 63, in create
    account.save()
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 734, in save
    force_update=force_update, update_fields=update_fields)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 762, in save_base
    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 846, in _save_table
    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 885, in _do_insert
    using=using, raw=raw)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py", line 127, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 920, in _insert
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 974, in execute_sql
    cursor.execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 79, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 98, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "account_account" does not exist
LINE 1: INSERT INTO "account_account" ("user_id", "timezone", "langu...

then manage.py migrate:

System check identified some issues:

WARNINGS:
account.EmailConfirmation.created: (fields.W161) Fixed default value provided.
    HINT: It seems you set a fixed date / time / datetime value as default for this field. This may not be what you want. If you want to have the current date as default, use `django.utils.timezone.now`
dialogos.Comment.ip_address: (fields.W900) IPAddressField has been deprecated. Support for it (except in historical migrations) will be removed in Django 1.9.
    HINT: Use GenericIPAddressField instead.
Operations to perform:
  Synchronize unmigrated apps: tasks, dialogos, modeltranslation, django_extensions, djcelery, polymorphic, agon_ratings, gis, pinax_theme_bootstrap_account, django_forms_bootstrap, catalogue, humanize, geoserver, announcements, storages, user_messages, mptt, friendlytagloader, staticfiles, geoexplorer, sitemaps, proxy, account, pinax_theme_bootstrap, pagination, autocomplete_light, messages, leaflet, api, avatar, social, security
  Apply all migrations: layers, documents, actstream, people, admin, guardian, sessions, sites, auth, tastypie, maps, contenttypes, base, upload, groups, services, taggit
Synchronizing apps without migrations:
  Creating tables...
    Creating table celery_taskmeta
    Creating table celery_tasksetmeta
    Creating table djcelery_intervalschedule
    Creating table djcelery_crontabschedule
    Creating table djcelery_periodictasks
    Creating table djcelery_periodictask
    Creating table djcelery_workerstate
    Creating table djcelery_taskstate
    Creating table account_account
    Creating table account_signupcode
    Creating table account_signupcodeextended
    Creating table account_signupcoderesult
    Creating table account_emailaddress
    Creating table account_emailconfirmation
    Creating table account_accountdeletion
    Creating table avatar_avatar
    Creating table dialogos_comment
    Creating table agon_ratings_overallrating
    Creating table agon_ratings_rating
    Creating table announcements_announcement
    Creating table announcements_dismissal
    Creating table user_messages_thread
    Creating table user_messages_userthread
    Creating table user_messages_message
    Running deferred SQL...
  Installing custom SQL...
Running migrations:
  Rendering model states... DONE
  Applying actstream.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying base.0001_initial... OK
  Applying base.0002_topiccategory_fa_class... OK
  Applying base.0003_auto_20160623_0404... OK
  Applying documents.0001_initial... OK
  Applying groups.0001_initial... OK
  Applying guardian.0001_initial... OK
  Applying layers.0001_initial... OK
  Applying services.0001_initial... OK
  Applying layers.0002_initial_step2... OK
  Applying layers.0003_auto_20160623_0404... OK
  Applying maps.0001_initial... OK
  Applying services.0002_auto_20160623_0404... OK
  Applying sessions.0001_initial... OK
  Applying tastypie.0001_initial... OK
  Applying upload.0001_initial... OK

Is that ok? How/can I restore the dump file of my previous DBs?

Thanks

Eugenio
 

From: simone.dalmasso at gmail.com
Date: Thu, 23 Jun 2016 10:55:47 +0200
Subject: Re: [GeoNode-users] database update error
To: frippe12573 at hotmail.com
CC: geonode-users at lists.osgeo.org

Hi Eugenio,
beware that the data model and django version is changed in master. This issue happens when using postgres as db and not sqllite. At the moment the way to create the new db is by doing








manage.py migrate auth

manage.py migrate sites
manage.py migrate people

manage.py migrate 
We will fix this in the future.





2016-06-23 10:27 GMT+02:00 Eugenio Trumpy <frippe12573 at hotmail.com>:



Hi all,

today I was trying to update geonode from git (custom installation on ubuntu 14.04).
I made a backup of the data from geonode and geonode_data db, then I created new DBs,
and I run syncdb --noinput, but something seems not working:

System check identified some issues:

WARNINGS:
account.EmailConfirmation.created: (fields.W161) Fixed default value provided.
    HINT: It seems you set a fixed date / time / datetime value as default for this field. This may not be what you want. If you want to have the current date as default, use `django.utils.timezone.now`
dialogos.Comment.ip_address: (fields.W900) IPAddressField has been deprecated. Support for it (except in historical migrations) will be removed in Django 1.9.
    HINT: Use GenericIPAddressField instead.
Operations to perform:
  Synchronize unmigrated apps: tasks, dialogos, modeltranslation, django_extensions, polymorphic, agon_ratings, gis, pinax_theme_bootstrap_account, django_forms_bootstrap, catalogue, humanize, geoserver, announcements, storages, user_messages, mptt, friendlytagloader, staticfiles, geoexplorer, sitemaps, proxy, account, pinax_theme_bootstrap, pagination, autocomplete_light, messages, leaflet, api, avatar, social, security
  Apply all migrations: layers, documents, actstream, people, admin, guardian, sessions, djcelery, sites, auth, tastypie, maps, contenttypes, base, upload, groups, services, taggit
Synchronizing apps without migrations:
  Creating tables...
    Creating table account_account
    Creating table account_signupcode
    Creating table account_signupcodeextended
    Creating table account_signupcoderesult
    Creating table account_emailaddress
    Creating table account_emailconfirmation
    Creating table account_accountdeletion
    Creating table avatar_avatar
    Creating table dialogos_comment
    Creating table agon_ratings_overallrating
    Creating table agon_ratings_rating
    Creating table announcements_announcement
    Creating table announcements_dismissal
    Creating table user_messages_thread
    Creating table user_messages_userthread
    Creating table user_messages_message
    Running deferred SQL...
Traceback (most recent call last):
  File "manage.py", line 29, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 346, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 394, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/syncdb.py", line 25, in handle
    call_command("migrate", **options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 120, in call_command
    return command.execute(*args, **defaults)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 179, in handle
    created_models = self.sync_apps(connection, executor.loader.unmigrated_apps)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 318, in sync_apps
    cursor.execute(statement)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 79, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 98, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 62, in execute
    return self.cursor.execute(sql)
django.db.utils.ProgrammingError: relation "people_profile" does not exist

Of course I performed the update of the dbs after run git pull on geonode dir.

Can you help me?

Eugenio
 		 	   		  

_______________________________________________

geonode-users mailing list

geonode-users at lists.osgeo.org

http://lists.osgeo.org/mailman/listinfo/geonode-users





 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20160623/d044f532/attachment-0001.html>


More information about the geonode-users mailing list