briot / geneapro

Genealogical software based on the GenTech data model
http://briot.github.com/geneapro/
GNU General Public License v2.0
33 stars 8 forks source link

Launching Django yields django.db.utils.OperationalError: no such table: event_type #53

Closed changeling closed 5 years ago

changeling commented 5 years ago

I haven't had time to look yet, so I'm simply posting the error.

Launching Django yields the following:

Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x107ddad90>
Traceback (most recent call last):
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
    return self.cursor.execute(sql, params)
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 298, in execute
    return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such table: event_type

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/utils/autoreload.py", line 225, in wrapper
    fn(*args, **kwargs)
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
    autoreload.raise_last_exception()
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/utils/autoreload.py", line 248, in raise_last_exception
    raise _exception[1]
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/core/management/__init__.py", line 337, in execute
    autoreload.check_errors(django.setup)()
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/utils/autoreload.py", line 225, in wrapper
    fn(*args, **kwargs)
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/apps/registry.py", line 112, in populate
    app_config.import_models()
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/apps/config.py", line 198, in import_models
    self.models_module = import_module(models_module_name)
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/backend/geneaprove/models/__init__.py", line 27, in <module>
    from .theme import Theme, Rule, RulePart
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/backend/geneaprove/models/theme/__init__.py", line 4, in <module>
    from .rules import RuleChecker
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/backend/geneaprove/models/theme/rules.py", line 5, in <module>
    from geneaprove.views.queries import PersonSet
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/backend/geneaprove/views/queries.py", line 21, in <module>
    class PersonSet(object):
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/backend/geneaprove/views/queries.py", line 28, in PersonSet
    BMD = (models.Event_Type.PK_birth,
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/backend/geneaprove/models/base.py", line 45, in __get__
    self._cached = klass.objects.get(**self.kwargs).pk
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/db/models/query.py", line 393, in get
    num = len(clone)
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/db/models/query.py", line 250, in __len__
    self._fetch_all()
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/db/models/query.py", line 1186, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/db/models/query.py", line 54, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1065, in execute_sql
    cursor.execute(sql, params)
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/db/backends/utils.py", line 100, in execute
    return super().execute(sql, params)
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/db/backends/utils.py", line 68, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
    return self.cursor.execute(sql, params)
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
    return self.cursor.execute(sql, params)
  File "/Users/clarson/Desktop/workroom/geneapro-NEW/python_env/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 298, in execute
    return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such table: event_type
changeling commented 5 years ago

Seems to be a problem creating new database. If I have time, I'll take a look at that, but this happens when no database exists when setup.sh is run.