chef errors for dev environment/ util role

閲覧: 26 回
最初の未読メッセージにスキップ

Daniel Koopman

未読、
2013/03/29 14:24:512013/03/29
To: class2g...@googlegroups.com
When I run the util role for the dev environment I get

django.db.utils.DatabaseError: (1146, "Table 'class2go.django_content_type' doesn't exist")

The app role works fine and all the other elements in the run list are fine.

Is there a parameter or a pre-requisite I'm missing 

The traceback is:

STDERR: Traceback (most recent call last):
    File "./manage.py", line 10, in <module>
      execute_from_command_line(sys.argv)
    File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/core/management/__init__.py", line 443, in execute_from_command_line
      utility.execute()
    File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/core/management/__init__.py", line 382, in execute
      self.fetch_command(subcommand).run_from_argv(self.argv)
    File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/core/management/base.py", line 196, in run_from_argv
      self.execute(*args, **options.__dict__)
    File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/core/management/base.py", line 232, in execute
      output = self.handle(*args, **options)
    File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/core/management/base.py", line 371, in handle
      return self.handle_noargs(**options)
    File "/usr/local/lib/python2.7/dist-packages/South-0.7.6-py2.7.egg/south/management/commands/syncdb.py", line 90, in handle_noargs
      syncdb.Command().execute(**options)
    File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/core/management/base.py", line 232, in execute
      output = self.handle(*args, **options)
    File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/core/management/base.py", line 371, in handle
      return self.handle_noargs(**options)
    File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/core/management/commands/syncdb.py", line 110, in ha
  ndle_noargs
      emit_post_sync_signal(created_models, verbosity, interactive, db)
    File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/core/management/sql.py", line 189, in emit_post_sync_signal
      interactive=interactive, db=db)
    File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/dispatch/dispatcher.py", line 172, in send
      response = receiver(signal=self, sender=sender, **named)
    File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/contrib/auth/management/__init__.py", line 35, in create_permissions
      ctype = ContentType.objects.get_for_model(klass)
    File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/contrib/contenttypes/models.py", line 42, in get_for_model
      defaults = {'name': smart_unicode(opts.verbose_name_raw)},
    File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/db/models/manager.py", line 134, in get_or_create
      return self.get_query_set().get_or_create(**kwargs)
    File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/db/models/query.py", line 442, in get_or_create
      return self.get(**lookup), False
    File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/db/models/query.py", line 361, in get
      num = len(clone)
    File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/db/models/query.py", line 85, in __len__
      self._result_cache = list(self.iterator())
    File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/db/models/query.py", line 291, in iterator
      for row in compiler.results_iter():
    File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/db/models/sql/compiler.py", line 763, in results_iter
      for rows in self.execute_sql(MULTI):
    File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/db/models/sql/compiler.py", line 818, in execute_sql
      cursor.execute(sql, params)
    File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/djan
  go/db/backends/util.py", line 40, in execute
      return self.cursor.execute(sql, params)
    File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/db/backends/mysql/base.py", line 114, in execute
      return self.cursor.execute(query, args)
    File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
      self.errorhandler(self, exc, value)
    File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
      raise errorclass, errorvalue
  django.db.utils.DatabaseError: (1146, "Table 'class2go.django_content_type' doesn't exist")
  ---- End output of ./manage.py syncdb --migrate --noinput --database=celery ----
  Ran ./manage.py syncdb --migrate --noinput --database=celery returned 1

Anurag Sahay

未読、
2013/03/29 23:29:152013/03/29
To: class2g...@googlegroups.com

The way i got past this error was breaking my steps in the following way.

./manage.py syncdb
./manage.py migrate c2g
./manage.py migrate --database=celery

See if that works for you.

Daniel Koopman

未読、
2013/03/30 10:36:272013/03/30
To: class2g...@googlegroups.com
Thanks Anurag

I still get stopped in the same place, just with a different error:

 django.db.utils.DatabaseError: no such table: south_migrationhistory

Sef Kloninger

未読、
2013/03/30 11:22:472013/03/30
To: Daniel Koopman、class2g...@googlegroups.com
That problem is when you run migrate before syncdb.  So the steps should be:

./manage.py syncdb
./manage.py syncdb --database=celery
./manage.py migrate 
./manage.py migrate --database=celery

Migrate without parameters will migrate all apps, in which case it's djcelery and c2g.



--
You received this message because you are subscribed to the Google Groups "class2go users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to class2go-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Daniel Koopman

未読、
2013/03/30 17:45:332013/03/30
To: class2g...@googlegroups.com、Daniel Koopman
Thanks Sef

I modified the recipe to:

 command <<-EOH
        ./manage.py syncdb
        ./manage.py syncdb --database=celery
       ./manage.py migrate
        ./manage.py migrate --database=celery
        EOH
and that worked
全員に返信
投稿者に返信
転送
新着メール 0 件