EVE-Tools / vagrant-element43

DEPRECATED - This repository contains the configuration of our unified virtual development environment.
1 stars 1 forks source link

Fails on [Migrate apps.common] #4

Closed thomas-frantz closed 8 years ago

thomas-frantz commented 8 years ago

Tried from a fresh VM provision, twice:

TASK: [Migrate apps.common] *************************************************** 
failed: [vagrant43] => {"cmd": "python manage.py migrate --noinput --settings=element43.settings.local --pythonpath=/home/element43/element43/webapp apps.common", "failed": true, "path": "/home/element43/virtualenvs/element43/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "state": "absent", "syspath": ["/root/.ansible/tmp/ansible-tmp-1448657800.51-280894122828679", "/usr/lib/python2.7", "/usr/lib/python2.7/plat-x86_64-linux-gnu", "/usr/lib/python2.7/lib-tk", "/usr/lib/python2.7/lib-old", "/usr/lib/python2.7/lib-dynload", "/usr/local/lib/python2.7/dist-packages", "/usr/lib/python2.7/dist-packages", "/usr/lib/pymodules/python2.7"]}
msg: 
:stderr: CommandError: App 'apps.common' does not have migrations (you cannot selectively sync unmigrated apps)

FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/root/initapp.retry

vagrant43                  : ok=5    changed=1    unreachable=0    failed=1 

Only thing I've changed is in the vagrantfile, I changed the port forward to 8585 from 8080.

I'm running debian host (Hydrogen Linux, actually), with VirtualBox 5.0.10. The guest additions for 5.0.10 also failed to install for 5.0.10. I'll have to go hunt that error down if it's relevant.

zweizeichen commented 8 years ago

Good find! I forgot to update the Ansible scripts as I upgraded the Django version - the migration process is a little different now. I'll publish a patch within the next few days. For now you can try to run the database migrations manually: https://docs.djangoproject.com/en/1.8/ref/django-admin/#django-admin-migrate

thomas-frantz commented 8 years ago

Hey, thanks!

I'll try that and report.

thomas-frantz commented 8 years ago

So, I had actually tried doing doing it manually. Though, I don't have much experience with python or django, so I'm not quite sure what the format of the command should be.

I've tried:

./manage.py migrate eve_db

which results in:

(element43)~element43/element43/webapp (master ✘)✹✭ ᐅ ./manage.py migrate eve_db
Operations to perform:
  Apply all migrations: eve_db
Running migrations:
  No migrations to apply.
  Your models have changes that are not yet reflected in a migration, and so won't be applied.
  Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.

As well as:

./manage.py migrate eve_db apps.common

which results in:

CommandError: Cannot find a migration matching 'apps.common' from app 'eve_db'.

And

./manage.py migrate apps.common

Which results in the same error above.

I've tried

./manage.py makemigrations

Which results in:

(element43)~element43/element43/webapp (master ✘)✹✭ ᐅ ./manage.py makemigrations
Migrations for 'eve_db':
  0004_auto_20151128_2052.py:
    - Change Meta options on invuniquename
Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/element43/virtualenvs/element43/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/home/element43/virtualenvs/element43/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 346, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/element43/virtualenvs/element43/local/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/element43/virtualenvs/element43/local/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/home/element43/virtualenvs/element43/local/lib/python2.7/site-packages/django/core/management/commands/makemigrations.py", line 143, in handle
    self.write_migration_files(changes)
  File "/home/element43/virtualenvs/element43/local/lib/python2.7/site-packages/django/core/management/commands/makemigrations.py", line 172, in write_migration_files
    with open(writer.path, "wb") as fh:
IOError: [Errno 13] Permission denied: u'/home/element43/virtualenvs/element43/local/lib/python2.7/site-packages/eve_db/migrations/0004_auto_20151128_2052.py'

So, not quite sure what the command should be.

edit:

Also tried:

(element43)~element43/element43/webapp (master ✘)✹✭ ᐅ django-admin migrate apps.common
Traceback (most recent call last):
  File "/home/element43/virtualenvs/element43/bin/django-admin", line 11, in <module>
    sys.exit(execute_from_command_line())
  File "/home/element43/virtualenvs/element43/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/home/element43/virtualenvs/element43/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 303, in execute
    settings.INSTALLED_APPS
  File "/home/element43/virtualenvs/element43/local/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__
    self._setup(name)
  File "/home/element43/virtualenvs/element43/local/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup
    self._wrapped = Settings(settings_module)
  File "/home/element43/virtualenvs/element43/local/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named element43.settings.local
thomas-frantz commented 8 years ago

So, I got the django-admin command to work (I had to add /home/element43/element43/webapp to the PYTHONPATH). Now it's giving the same things as before when just running ./manage.py

zweizeichen commented 8 years ago

Feel free to ask if you have any more questions.

thomas-frantz commented 8 years ago

Just wanted to let you know it worked flawlessly. Thanks!