Santandersecurityresearch/asvs

Step 6/8 : RUN python manage.py makemigrations fails

znb opened this issue · 4 comments

znb commented

Howdy

Attempting build on OS X

Docker version 18.05.0-ce, build f150324
docker-machine version 0.15.0, build b48dc28

The script errors out on step 6 with the following:

Step 6/8 : RUN python manage.py makemigrations
 ---> Running in 5a070da7960b
You are trying to add a non-nullable field 'project_level' to projects without a default; we can't do that (the database needs something to populate existing rows).
Please select a fix:
 1) Provide a one-off default now (will be set on all existing rows with a null value for this column)
 2) Quit, and let me add a default in models.py
Select an option: Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/usr/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/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/lib/python3.6/site-packages/django/core/management/base.py", line 335, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python3.6/site-packages/django/core/management/commands/makemigrations.py", line 159, in handle
    migration_name=self.migration_name,
  File "/usr/lib/python3.6/site-packages/django/db/migrations/autodetector.py", line 44, in changes
    changes = self._detect_changes(convert_apps, graph)
  File "/usr/lib/python3.6/site-packages/django/db/migrations/autodetector.py", line 183, in _detect_changes
    self.generate_added_fields()
  File "/usr/lib/python3.6/site-packages/django/db/migrations/autodetector.py", line 824, in generate_added_fields
    self._generate_added_field(app_label, model_name, field_name)
  File "/usr/lib/python3.6/site-packages/django/db/migrations/autodetector.py", line 844, in _generate_added_field
    field.default = self.questioner.ask_not_null_addition(field_name, model_name)
  File "/usr/lib/python3.6/site-packages/django/db/migrations/questioner.py", line 151, in ask_not_null_addition
    "Quit, and let me add a default in models.py",
  File "/usr/lib/python3.6/site-packages/django/db/migrations/questioner.py", line 96, in _choice_input
    result = input("Select an option: ")
EOFError: EOF when reading a line
The command '/bin/sh -c python manage.py makemigrations' returned a non-zero code: 1

Let me know if you need any more information/testing from my side.

I can confirm this project is currently broken because of this bug.

Docker version 18.03.1-ce, build 9ee9f40
docker-machine version 0.14.0, build 89b8332

Hello, sorry about that. I've just pushed a change and tested the docker build it should work fine now. GIve it a go and let me know if you are still having issues.

@amx1978 Thanks for fixing it so fast! Can confirm that it is now working after your fix :)

Awesome glad it's sorted. Closing the issue now.

Commit ID: 1c0e2cb