Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem to fill up the database #142

Open
edipretoro opened this issue Jul 11, 2018 · 0 comments
Open

Problem to fill up the database #142

edipretoro opened this issue Jul 11, 2018 · 0 comments

Comments

@edipretoro
Copy link

Hi,

I wanted to test cobweb as it could be useful for a research project I'm working on (the research project is named PROMISE, and its goal is to set up a strategic plan to archive belgian web; you can find more information about this project at https://www.kbr.be/en/promise-project).

Unfortunately, and if I was able to install cobweb with docker, I wasn't able to fill up the database. Here is the output when I run the following command docker-compose run web python3 manage.py loaddata toy_data.json:

Starting cobweb-django_solr_1 ... Done
Starting cobweb-django_db_1   ... Done
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
    return self.cursor.execute(sql, params)
psycopg2.ProgrammingError: relation "core_user" does not exist
LINE 1: UPDATE "core_user" SET "password" = 'pbkdf2_sha256$100000$yj...
               ^


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

Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 365, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 335, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.6/site-packages/django/core/management/commands/loaddata.py", line 72, in handle
    self.loaddata(fixture_labels)
  File "/usr/local/lib/python3.6/site-packages/django/core/management/commands/loaddata.py", line 113, in loaddata
    self.load_label(fixture_label)
  File "/usr/local/lib/python3.6/site-packages/django/core/management/commands/loaddata.py", line 177, in load_label
    obj.save(using=self.using)
  File "/usr/local/lib/python3.6/site-packages/django/core/serializers/base.py", line 205, in save
    models.Model.save_base(self.object, using=using, raw=True, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/django/db/models/base.py", line 759, in save_base
    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
  File "/usr/local/lib/python3.6/site-packages/django/db/models/base.py", line 823, in _save_table
    forced_update)
  File "/usr/local/lib/python3.6/site-packages/django/db/models/base.py", line 872, in _do_update
    return filtered._update(values) > 0
  File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py", line 709, in _update
    return query.get_compiler(self.db).execute_sql(CURSOR)
  File "/usr/local/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1377, in execute_sql
    cursor = super().execute_sql(result_type)
  File "/usr/local/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1066, in execute_sql
    cursor.execute(sql, params)
  File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 100, in execute
    return super().execute(sql, params)
  File "/usr/local/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 "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: Problem installing fixture '/code/toy_data.json': Could not load core.User(pk=2): relation "core_user" does not exist
LINE 1: UPDATE "core_user" SET "password" = 'pbkdf2_sha256$100000$yj...
               ^

I'm not familiar with Django, but I guess this mean the core_user table doesn't exist. Did I miss something trivial? I've checked with docker-compose ps if the db server was up and it is as you can see with the following output:

           Name                         Command               State            Ports         
---------------------------------------------------------------------------------------------
cobweb-django_db_1           docker-entrypoint.sh postgres    Up       0.0.0.0:5432->5432/tcp
cobweb-django_node_1         npx webpack --config webpa ...   Exit 0                         
cobweb-django_production_1   echo Built production web  ...   Exit 0                         
cobweb-django_sass_1         sass --watch cobweb.scss:c ...   Up                             
cobweb-django_solr_1         docker-entrypoint.sh solr- ...   Up       0.0.0.0:8983->8983/tcp
cobweb-django_web_1          python manage.py runserver ...   Up       0.0.0.0:8000->8000/tcp

Thanks in advance for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant