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 on first run of ./dev sampledata #110

Open
courtneycb opened this issue Oct 23, 2019 · 0 comments
Open

Error on first run of ./dev sampledata #110

courtneycb opened this issue Oct 23, 2019 · 0 comments
Labels
bug Something isn't working infrastructure

Comments

@courtneycb
Copy link
Contributor

courtneycb commented Oct 23, 2019

This seems to have been introduced in #83

On the first run of sampledata after a fresh build/start/update the error pasted at the bottom of this issue occurs.

This happens when we try to create a batch of question attempts (error in AttemptFactory.py). so far I am unsure what the exact issue is. But as this is only a local error and the sampledata command runs fine on a second run this is low priority.

Research studies loaded.
Traceback (most recent call last):
  File "./manage.py", line 27, in <module>
    execute_from_command_line(sys.argv)
  File "/docker_venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/docker_venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/docker_venv/lib/python3.6/site-packages/django/core/management/base.py", line 316, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/docker_venv/lib/python3.6/site-packages/django/core/management/base.py", line 353, in execute
    output = self.handle(*args, **options)
  File "/codewof/codewof/general/management/commands/sampledata.py", line 83, in handle
    AttemptFactory.create_batch(size=50)
  File "/docker_venv/lib/python3.6/site-packages/factory/base.py", line 576, in create_batch
    return [cls.create(**kwargs) for _ in range(size)]
  File "/docker_venv/lib/python3.6/site-packages/factory/base.py", line 576, in <listcomp>
    return [cls.create(**kwargs) for _ in range(size)]
  File "/docker_venv/lib/python3.6/site-packages/factory/base.py", line 564, in create
    return cls._generate(enums.CREATE_STRATEGY, kwargs)
  File "/docker_venv/lib/python3.6/site-packages/factory/django.py", line 141, in _generate
    return super(DjangoModelFactory, cls)._generate(strategy, params)
  File "/docker_venv/lib/python3.6/site-packages/factory/base.py", line 501, in _generate
    return step.build()
  File "/docker_venv/lib/python3.6/site-packages/factory/builder.py", line 272, in build
    step.resolve(pre)
  File "/docker_venv/lib/python3.6/site-packages/factory/builder.py", line 221, in resolve
    self.attributes[field_name] = getattr(self.stub, field_name)
  File "/docker_venv/lib/python3.6/site-packages/factory/builder.py", line 375, in __getattr__
    extra=context,
  File "/docker_venv/lib/python3.6/site-packages/factory/declarations.py", line 196, in evaluate
    value = next(iter(self.iterator))
StopIteration```
@courtneycb courtneycb added the bug Something isn't working label Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working infrastructure
Development

No branches or pull requests

2 participants