Skip to contentSkip to conversation

Issue starting Toaster

DISCUSSION Barros Pena, Belen 2 participants 2 messages Jan 13, 2016

lore
Share & tools
lore
#0 lore raw

This is happening to me with both master and toaster-next at the moment. If I try to start when no toaster.sqlite file exists, Toaster fails to start. This is the error I see:

The system will start.
Check if toaster can listen on 0.0.0.0:8000
OK
Operations to perform:
Synchronize unmigrated apps: staticfiles, messages, toastermain,
bldcollector, toastergui, humanize
Apply all migrations: sessions, admin, auth, contenttypes, orm,
bldcontrol
Synchronizing apps without migrations:
Creating tables...
Running deferred SQL...
Installing custom SQL...
Running migrations:
Rendering model states... DONE
Applying orm.0001_initial...Traceback (most recent call last):
File "../bitbake/bin/../lib/toaster/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/core/mana gement/__init__.py", line 354, in execute_from_command_line
utility.execute()
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/core/mana gement/__init__.py", line 346, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/core/mana gement/base.py", line 394, in run_from_argv
self.execute(*args, **cmd_options)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/core/mana gement/base.py", line 445, in execute
output = self.handle(*args, **options)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/core/mana gement/commands/migrate.py", line 222, in handle
executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/db/migrat ions/executor.py", line 110, in migrate
self.apply_migration(states[migration], migration, fake=fake,
fake_initial=fake_initial)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/db/migrat ions/executor.py", line 148, in apply_migration
state = migration.apply(state, schema_editor)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/db/migrat ions/migration.py", line 115, in apply
operation.database_forwards(self.app_label, schema_editor, old_state,
project_state)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/db/migrat ions/operations/models.py", line 59, in database_forwards
schema_editor.create_model(model)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/db/backen ds/base/schema.py", line 286, in create_model
self.execute(sql, params or None)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/db/backen ds/base/schema.py", line 111, in execute
cursor.execute(sql, params)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/db/backen ds/utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/db/backen ds/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/db/utils. py", line 98, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/db/backen ds/utils.py", line 62, in execute
return self.cursor.execute(sql)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/db/backen ds/sqlite3/base.py", line 316, in execute
return Database.Cursor.execute(self, query)
django.db.utils.OperationalError: table "orm_bitbakeversion" already exists Failed migrations, aborting system start
Failed start.

I am using a completely clean clone for good measure, but I might just be doing something silly. Any ideas about what could be going on?

Thanks!

Belén

#1 lore raw

On 13 January 2016 at 11:30, Barros Pena, Belen <[email protected]

Quoted 6 lines

wrote:

This is happening to me with both master and toaster-next at the moment. If I try to start when no toaster.sqlite file exists, Toaster fails to start. This is the error I see:

I can't reproduce this in my existing check out or a fresh clone.

This is particularly odd if you have removed the database, as the table can only already exist if the migrations are running against an existing database (as 001_initial is the first migration and orm_bitbakeversion is the first table it creates).

Some suggestions/questions:

Have you *really* removed the toaster.sqlite file in the directory where you're starting Toaster? (I think you have, given your comment, but it might be worth removing all the toaster.sqlite databases you have. It might be that there is an existing db that's not marked for migrations correctly, so Toaster is trying to apply them again.)

Have you ever modified settings.py to use a different sqlite database?

Have you removed all *.pyc files from your clone?

Is this on Linux or Mac?

Which version of Django are you using?

I'll try to make a patch to definitively log out whether you are using an existing db or not, which might help.

Elliot

Quoted 102 lines

The system will start.
Check if toaster can listen on 0.0.0.0:8000
OK
Operations to perform:
Synchronize unmigrated apps: staticfiles, messages, toastermain,
bldcollector, toastergui, humanize
Apply all migrations: sessions, admin, auth, contenttypes, orm,
bldcontrol
Synchronizing apps without migrations:
Creating tables...
Running deferred SQL...
Installing custom SQL...
Running migrations:
Rendering model states... DONE
Applying orm.0001_initial...Traceback (most recent call last):
File "../bitbake/bin/../lib/toaster/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/core/mana gement/__init__.py", line 354, in execute_from_command_line
utility.execute()
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/core/mana gement/__init__.py", line 346, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/core/mana gement/base.py", line 394, in run_from_argv
self.execute(*args, **cmd_options)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/core/mana gement/base.py", line 445, in execute
output = self.handle(*args, **options)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/core/mana gement/commands/migrate.py", line 222, in handle
executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/db/migrat ions/executor.py", line 110, in migrate
self.apply_migration(states[migration], migration, fake=fake,
fake_initial=fake_initial)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/db/migrat ions/executor.py", line 148, in apply_migration
state = migration.apply(state, schema_editor)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/db/migrat ions/migration.py", line 115, in apply
operation.database_forwards(self.app_label, schema_editor, old_state,
project_state)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/db/migrat ions/operations/models.py", line 59, in database_forwards
schema_editor.create_model(model)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/db/backen ds/base/schema.py", line 286, in create_model
self.execute(sql, params or None)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/db/backen ds/base/schema.py", line 111, in execute
cursor.execute(sql, params)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/db/backen ds/utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/db/backen ds/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/db/utils. py", line 98, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/db/backen ds/utils.py", line 62, in execute
return self.cursor.execute(sql)
File
"/home/yocto/master/venv/local/lib/python2.7/site-packages/django/db/backen ds/sqlite3/base.py", line 316, in execute
return Database.Cursor.execute(self, query)
django.db.utils.OperationalError: table "orm_bitbakeversion" already exists Failed migrations, aborting system start
Failed start.

I am using a completely clean clone for good measure, but I might just be doing something silly. Any ideas about what could be going on?

Thanks!

Belén

--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster

Signature · 3 lines
Elliot Smith
Software Engineer
Intel Open Source Technology Centre