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

Error importing CaseFactory() #238

Closed
louisgv opened this issue Nov 19, 2017 · 6 comments

Comments

@louisgv
Copy link
Contributor

commented Nov 19, 2017

I'm trying to importing some nodule data to test with the interface. Following this guide: #149 (comment)

Expected Behavior

I should be able to run this in the console:

from backend.cases.factories import *
case = CaseFactory()

Without seeing any error

Current Behavior

The following error was thrown:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
psycopg2.ProgrammingError: relation "images_imageseries" does not exist
LINE 1: INSERT INTO "images_imageseries" ("patient_id", "series_inst...
                    ^


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

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/usr/local/lib/python3.6/dist-packages/factory/base.py", line 69, in __call__
    return cls.create(**kwargs)
  File "/usr/local/lib/python3.6/dist-packages/factory/base.py", line 622, in create
    attrs = cls.attributes(create=True, extra=kwargs)
  File "/usr/local/lib/python3.6/dist-packages/factory/base.py", line 453, in attributes
    force_sequence=force_sequence,
  File "/usr/local/lib/python3.6/dist-packages/factory/containers.py", line 324, in build
    return stub.__fill__()
  File "/usr/local/lib/python3.6/dist-packages/factory/containers.py", line 83, in __fill__
    res[attr] = getattr(self, attr)
  File "/usr/local/lib/python3.6/dist-packages/factory/containers.py", line 108, in __getattr__
    val = val.evaluate(self, self.__containers)
  File "/usr/local/lib/python3.6/dist-packages/factory/containers.py", line 227, in evaluate
    containers=containers,
  File "/usr/local/lib/python3.6/dist-packages/factory/declarations.py", line 324, in evaluate
    return self.generate(sequence, obj, create, defaults)
  File "/usr/local/lib/python3.6/dist-packages/factory/declarations.py", line 412, in generate
    return subfactory.simple_generate(create, **params)
  File "/usr/local/lib/python3.6/dist-packages/factory/base.py", line 709, in simple_generate
    return cls.generate(strategy, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/factory/base.py", line 676, in generate
    return action(**kwargs)
  File "/usr/local/lib/python3.6/dist-packages/factory/base.py", line 623, in create
    return cls._generate(True, attrs)
  File "/usr/local/lib/python3.6/dist-packages/factory/base.py", line 548, in _generate
    obj = cls._prepare(create, **attrs)
  File "/usr/local/lib/python3.6/dist-packages/factory/base.py", line 523, in _prepare
    return cls._create(model_class, *args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/factory/django.py", line 181, in _create
    return manager.create(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/django/db/models/query.py", line 394, in create
    obj.save(force_insert=True, using=self.db)
  File "/usr/local/lib/python3.6/dist-packages/django/db/models/base.py", line 807, in save
    force_update=force_update, update_fields=update_fields)
  File "/usr/local/lib/python3.6/dist-packages/django/db/models/base.py", line 837, in save_base
    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
  File "/usr/local/lib/python3.6/dist-packages/django/db/models/base.py", line 923, in _save_table
    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
  File "/usr/local/lib/python3.6/dist-packages/django/db/models/base.py", line 962, in _do_insert
    using=using, raw=raw)
  File "/usr/local/lib/python3.6/dist-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/django/db/models/query.py", line 1076, in _insert
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/usr/local/lib/python3.6/dist-packages/django/db/models/sql/compiler.py", line 1099, in execute_sql
    cursor.execute(sql, params)
  File "/usr/local/lib/python3.6/dist-packages/django/db/backends/utils.py", line 80, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/usr/local/lib/python3.6/dist-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python3.6/dist-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/usr/local/lib/python3.6/dist-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.6/dist-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "images_imageseries" does not exist
LINE 1: INSERT INTO "images_imageseries" ("patient_id", "series_inst...
                    ^

Possible Solution

Steps to Reproduce

  1. Following the instruction in this guide #149 (comment)

Context (Environment)

Detailed Description

Possible Implementation

Checklist before submitting

  • I have confirmed this using the officially supported Docker Compose setup using the local.yml configuration and ensured that I built the containers again and they reflect the most recent version of the project at the HEAD commit on the master branch
  • I have searched through the other currently open issues and am confident this is not a duplicate of an existing bug
  • I provided a minimal code snippet or list of steps that reproduces the bug.
  • I provided screenshots where appropriate
  • I filled out all the relevant sections of this template
@reubano

This comment has been minimized.

Copy link
Contributor

commented Nov 26, 2017

Not able to replicate your error. What os and docker version?

@isms

This comment has been minimized.

Copy link
Contributor

commented Nov 27, 2017

@louisgv Seeing relation "images_imageseries" does not exist indicates to me that this table is not found at all, which means that the command which migrates the database up to the present schema (python manage.py migrate) was not run.

What were the exact commands you ran to get an interactive shell?

@musale

This comment has been minimized.

Copy link
Contributor

commented Dec 4, 2017

@isms I came across a similar error doing the steps and I fixed it with

$ docker-compose -f local.yml run interface python manage.py makemigrations
$ docker-compose -f local.yml run interface python manage.py migrate

@louisgv

This comment has been minimized.

Copy link
Contributor Author

commented Dec 4, 2017

@isms sorry for the late respond. Finals' been drowning me lately :p... I'm pretty sure I used the exact command in the tutorial. I did it before and it worked, but after several pull, it just stopped working.

@musale I will give that a try

@isms isms referenced this issue Dec 4, 2017
2 of 5 tasks complete
@reubano

This comment has been minimized.

Copy link
Contributor

commented Dec 12, 2017

@louisgv any luck?

@isms

This comment has been minimized.

Copy link
Contributor

commented Jan 3, 2018

Closing as norepro

@isms isms closed this Jan 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.