Need help with Production toaster setup
A message that is not in the archive (sent off-list or not yet received): [email protected]
A month or so ago, I set up a production toaster instance using the poky master branch.
Our projects were building with Daisy. Everything was working fine.
For various reasons, I needed to redo the production instance and that involved recloning the poky master repo, and now I¹m having issuesŠ
After recloning poky and restarting the server, all my builds with the build logging turned on started throwing weird errors complaining like this:
ERROR: Field 'project_id' doesn't have a default value <traceback omitted>
And :
ERROR:
Traceback (most recent call last):
File "/poky/bitbake/lib/bb/ui/toasterui.py", line 191, in main
buildinfohelper.store_started_task(event)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 653, instore_started_task
recipe_information =self._get_recipe_information_from_taskfile(event.taskfile)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 551, in_get_recipe_information_from_taskfile
layer_version_obj = self._get_layer_version_for_path(localfilepath)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 533, in_get_layer_version_for_path
assert 'build' in self.internal_state
AssertionError
So I figured that there was probably some difference of opinion between the client and the server about the schema; I tried running the Œsyncdb¹ and Œmigrate orm¹ commands again on the server but that didn¹t help.
---
So next I figured I would just delete the Œtoaster¹ database and start
over. I tried going into mysql and dropping the toaster database,
recreating it, and then redoing the two python commands, but that results in this error from the migrate orm command:
python bitbake/lib/toaster/manage.py migrate orm
Running migrations for orm:
- Migrating forwards to 0007_auto__add_helptext.
Quoted 3 lines
orm:0001_initial
orm:0002_auto__add_field_build_timespent
orm:0003_timespent
- Migration 'orm:0003_timespent' is marked for no-dry-run.
Quoted 2 lines
orm:0004_auto__add_field_package_installed_name
orm:0005_auto__add_target_image_file__add_target_file__add_field_variablehi stor
FATAL ERROR - The following SQL query failed: ALTER TABLE orm_build ADD COLUMN timespent integer NOT NULL DEFAULT 0;
The error was: (1060, "Duplicate column name 'timespent'")
RuntimeError: Cannot reverse this migration. 'Target.file_name' and its values cannot be restored.
This was all done while working on the daisy branch.
So, then I tried the delete/recreate database trick again and changed back to the master branch. Now I can run the two python commands ok, but my daisy clients are back to throwing the assert errors...
So, a few questions:
- Does it still work to run the production server on the master and clients running daisy, or do I have to use the daisy version of the production server, or do I need something newer than daisy but not as new as master?
- If for whatever reason I need to recreate the database, what are the exact steps that I need to do to delete/recreate?
It seems like just dropping the Œtoaster¹ database and recreating it is insufficient, but I am not sure what else to do.
The wiki pages are a bit vague on all this stuff, thanks for any help.
Craig
Hi Craig,
A patch submitted 15 minutes ago may solve your problem, it sounds similar to the problem that appeared after daisy in my script that did:
bitbake --server-only ...
bitbake --observe-only ... ToasterUI
bitbake <some-image>
With recent releases the 'bitbake <some-image>' fires before the ToasterUI is ready (2nd command) to read events. The patch in https://bugzilla.yoctoproject.org/show_bug.cgi?id=6504 writes a message to the log file. You can change your script to block until that log message appears, before launching a build - if that's your problem.
Hope this helps,
Dave Lerner
Quoted 97 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Neth, Craig Allen
Sent: Thursday, July 03, 2014 3:34 PM
To: [email protected]
Subject: [Toaster] Need help with Production toaster setupA month or so ago, I set up a production toaster instance using the poky master branch.
Our projects were building with Daisy. Everything was working fine.For various reasons, I needed to redo the production instance and that involved recloning the poky master repo, and now I¹m having issuesŠ
After recloning poky and restarting the server, all my builds with the build logging turned on started throwing weird errors complaining like this:
ERROR: Field '
project_id' doesn't have a default value <traceback omitted>And :
ERROR:
Traceback (most recent call last):
File "/poky/bitbake/lib/bb/ui/toasterui.py", line 191, in main
buildinfohelper.store_started_task(event)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 653, instore_started_task
recipe_information=self._get_recipe_information_from_taskfile(event.taskfile)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 551, in_get_recipe_information_from_taskfile
layer_version_obj=self._get_layer_version_for_path(localfilepath)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 533, in_get_layer_version_for_path
assert 'build' in self.internal_state
AssertionErrorSo I figured that there was probably some difference of opinion between the client and the server about the schema; I tried running the Œsyncdb¹ and Œmigrate orm¹ commands again on the server but that didn¹t help.
---
So next I figured I would just delete the Œtoaster¹ database and start
over. I tried going into mysql and dropping the toaster database,
recreating it, and then redoing the two python commands, but that results in this error from the migrate orm command:python
bitbake/lib/toaster/manage.pymigrate orm
Running migrations for orm:
- Migrating forwards to 0007_auto__add_helptext.Quoted 3 lines
orm:0001_initial
orm:0002_auto__add_field_build_timespent
orm:0003_timespent- Migration 'orm:0003_timespent' is marked for no-dry-run.
Quoted 2 lines
orm:0004_auto__add_field_package_installed_name
orm:0005_auto__add_target_image_file__add_target_file__add_field_variablehi stor
FATAL ERROR - The following SQL query failed: ALTER TABLEorm_buildADD COLUMNtimespentinteger NOT NULL DEFAULT 0;
The error was: (1060, "Duplicate column name 'timespent'")
RuntimeError: Cannot reverse this migration. 'Target.file_name' and its values cannot be restored.This was all done while working on the daisy branch.
So, then I tried the delete/recreate database trick again and changed back to the master branch. Now I can run the two python commands ok, but my daisy clients are back to throwing the assert errors...
So, a few questions:
- Does it still work to run the production server on the master and clients running daisy, or do I have to use the daisy version of the production server, or do I need something newer than daisy but not as new as master?
- If for whatever reason I need to recreate the database, what are the exact steps that I need to do to delete/recreate?
It seems like just dropping the Œtoaster¹ database and recreating it is insufficient, but I am not sure what else to do.The wiki pages are a bit vague on all this stuff, thanks for any help.
Craig
--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster
Hi Dave,
Thanks for the quick response!
I had previous experienced the problem you mentioned and worked around it by adding a sleep between the —observe-only and the bitbake command. Without the sleep, as you mention the events were just getting dropped. It’s nice to see a proper fix for that, however.
But I don’t think that’s what’s happening now; from the tracebacks it looks like the clients are sending events to the database but it’s not setup the way they expect...
My suspicion is that the schemas have changed but I don’t know how to get my database back into a state where it matches the schema the client expects.
Craig
Quoted 122 lines · Dave
Hi Craig,
A patch submitted 15 minutes ago may solve your problem, it sounds similar to the problem that appeared after daisy in my script that did:
bitbake --server-only ...
bitbake --observe-only ... ToasterUI
bitbake <some-image>With recent releases the 'bitbake <some-image>' fires before the ToasterUI is ready (2nd command) to read events. The patch in
https://bugzilla.yoctoproject.org/show_bug.cgi?id=6504 writes a message to the log file. You can change your script to block until that log message appears, before launching a build - if that's your problem.Hope this helps,
Dave LernerQuoted 104 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Neth, Craig Allen
Sent: Thursday, July 03, 2014 3:34 PM
To: [email protected]
Subject: [Toaster] Need help with Production toaster setupA month or so ago, I set up a production toaster instance using the poky master branch.
Our projects were building with Daisy. Everything was working fine.For various reasons, I needed to redo the production instance and that involved recloning the poky master repo, and now I¹m having issuesŠ
After recloning poky and restarting the server, all my builds with the build logging turned on started throwing weird errors complaining like this:
ERROR: Field '
project_id' doesn't have a default value <traceback omitted>And :
ERROR:
Traceback (most recent call last):
File "/poky/bitbake/lib/bb/ui/toasterui.py", line 191, in main
buildinfohelper.store_started_task(event)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 653, instore_started_task
recipe_information=self._get_recipe_information_from_taskfile(event.taskfile)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 551, in_get_recipe_information_from_taskfile
layer_version_obj=self._get_layer_version_for_path(localfilepath)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 533, in_get_layer_version_for_path
assert 'build' in self.internal_state
AssertionErrorSo I figured that there was probably some difference of opinion between the client and the server about the schema; I tried running the Œsyncdb¹ and Œmigrate orm¹ commands again on the server but that didn¹t help.
---
So next I figured I would just delete the Œtoaster¹ database and start
over. I tried going into mysql and dropping the toaster database,
recreating it, and then redoing the two python commands, but that results
in this error from the migrate orm command:python
bitbake/lib/toaster/manage.pymigrate orm
Running migrations for orm:
- Migrating forwards to 0007_auto__add_helptext.Quoted 3 lines
orm:0001_initial
orm:0002_auto__add_field_build_timespent
orm:0003_timespent- Migration 'orm:0003_timespent' is marked for no-dry-run.
Quoted 2 lines
orm:0004_auto__add_field_package_installed_name
orm:0005_auto__add_target_image_file__add_target_file__add_field_variable hi
stor
FATAL ERROR - The following SQL query failed: ALTER TABLEorm_buildADD
COLUMNtimespentinteger NOT NULL DEFAULT 0;
The error was: (1060, "Duplicate column name 'timespent'")
RuntimeError: Cannot reverse this migration. 'Target.file_name' and its values cannot be restored.This was all done while working on the daisy branch.
So, then I tried the delete/recreate database trick again and changed back
to the master branch. Now I can run the two python commands ok, but my daisy clients are back to throwing the assert errors...So, a few questions:
- Does it still work to run the production server on the master and clients running daisy, or do I have to use the daisy version of the production server, or do I need something newer than daisy but not as new
as master?- If for whatever reason I need to recreate the database, what are the exact steps that I need to do to delete/recreate?
It seems like just dropping the Œtoaster¹ database and recreating it is insufficient, but I am not sure what else to do.The wiki pages are a bit vague on all this stuff, thanks for any help.
Craig
--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster
Hi Craig,
Did you delete your old database and recreate it using the current clone of poky as shown on
https://wiki.yoctoproject.org/wiki/Setting_up_a_local_instance_of_Toaster
that is, running the database creation/migration commands that execute in
'source toaster start'?
-dave
Quoted 153 lines
-----Original Message-----
From: Neth, Craig Allen [mailto:[email protected]]
Sent: Thursday, July 03, 2014 4:05 PM
To: Lerner, Dave
Cc: [email protected]
Subject: Re: Need help with Production toaster setupHi Dave,
Thanks for the quick response!
I had previous experienced the problem you mentioned and worked around it by adding a sleep between the —observe-only and the bitbake command. Without the sleep, as you mention the events were just getting dropped. It’s nice to see a proper fix for that, however.
But I don’t think that’s what’s happening now; from the tracebacks it looks like the clients are sending events to the database but it’s not setup the way they expect...
My suspicion is that the schemas have changed but I don’t know how to get my database back into a state where it matches the schema the client expects.
Craig
Quoted 122 lines · Dave
Hi Craig,
A patch submitted 15 minutes ago may solve your problem, it sounds similar to the problem that appeared after daisy in my script that did:
bitbake --server-only ...
bitbake --observe-only ... ToasterUI
bitbake <some-image>With recent releases the 'bitbake <some-image>' fires before the ToasterUI is ready (2nd command) to read events. The patch in
https://bugzilla.yoctoproject.org/show_bug.cgi?id=6504 writes a message to the log file. You can change your script to block until that log message appears, before launching a build - if that's your problem.Hope this helps,
Dave LernerQuoted 104 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Neth, Craig Allen
Sent: Thursday, July 03, 2014 3:34 PM
To: [email protected]
Subject: [Toaster] Need help with Production toaster setupA month or so ago, I set up a production toaster instance using the poky master branch.
Our projects were building with Daisy. Everything was working fine.For various reasons, I needed to redo the production instance and that involved recloning the poky master repo, and now I¹m having issuesŠ
After recloning poky and restarting the server, all my builds with the build logging turned on started throwing weird errors complaining like this:
ERROR: Field '
project_id' doesn't have a default value <traceback omitted>And :
ERROR:
Traceback (most recent call last):
File "/poky/bitbake/lib/bb/ui/toasterui.py", line 191, in main
buildinfohelper.store_started_task(event)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 653, instore_started_task
recipe_information=self._get_recipe_information_from_taskfile(event.taskfile)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 551, in_get_recipe_information_from_taskfile
layer_version_obj=self._get_layer_version_for_path(localfilepath)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 533, in_get_layer_version_for_path
assert 'build' in self.internal_state
AssertionErrorSo I figured that there was probably some difference of opinion between the client and the server about the schema; I tried running the Œsyncdb¹ and Œmigrate orm¹ commands again on the server but that didn¹t help.
---
So next I figured I would just delete the Œtoaster¹ database and start
over. I tried going into mysql and dropping the toaster database,
recreating it, and then redoing the two python commands, but that results
in this error from the migrate orm command:python
bitbake/lib/toaster/manage.pymigrate orm
Running migrations for orm:
- Migrating forwards to 0007_auto__add_helptext.Quoted 3 lines
orm:0001_initial
orm:0002_auto__add_field_build_timespent
orm:0003_timespent- Migration 'orm:0003_timespent' is marked for no-dry-run.
Quoted 2 lines
orm:0004_auto__add_field_package_installed_name
orm:0005_auto__add_target_image_file__add_target_file__add_field_variable hi
stor
FATAL ERROR - The following SQL query failed: ALTER TABLEorm_buildADD
COLUMNtimespentinteger NOT NULL DEFAULT 0;
The error was: (1060, "Duplicate column name 'timespent'")
RuntimeError: Cannot reverse this migration. 'Target.file_name' and its values cannot be restored.This was all done while working on the daisy branch.
So, then I tried the delete/recreate database trick again and changed back
to the master branch. Now I can run the two python commands ok, but my daisy clients are back to throwing the assert errors...So, a few questions:
- Does it still work to run the production server on the master and clients running daisy, or do I have to use the daisy version of the production server, or do I need something newer than daisy but not as new
as master?- If for whatever reason I need to recreate the database, what are the exact steps that I need to do to delete/recreate?
It seems like just dropping the Œtoaster¹ database and recreating it is insufficient, but I am not sure what else to do.The wiki pages are a bit vague on all this stuff, thanks for any help.
Craig
--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster
Hi Craig,
The system should work with the server running master, and the clients running daisy. The production database MUST be set up with the master, and the clients MUST NOT be started with the toaster script - the script will get confused as to the current revision of the database. The flow is:
- start toaster on the server, and let it create / update the database
- on the clients, you need to just start the bitbake server and the toasterui client before issuing command to the bitbake server - here there is the race condition that Dave already mentioned
If you need to drop and recreate the database, please always use the latest master - the clients, even if using an older version, should accomodate, we try keep the database schema changes backward compatible.
For a short while, the "master" was broken due to a bad commit - you may have landed there with your master, can you please git pull lastest master ?
About the specific bug you see - can you please let me know more about your setup ?
- db engine you're using is mysql, right ?
- commit ids for master and daisy that you're using ?
- which commands do you use to start the server and the clients ?
Cheers,
Alex
Quoted 178 lines · Dave
Hi Craig,
Did you delete your old database and recreate it using the current clone of poky as shown on
https://wiki.yoctoproject.org/wiki/Setting_up_a_local_instance_of_Toaster
that is, running the database creation/migration commands that execute in
'source toaster start'?-dave
Quoted 24 lines
-----Original Message-----
From: Neth, Craig Allen [mailto:[email protected]]
Sent: Thursday, July 03, 2014 4:05 PM
To: Lerner, Dave
Cc: [email protected]
Subject: Re: Need help with Production toaster setupHi Dave,
Thanks for the quick response!
I had previous experienced the problem you mentioned and worked around it by adding a sleep between the —observe-only and the bitbake command. Without the sleep, as you mention the events were just getting dropped. It’s nice to see a proper fix for that, however.
But I don’t think that’s what’s happening now; from the tracebacks it looks like the clients are sending events to the database but it’s not setup the way they expect...
My suspicion is that the schemas have changed but I don’t know how to get my database back into a state where it matches the schema the client expects.
Quoted 34 lines
Craig
Quoted 27 lines · Dave
Hi Craig,
A patch submitted 15 minutes ago may solve your problem, it sounds similar to the problem that appeared after daisy in my script that did:
bitbake --server-only ...
bitbake --observe-only ... ToasterUI
bitbake <some-image>With recent releases the 'bitbake <some-image>' fires before the ToasterUI is ready (2nd command) to read events. The patch in
https://bugzilla.yoctoproject.org/show_bug.cgi?id=6504 writes a message to the log file. You can change your script to block until that log message appears, before launching a build - if that's your problem.Hope this helps,
Dave LernerQuoted 9 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Neth, Craig Allen
Sent: Thursday, July 03, 2014 3:34 PM
To: [email protected]
Subject: [Toaster] Need help with Production toaster setupA month or so ago, I set up a production toaster instance using the
poky
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
master branch.
Our projects were building with Daisy. Everything was working fine.For various reasons, I needed to redo the production instance and that involved recloning the poky master repo, and now I¹m having issuesŠ
After recloning poky and restarting the server, all my builds with the build logging turned on started throwing weird errors complaining like this:
ERROR: Field '
project_id' doesn't have a default value <traceback omitted>And :
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
ERROR:
Traceback (most recent call last):
File "/poky/bitbake/lib/bb/ui/toasterui.py", line 191, in main
buildinfohelper.store_started_task(event)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 653, instore_started_task
recipe_information=self._get_recipe_information_from_taskfile(event.taskfile)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 551, in_get_recipe_information_from_taskfile
layer_version_obj=
self._get_layer_version_for_path(localfilepath)Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 533, in
_get_layer_version_for_path
assert 'build' in self.internal_state
AssertionErrorSo I figured that there was probably some difference of opinion
between
Quoted 1 line
Quoted 1 line
Quoted 1 line
the client and the server about the schema; I tried running the
Œsyncdb¹
Quoted 22 lines
Quoted 21 lines
Quoted 21 lines
and Œmigrate orm¹ commands again on the server but that didn¹t help.
---
So next I figured I would just delete the Œtoaster¹ database and start
over. I tried going into mysql and dropping the toaster database,
recreating it, and then redoing the two python commands, but that results
in this error from the migrate orm command:python
bitbake/lib/toaster/manage.pymigrate orm
Running migrations for orm:
- Migrating forwards to 0007_auto__add_helptext.Quoted 3 lines
orm:0001_initial
orm:0002_auto__add_field_build_timespent
orm:0003_timespent- Migration 'orm:0003_timespent' is marked for no-dry-run.
Quoted 2 lines
orm:0004_auto__add_field_package_installed_name
Quoted 8 lines
Quoted 8 lines
orm:0005_auto__add_target_image_file__add_target_file__add_field_variable
Quoted 7 lines
hi
stor
FATAL ERROR - The following SQL query failed: ALTER TABLEorm_buildADD
COLUMNtimespentinteger NOT NULL DEFAULT 0;
The error was: (1060, "Duplicate column name 'timespent'")
RuntimeError: Cannot reverse this migration. 'Target.file_name' andits
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
values cannot be restored.
This was all done while working on the daisy branch.
So, then I tried the delete/recreate database trick again and changed back
to the master branch. Now I can run the two python commands ok, butmy
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
daisy clients are back to throwing the assert errors...
So, a few questions:
- Does it still work to run the production server on the master and clients running daisy, or do I have to use the daisy version of the production server, or do I need something newer than daisy but not as new
as master?Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
- If for whatever reason I need to recreate the database, what are the exact steps that I need to do to delete/recreate?
It seems like just dropping the Œtoaster¹ database and recreating itis
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
insufficient, but I am not sure what else to do.
The wiki pages are a bit vague on all this stuff, thanks for any help.
Craig
--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster
Signature · 3 lines
Alex Damian Yocto Project SSG / OTC
Hi Alex,
Thanks for the response!
I just did a git pull on the master, and then did the following steps on the master machine:
mysql> drop database toaster;
mysql> create database toaster;
python bitbake/lib/toaster/manage.py syncdb python bitbake/lib/toaster/manage.py migrate orm python bitbake/lib/toaster/manage.py migrate bldcontrol
(The wiki page does not mention this last one but the ‘syncdb' command mentions that this one is also 'not synced’.)
To start the master, I have written a short upstart script that does the following:
DATABASE_URL='mysql://user:pass@node:3306/toaster' python $BASEDIR/bitbake/lib/toaster/manage.py runserver
The server is up and running (I see the "This is Toaster" page).
On the clients, I normally use a modified version of the ‘toaster’ script (I called it toaster-remote) that avoids starting the local webserver but doing the commands listed on the wiki page doesn't change the outcome, I still see the same Assertion errors I mentioned in my initial message.
As to your questions: We are indeed using mysql on the master. Git
commit ids:
master:a5531a2b8983318b99c119a87b78a92cf84160b8
client:5306aaab07a7a9b3b0c7e8008dabbd2e89daec28
I mentioned the commands I used above.
Thanks for any help. As I mentioned, we did have all this working
previously before I updated the master, so I don’t think my fundamental setup is wrong...
Craig
From: <Damian>, Alexandru <[email protected]> Date: Friday, July 4, 2014 at 8:06 AM To: "Lerner, Dave" <[email protected]>
Cc: "Neth, Craig A" <[email protected]>, "[email protected]" <[email protected]>
Subject: Re: [Toaster] Need help with Production toaster setup
Quoted 251 lines
Hi Craig,
The system should work with the server running master, and the clients running daisy. The production database MUST be set up with the master, and the clients MUST NOT be started with the toaster script - the script will get confused as to the current revision of the database. The flow is:
- start toaster on the server, and let it create / update the database
- on the clients, you need to just start the bitbake server and the toasterui client before issuing command to the bitbake server - here there is the race condition that Dave already mentioned
If you need to drop and recreate the database, please always use the latest master - the clients, even if using an older version, should accomodate, we try keep the database schema changes backward compatible.
For a short while, the "master" was broken due to a bad commit - you may have landed there with your master, can you please git pull lastest master ?
About the specific bug you see - can you please let me know more about your setup ?
- db engine you're using is mysql, right ?
- commit ids for master and daisy that you're using ?
- which commands do you use to start the server and the clients ?
Cheers,
AlexOn Thu, Jul 3, 2014 at 10:17 PM, Lerner, Dave <[email protected]> wrote:
Hi Craig,
Did you delete your old database and recreate it using the current clone of poky as shown on
https://wiki.yoctoproject.org/wiki/Setting_up_a_local_instance_of_Toaster
that is, running the database creation/migration commands that execute in
'source toaster start'?-dave
Quoted 154 lines
-----Original Message-----
From: Neth, Craig Allen [mailto:[email protected]]
Sent: Thursday, July 03, 2014 4:05 PM
To: Lerner, Dave
Cc: [email protected]
Subject: Re: Need help with Production toaster setupHi Dave,
Thanks for the quick response!
I had previous experienced the problem you mentioned and worked around it
by adding a sleep between the —observe-only and the bitbake command. Without the sleep, as you mention the events were just getting dropped. It’s nice to see a proper fix for that, however.But I don’t think that’s what’s happening now; from the tracebacks it looks like the clients are sending events to the database but it’s not setup the way they expect...
My suspicion is that the schemas have changed but I don’t know how to get
my database back into a state where it matches the schema the client expects.Craig
Quoted 9 lines · Dave
Hi Craig,
A patch submitted 15 minutes ago may solve your problem, it sounds similar to the problem that appeared after daisy in my script that did:
bitbake --server-only ...
bitbake --observe-only ... ToasterUI
bitbake <some-image>Quoted 18 lines
With recent releases the 'bitbake <some-image>' fires before the ToasterUI is ready (2nd command) to read events. The patch in
https://bugzilla.yoctoproject.org/show_bug.cgi?id=6504 writes a message to the log file. You can change your script to block until that log message appears, before launching a build - if that's your problem.Hope this helps,
Dave LernerQuoted 9 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Neth, Craig Allen
Sent: Thursday, July 03, 2014 3:34 PM
To: [email protected]
Subject: [Toaster] Need help with Production toaster setupA month or so ago, I set up a production toaster instance using the
poky
Quoted 4 lines
Quoted 4 lines
master branch.
Our projects were building with Daisy. Everything was working fine.For various reasons, I needed to redo the production instance and
that
Quoted 3 lines
Quoted 3 lines
involved recloning the poky master repo, and now I¹m having issuesŠ
After recloning poky and restarting the server, all my builds with
the
Quoted 1 line
Quoted 1 line
build logging turned on started throwing weird errors complaining
like
Quoted 8 lines
Quoted 8 lines
this:
ERROR: Field '
project_id' doesn't have a default value <traceback omitted>And :
Quoted 11 lines
Quoted 11 lines
ERROR:
Traceback (most recent call last):
File "/poky/bitbake/lib/bb/ui/toasterui.py", line 191, in main
buildinfohelper.store_started_task(event)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 653, instore_started_task
recipe_information=self._get_recipe_information_from_taskfile(event.taskfile)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 551, in_get_recipe_information_from_taskfile
layer_version_obj=
self._get_layer_version_for_path(localfilepath)Quoted 6 lines
Quoted 6 lines
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 533, in
_get_layer_version_for_path
assert 'build' in self.internal_state
AssertionErrorSo I figured that there was probably some difference of opinion
between
Quoted 1 line
Quoted 1 line
the client and the server about the schema; I tried running the
Œsyncdb¹
Quoted 6 lines
Quoted 6 lines
and Œmigrate orm¹ commands again on the server but that didn¹t help.
---
So next I figured I would just delete the Œtoaster¹ database and
start
Quoted 16 lines
Quoted 15 lines
over. I tried going into mysql and dropping the toaster database,
recreating it, and then redoing the two python commands, but that results
in this error from the migrate orm command:python
bitbake/lib/toaster/manage.pymigrate orm
Running migrations for orm:
- Migrating forwards to 0007_auto__add_helptext.Quoted 3 lines
orm:0001_initial
orm:0002_auto__add_field_build_timespent
orm:0003_timespent- Migration 'orm:0003_timespent' is marked for no-dry-run.
Quoted 2 lines
orm:0004_auto__add_field_package_installed_name
Quoted 9 lines
Quoted 9 lines
orm:0005_auto__add_target_image_file__add_target_file__add_field_variab le
hi
stor
FATAL ERROR - The following SQL query failed: ALTER TABLEorm_buildADD
COLUMNtimespentinteger NOT NULL DEFAULT 0;
The error was: (1060, "Duplicate column name 'timespent'")
RuntimeError: Cannot reverse this migration. 'Target.file_name' andits
Quoted 7 lines
Quoted 7 lines
values cannot be restored.
This was all done while working on the daisy branch.
So, then I tried the delete/recreate database trick again and changed back
to the master branch. Now I can run the two python commands ok, butmy
Quoted 5 lines
Quoted 5 lines
daisy clients are back to throwing the assert errors...
So, a few questions:
Quoted 7 lines
Quoted 7 lines
- Does it still work to run the production server on the master and clients running daisy, or do I have to use the daisy version of the production server, or do I need something newer than daisy but not as new
as master?- If for whatever reason I need to recreate the database, what are
Quoted 16 lines
the
Quoted 2 lines
Quoted 2 lines
exact steps that I need to do to delete/recreate?
It seems like just dropping the Œtoaster¹ database and recreating itis
Quoted 3 lines
Quoted 3 lines
insufficient, but I am not sure what else to do.
The wiki pages are a bit vague on all this stuff, thanks for any
help.
Quoted 8 lines
Quoted 8 lines
Craig
--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toasterSignature · 3 lines
Alex DamianYocto Project SSG / OTC
Hi,
Thanks for the info -
No, the setup seems as it is designed to be.
I guess somewhere in origin/master things broke. We don't test this setup on our suite, but maybe we should start testing this, thus I CC'ed Ionut.
Meanwhile, I will start looking into fixing this. Can you please open a bug in Bugzilla so I can track it ?
Cheers,
Alex
Quoted 310 lines · Craig Allen
Hi Alex,
Thanks for the response!
I just did a git pull on the master, and then did the following steps on the master machine:
mysql> drop database toaster;
mysql> create database toaster;python
bitbake/lib/toaster/manage.pysyncdb pythonbitbake/lib/toaster/manage.pymigrate orm pythonbitbake/lib/toaster/manage.pymigrate bldcontrol(The wiki page does not mention this last one but the ‘syncdb' command mentions that this one is also 'not synced’.)
To start the master, I have written a short upstart script that does the following:
DATABASE_URL='mysql://user:pass@node:3306/toaster' python
$BASEDIR/bitbake/lib/toaster/manage.pyrunserverThe server is up and running (I see the "This is Toaster" page).
On the clients, I normally use a modified version of the ‘toaster’ script (I called it toaster-remote) that avoids starting the local webserver but doing the commands listed on the wiki page doesn't change the outcome, I still see the same Assertion errors I mentioned in my initial message.
As to your questions: We are indeed using mysql on the master. Git
commit ids:master:a5531a2b8983318b99c119a87b78a92cf84160b8
client:5306aaab07a7a9b3b0c7e8008dabbd2e89daec28I mentioned the commands I used above.
Thanks for any help. As I mentioned, we did have all this working
previously before I updated the master, so I don’t think my fundamental setup is wrong...Craig
From: <Damian>, Alexandru <[email protected]> Date: Friday, July 4, 2014 at 8:06 AM To: "Lerner, Dave" <[email protected]>Cc: "Neth, Craig A" <[email protected]>, "[email protected]" <[email protected]>
Subject: Re: [Toaster] Need help with Production toaster setupQuoted 50 lines
Hi Craig,
The system should work with the server running master, and the clients running daisy. The production database MUST be set up with the master, and the clients MUST NOT be started with the toaster script - the script will get confused as to the current revision of the database. The flow is:
- start toaster on the server, and let it create / update the database
- on the clients, you need to just start the bitbake server and the toasterui client before issuing command to the bitbake server - here there is the race condition that Dave already mentioned
If you need to drop and recreate the database, please always use the latest master - the clients, even if using an older version, should accomodate, we try keep the database schema changes backward compatible.
For a short while, the "master" was broken due to a bad commit - you may have landed there with your master, can you please git pull lastest master ?
About the specific bug you see - can you please let me know more about your setup ?
- db engine you're using is mysql, right ?
- commit ids for master and daisy that you're using ?
- which commands do you use to start the server and the clients ?
Cheers,
AlexQuoted 8 lines
On Thu, Jul 3, 2014 at 10:17 PM, Lerner, Dave <[email protected]> wrote:
Hi Craig,
Did you delete your old database and recreate it using the current clone of poky as shown on
https://wiki.yoctoproject.org/wiki/Setting_up_a_local_instance_of_Toaster
Quoted 50 lines
that is, running the database creation/migration commands that execute in
'source toaster start'?-dave
Quoted 45 lines
-----Original Message-----
From: Neth, Craig Allen [mailto:[email protected]]
Sent: Thursday, July 03, 2014 4:05 PM
To: Lerner, Dave
Cc: [email protected]
Subject: Re: Need help with Production toaster setupHi Dave,
Thanks for the quick response!
I had previous experienced the problem you mentioned and worked around it
by adding a sleep between the —observe-only and the bitbake command. Without the sleep, as you mention the events were just getting dropped. It’s nice to see a proper fix for that, however.But I don’t think that’s what’s happening now; from the tracebacks it looks like the clients are sending events to the database but it’s not setup the way they expect...
My suspicion is that the schemas have changed but I don’t know how to get
my database back into a state where it matches the schema the client expects.Craig
Quoted 12 lines · Dave
Hi Craig,
A patch submitted 15 minutes ago may solve your problem, it sounds similar to the problem that appeared after daisy in my script that did:
bitbake --server-only ...
bitbake --observe-only ... ToasterUI
bitbake <some-image>With recent releases the 'bitbake <some-image>' fires before the ToasterUI is ready (2nd command) to read events. The patch in
https://bugzilla.yoctoproject.org/show_bug.cgi?id=6504 writes amessage
Quoted 143 lines
Quoted 109 lines
Quoted 15 lines
to the log file. You can change your script to block until that log message appears, before launching a build - if that's your problem.
Hope this helps,
Dave LernerQuoted 9 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Neth, Craig Allen
Sent: Thursday, July 03, 2014 3:34 PM
To: [email protected]
Subject: [Toaster] Need help with Production toaster setupA month or so ago, I set up a production toaster instance using the
poky
Quoted 4 lines
Quoted 4 lines
master branch.
Our projects were building with Daisy. Everything was working fine.For various reasons, I needed to redo the production instance and
that
Quoted 3 lines
Quoted 3 lines
involved recloning the poky master repo, and now I¹m having issuesŠ
After recloning poky and restarting the server, all my builds with
the
Quoted 1 line
Quoted 1 line
build logging turned on started throwing weird errors complaining
like
Quoted 8 lines
Quoted 8 lines
this:
ERROR: Field '
project_id' doesn't have a default value <traceback omitted>And :
Quoted 11 lines
Quoted 11 lines
ERROR:
Traceback (most recent call last):
File "/poky/bitbake/lib/bb/ui/toasterui.py", line 191, in main
buildinfohelper.store_started_task(event)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 653, instore_started_task
recipe_information=self._get_recipe_information_from_taskfile(event.taskfile)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 551, in_get_recipe_information_from_taskfile
layer_version_obj=
self._get_layer_version_for_path(localfilepath)Quoted 6 lines
Quoted 6 lines
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 533, in
_get_layer_version_for_path
assert 'build' in self.internal_state
AssertionErrorSo I figured that there was probably some difference of opinion
between
Quoted 1 line
Quoted 1 line
the client and the server about the schema; I tried running the
Œsyncdb¹
Quoted 6 lines
Quoted 6 lines
and Œmigrate orm¹ commands again on the server but that didn¹t help.
---
So next I figured I would just delete the Œtoaster¹ database and
start
Quoted 16 lines
Quoted 15 lines
over. I tried going into mysql and dropping the toaster database,
recreating it, and then redoing the two python commands, but that results
in this error from the migrate orm command:python
bitbake/lib/toaster/manage.pymigrate orm
Running migrations for orm:
- Migrating forwards to 0007_auto__add_helptext.Quoted 3 lines
orm:0001_initial
orm:0002_auto__add_field_build_timespent
orm:0003_timespent- Migration 'orm:0003_timespent' is marked for no-dry-run.
Quoted 2 lines
orm:0004_auto__add_field_package_installed_name
Quoted 9 lines
Quoted 9 lines
orm:0005_auto__add_target_image_file__add_target_file__add_field_variab le
hi
stor
FATAL ERROR - The following SQL query failed: ALTER TABLEorm_buildADD
COLUMNtimespentinteger NOT NULL DEFAULT 0;
The error was: (1060, "Duplicate column name 'timespent'")
RuntimeError: Cannot reverse this migration. 'Target.file_name' andits
Quoted 7 lines
Quoted 7 lines
values cannot be restored.
This was all done while working on the daisy branch.
So, then I tried the delete/recreate database trick again and changed back
to the master branch. Now I can run the two python commands ok, butmy
Quoted 5 lines
Quoted 5 lines
daisy clients are back to throwing the assert errors...
So, a few questions:
Quoted 7 lines
Quoted 7 lines
- Does it still work to run the production server on the master and clients running daisy, or do I have to use the daisy version of the production server, or do I need something newer than daisy but not as new
as master?- If for whatever reason I need to recreate the database, what are
Quoted 16 lines
the
Quoted 2 lines
Quoted 2 lines
exact steps that I need to do to delete/recreate?
It seems like just dropping the Œtoaster¹ database and recreating itis
Quoted 3 lines
Quoted 3 lines
insufficient, but I am not sure what else to do.
The wiki pages are a bit vague on all this stuff, thanks for any
help.
Quoted 8 lines
Quoted 8 lines
Craig
--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster--
Alex DamianYocto ProjectSSG / OTC
Signature · 3 lines
Alex Damian Yocto Project SSG / OTC
Hi Alex,
Ok, thanks. Bug 6512 was filed. Do you have any speculation about when the problem might have been introduced? I don’t have any particular need to run the bleeding edge toaster server; if there is an earlier branch that might work I’m happy to switch branches on the server end of things.
The weird thing is that I tried reverting the server back to the Daisy branch but that also failed with a different set of problems, I received errors when I ran the ‘migrate orm’ step. I figured that I had just fat fingered some of the setup commands but I can’t seem to find the problem.
Craig
From: <Damian>, Alexandru <[email protected]<mailto:[email protected]>>
Date: Tuesday, July 8, 2014 at 7:09 AM
To: "Neth, Craig A" <[email protected]<mailto:[email protected]>>
Cc: "Lerner, Dave" <[email protected]<mailto:[email protected]>>, "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>, IonutX Chisanovici <[email protected]<mailto:[email protected]>>
Subject: Re: [Toaster] Need help with Production toaster setup
Hi,
Thanks for the info -
No, the setup seems as it is designed to be.
I guess somewhere in origin/master things broke. We don't test this setup on our suite, but maybe we should start testing this, thus I CC'ed Ionut.
Meanwhile, I will start looking into fixing this. Can you please open a bug in Bugzilla so I can track it ?
Cheers,
Alex
On Mon, Jul 7, 2014 at 3:45 PM, Neth, Craig Allen <[email protected]<mailto:[email protected]>> wrote:
Hi Alex,
Thanks for the response!
I just did a git pull on the master, and then did the following steps on the master machine:
mysql> drop database toaster;
mysql> create database toaster;
python bitbake/lib/toaster/manage.py syncdb python bitbake/lib/toaster/manage.py migrate orm python bitbake/lib/toaster/manage.py migrate bldcontrol
(The wiki page does not mention this last one but the ‘syncdb' command mentions that this one is also 'not synced’.)
To start the master, I have written a short upstart script that does the following:
DATABASE_URL='mysql://user:pass@node:3306/toaster' python $BASEDIR/bitbake/lib/toaster/manage.py runserver
The server is up and running (I see the "This is Toaster" page).
On the clients, I normally use a modified version of the ‘toaster’ script (I called it toaster-remote) that avoids starting the local webserver but doing the commands listed on the wiki page doesn't change the outcome, I still see the same Assertion errors I mentioned in my initial message.
As to your questions: We are indeed using mysql on the master. Git
commit ids:
master:a5531a2b8983318b99c119a87b78a92cf84160b8
client:5306aaab07a7a9b3b0c7e8008dabbd2e89daec28
I mentioned the commands I used above.
Thanks for any help. As I mentioned, we did have all this working
previously before I updated the master, so I don’t think my fundamental setup is wrong...
Craig
From: <Damian>, Alexandru <[email protected]<mailto:[email protected]>> Date: Friday, July 4, 2014 at 8:06 AM To: "Lerner, Dave" <[email protected]<mailto:[email protected]>>
Cc: "Neth, Craig A" <[email protected]<mailto:[email protected]>>, "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
Subject: Re: [Toaster] Need help with Production toaster setup
Quoted 247 lines
Hi Craig,
The system should work with the server running master, and the clients running daisy. The production database MUST be set up with the master, and the clients MUST NOT be started with the toaster script - the script will get confused as to the current revision of the database. The flow is:
- start toaster on the server, and let it create / update the database
- on the clients, you need to just start the bitbake server and the toasterui client before issuing command to the bitbake server - here there is the race condition that Dave already mentioned
If you need to drop and recreate the database, please always use the latest master - the clients, even if using an older version, should accomodate, we try keep the database schema changes backward compatible.
For a short while, the "master" was broken due to a bad commit - you may have landed there with your master, can you please git pull lastest master ?
About the specific bug you see - can you please let me know more about your setup ?
- db engine you're using is mysql, right ?
- commit ids for master and daisy that you're using ?
- which commands do you use to start the server and the clients ?
Cheers,
AlexOn Thu, Jul 3, 2014 at 10:17 PM, Lerner, Dave <[email protected]<mailto:[email protected]>> wrote:
Hi Craig,
Did you delete your old database and recreate it using the current clone of poky as shown on
https://wiki.yoctoproject.org/wiki/Setting_up_a_local_instance_of_Toaster
that is, running the database creation/migration commands that execute in
'source toaster start'?-dave
Quoted 154 lines
-----Original Message-----
From: Neth, Craig Allen [mailto:[email protected]<mailto:[email protected]>]
Sent: Thursday, July 03, 2014 4:05 PM
To: Lerner, Dave
Cc: [email protected]<mailto:[email protected]>
Subject: Re: Need help with Production toaster setupHi Dave,
Thanks for the quick response!
I had previous experienced the problem you mentioned and worked around it
by adding a sleep between the —observe-only and the bitbake command. Without the sleep, as you mention the events were just getting dropped. It’s nice to see a proper fix for that, however.But I don’t think that’s what’s happening now; from the tracebacks it looks like the clients are sending events to the database but it’s not setup the way they expect...
My suspicion is that the schemas have changed but I don’t know how to get
my database back into a state where it matches the schema the client expects.Craig
Quoted 9 lines · On 7/3/14, 4:52 PM, "Lerner, Dave" <[email protected]<mailto:dave.lerne…
Hi Craig,
A patch submitted 15 minutes ago may solve your problem, it sounds similar to the problem that appeared after daisy in my script that did:
bitbake --server-only ...
bitbake --observe-only ... ToasterUI
bitbake <some-image>Quoted 18 lines
With recent releases the 'bitbake <some-image>' fires before the ToasterUI is ready (2nd command) to read events. The patch in
https://bugzilla.yoctoproject.org/show_bug.cgi?id=6504 writes a message to the log file. You can change your script to block until that log message appears, before launching a build - if that's your problem.Hope this helps,
Dave LernerQuoted 9 lines
-----Original Message-----
From: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>] On Behalf Of Neth, Craig Allen
Sent: Thursday, July 03, 2014 3:34 PM
To: [email protected]<mailto:[email protected]>
Subject: [Toaster] Need help with Production toaster setupA month or so ago, I set up a production toaster instance using the
poky
Quoted 4 lines
Quoted 4 lines
master branch.
Our projects were building with Daisy. Everything was working fine.For various reasons, I needed to redo the production instance and
that
Quoted 3 lines
Quoted 3 lines
involved recloning the poky master repo, and now I¹m having issuesŠ
After recloning poky and restarting the server, all my builds with
the
Quoted 1 line
Quoted 1 line
build logging turned on started throwing weird errors complaining
like
Quoted 8 lines
Quoted 8 lines
this:
ERROR: Field '
project_id' doesn't have a default value <traceback omitted>And :
Quoted 11 lines
Quoted 11 lines
ERROR:
Traceback (most recent call last):
File "/poky/bitbake/lib/bb/ui/toasterui.py", line 191, in main
buildinfohelper.store_started_task(event)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 653, instore_started_task
recipe_information=self._get_recipe_information_from_taskfile(event.taskfile)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 551, in_get_recipe_information_from_taskfile
layer_version_obj=
self._get_layer_version_for_path(localfilepath)Quoted 6 lines
Quoted 6 lines
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 533, in
_get_layer_version_for_path
assert 'build' in self.internal_state
AssertionErrorSo I figured that there was probably some difference of opinion
between
Quoted 1 line
Quoted 1 line
the client and the server about the schema; I tried running the
Œsyncdb¹
Quoted 6 lines
Quoted 6 lines
and Œmigrate orm¹ commands again on the server but that didn¹t help.
---
So next I figured I would just delete the Œtoaster¹ database and
start
Quoted 16 lines
Quoted 15 lines
over. I tried going into mysql and dropping the toaster database,
recreating it, and then redoing the two python commands, but that results
in this error from the migrate orm command:python
bitbake/lib/toaster/manage.pymigrate orm
Running migrations for orm:
- Migrating forwards to 0007_auto__add_helptext.Quoted 3 lines
orm:0001_initial
orm:0002_auto__add_field_build_timespent
orm:0003_timespent- Migration 'orm:0003_timespent' is marked for no-dry-run.
Quoted 2 lines
orm:0004_auto__add_field_package_installed_name
Quoted 9 lines
Quoted 9 lines
orm:0005_auto__add_target_image_file__add_target_file__add_field_variab le
hi
stor
FATAL ERROR - The following SQL query failed: ALTER TABLEorm_buildADD
COLUMNtimespentinteger NOT NULL DEFAULT 0;
The error was: (1060, "Duplicate column name 'timespent'")
RuntimeError: Cannot reverse this migration. 'Target.file_name' andits
Quoted 7 lines
Quoted 7 lines
values cannot be restored.
This was all done while working on the daisy branch.
So, then I tried the delete/recreate database trick again and changed back
to the master branch. Now I can run the two python commands ok, butmy
Quoted 5 lines
Quoted 5 lines
daisy clients are back to throwing the assert errors...
So, a few questions:
Quoted 7 lines
Quoted 7 lines
- Does it still work to run the production server on the master and clients running daisy, or do I have to use the daisy version of the production server, or do I need something newer than daisy but not as new
as master?- If for whatever reason I need to recreate the database, what are
Quoted 16 lines
the
Quoted 2 lines
Quoted 2 lines
exact steps that I need to do to delete/recreate?
It seems like just dropping the Œtoaster¹ database and recreating itis
Quoted 3 lines
Quoted 3 lines
insufficient, but I am not sure what else to do.
The wiki pages are a bit vague on all this stuff, thanks for any
help.
Quoted 8 lines
Quoted 8 lines
Craig
--
_______________________________________________
toaster mailing list [email protected]<mailto:[email protected]>
https://lists.yoctoproject.org/listinfo/toaster--
_______________________________________________
toaster mailing list [email protected]<mailto:[email protected]>
https://lists.yoctoproject.org/listinfo/toaster
Quoted 4 lines
--
Alex DamianYocto ProjectSSG / OTC
--
Alex Damian
Yocto Project
SSG / OTC
Hi Craig - I'd like to have a chat with you, are you on IRC ?
Unfortunately, I am unable to reproduce the errors you're seeing. I created the database at commit:
*a5531a2b8983318b99c119a87b78a9**2cf84160b8*
and started the bitbake server and toasterui at commit:
*5306aaab07a7a9b3b0c7e8008dabbd**2e89daec28*
and the build gets recorded without error.
I'm thinking you have *.pyc files remaining on disk between git checkouts, python not picking up changes, and getting old code running - but it may be any cause.
I'd like to debug this live with you online, do you have time for that ?
Alex
Quoted 369 lines · Craig Allen
Hi Alex,
Ok, thanks. Bug 6512 was filed. Do you have any speculation about when
the problem might have been introduced? I don’t have any particular need
to run the bleeding edge toaster server; if there is an earlier branch that might work I’m happy to switch branches on the server end of things.The weird thing is that I tried reverting the server back to the Daisy branch but that also failed with a different set of problems, I received
errors when I ran the ‘migrate orm’ step. I figured that I had just fat
fingered some of the setup commands but I can’t seem to find the problem.Craig
From: <Damian>, Alexandru <[email protected]>
Date: Tuesday, July 8, 2014 at 7:09 AM
To: "Neth, Craig A" <[email protected]>
Cc: "Lerner, Dave" <[email protected]>, "[email protected]" <[email protected]>, IonutX Chisanovici < [email protected]>Subject: Re: [Toaster] Need help with Production toaster setup
Hi,
Thanks for the info -
No, the setup seems as it is designed to be.
I guess somewhere in origin/master things broke. We don't test this setup on our suite, but maybe we should start testing this, thus I CC'ed Ionut.
Meanwhile, I will start looking into fixing this. Can you please open a bug in Bugzilla so I can track it ?
Cheers,
AlexQuoted 271 lines · Craig Allen
Hi Alex,
Thanks for the response!
I just did a git pull on the master, and then did the following steps on the master machine:
mysql> drop database toaster;
mysql> create database toaster;python
bitbake/lib/toaster/manage.pysyncdb pythonbitbake/lib/toaster/manage.pymigrate orm pythonbitbake/lib/toaster/manage.pymigrate bldcontrol(The wiki page does not mention this last one but the ‘syncdb' command mentions that this one is also 'not synced’.)
To start the master, I have written a short upstart script that does the following:
DATABASE_URL='mysql://user:pass@node:3306/toaster' python
$BASEDIR/bitbake/lib/toaster/manage.pyrunserverThe server is up and running (I see the "This is Toaster" page).
On the clients, I normally use a modified version of the ‘toaster’ script (I called it toaster-remote) that avoids starting the local webserver but doing the commands listed on the wiki page doesn't change the outcome, I still see the same Assertion errors I mentioned in my initial message.
As to your questions: We are indeed using mysql on the master. Git
commit ids:master:a5531a2b8983318b99c119a87b78a92cf84160b8
client:5306aaab07a7a9b3b0c7e8008dabbd2e89daec28I mentioned the commands I used above.
Thanks for any help. As I mentioned, we did have all this working
previously before I updated the master, so I don’t think my fundamental setup is wrong...Craig
From: <Damian>, Alexandru <[email protected]> Date: Friday, July 4, 2014 at 8:06 AM To: "Lerner, Dave" <[email protected]>Cc: "Neth, Craig A" <[email protected]>, "[email protected]" <[email protected]>
Subject: Re: [Toaster] Need help with Production toaster setupQuoted 7 lines
Hi Craig,
The system should work with the server running master, and the clients running daisy. The production database MUST be set up with the master, and the clients MUST NOT be started with the toaster script - the script will get confused as to the current revision of the database. The flow
is:
Quoted 43 lines
- start toaster on the server, and let it create / update the database
- on the clients, you need to just start the bitbake server and the toasterui client before issuing command to the bitbake server - here there is the race condition that Dave already mentioned
If you need to drop and recreate the database, please always use the latest master - the clients, even if using an older version, should accomodate, we try keep the database schema changes backward compatible.
For a short while, the "master" was broken due to a bad commit - you may have landed there with your master, can you please git pull lastest master ?
About the specific bug you see - can you please let me know more about your setup ?
- db engine you're using is mysql, right ?
- commit ids for master and daisy that you're using ?
- which commands do you use to start the server and the clients ?
Cheers,
AlexQuoted 9 lines
On Thu, Jul 3, 2014 at 10:17 PM, Lerner, Dave <[email protected]
wrote:
Hi Craig,
Did you delete your old database and recreate it using the current clone of poky as shown on
https://wiki.yoctoproject.org/wiki/Setting_up_a_local_instance_of_Toaster
Quoted 42 lines
that is, running the database creation/migration commands that execute in
'source toaster start'?-dave
Quoted 37 lines
-----Original Message-----
From: Neth, Craig Allen [mailto:[email protected]]
Sent: Thursday, July 03, 2014 4:05 PM
To: Lerner, Dave
Cc: [email protected]
Subject: Re: Need help with Production toaster setupHi Dave,
Thanks for the quick response!
I had previous experienced the problem you mentioned and worked around it
by adding a sleep between the —observe-only and the bitbake command. Without the sleep, as you mention the events were just getting dropped. It’s nice to see a proper fix for that, however.But I don’t think that’s what’s happening now; from the tracebacks it looks like the clients are sending events to the database but it’s not setup the way they expect...
My suspicion is that the schemas have changed but I don’t know how to get
my database back into a state where it matches the schema the client expects.Craig
Quoted 4 lines · Dave
Hi Craig,
A patch submitted 15 minutes ago may solve your problem, it sounds similar to the problem that appeared after daisy in my script that
did:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
bitbake --server-only ...
bitbake --observe-only ... ToasterUI
bitbake <some-image>With recent releases the 'bitbake <some-image>' fires before the ToasterUI is ready (2nd command) to read events. The patch in
https://bugzilla.yoctoproject.org/show_bug.cgi?id=6504 writes amessage
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
to the log file. You can change your script to block until that log message appears, before launching a build - if that's your problem.
Hope this helps,
Dave LernerQuoted 8 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Neth, Craig Allen
Sent: Thursday, July 03, 2014 3:34 PM
To: [email protected]
Subject: [Toaster] Need help with Production toaster setupQuoted 4 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
A month or so ago, I set up a production toaster instance using the
poky
Quoted 2 lines
Quoted 2 lines
master branch.
Our projects were building with Daisy. Everything was workingfine.
Quoted 62 lines
Quoted 61 lines
Quoted 2 lines
Quoted 2 lines
For various reasons, I needed to redo the production instance and
that
Quoted 3 lines
Quoted 3 lines
involved recloning the poky master repo, and now I¹m having issuesŠ
After recloning poky and restarting the server, all my builds with
the
Quoted 1 line
Quoted 1 line
build logging turned on started throwing weird errors complaining
like
Quoted 8 lines
Quoted 8 lines
this:
ERROR: Field '
project_id' doesn't have a default value <traceback omitted>And :
Quoted 11 lines
Quoted 11 lines
ERROR:
Traceback (most recent call last):
File "/poky/bitbake/lib/bb/ui/toasterui.py", line 191, in main
buildinfohelper.store_started_task(event)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 653, instore_started_task
recipe_information=self._get_recipe_information_from_taskfile(event.taskfile)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 551, in_get_recipe_information_from_taskfile
layer_version_obj=
self._get_layer_version_for_path(localfilepath)Quoted 6 lines
Quoted 6 lines
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 533, in
_get_layer_version_for_path
assert 'build' in self.internal_state
AssertionErrorSo I figured that there was probably some difference of opinion
between
Quoted 1 line
Quoted 1 line
the client and the server about the schema; I tried running the
Œsyncdb¹
Quoted 6 lines
Quoted 6 lines
and Œmigrate orm¹ commands again on the server but that didn¹t help.
---
So next I figured I would just delete the Œtoaster¹ database and
start
Quoted 15 lines
Quoted 15 lines
over. I tried going into mysql and dropping the toaster database,
recreating it, and then redoing the two python commands, but that results
in this error from the migrate orm command:python
bitbake/lib/toaster/manage.pymigrate orm
Running migrations for orm:
- Migrating forwards to 0007_auto__add_helptext.Quoted 3 lines
orm:0001_initial
orm:0002_auto__add_field_build_timespent
orm:0003_timespent- Migration 'orm:0003_timespent' is marked for no-dry-run.
Quoted 2 lines
orm:0004_auto__add_field_package_installed_name
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
orm:0005_auto__add_target_image_file__add_target_file__add_field_variab le
hi
stor
FATAL ERROR - The following SQL query failed: ALTER TABLE
orm_buildQuoted 10 lines
Quoted 10 lines
Quoted 4 lines
Quoted 4 lines
ADD
COLUMNtimespentinteger NOT NULL DEFAULT 0;
The error was: (1060, "Duplicate column name 'timespent'")
RuntimeError: Cannot reverse this migration. 'Target.file_name' andits
Quoted 5 lines
Quoted 5 lines
values cannot be restored.
This was all done while working on the daisy branch.
So, then I tried the delete/recreate database trick again and
changed
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
back
to the master branch. Now I can run the two python commands ok, butmy
Quoted 2 lines
Quoted 2 lines
daisy clients are back to throwing the assert errors...
Quoted 47 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
So, a few questions:
- Does it still work to run the production server on the master and clients running daisy, or do I have to use the daisy version of the production server, or do I need something newer than daisy but not
as
Quoted 38 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
new
as master?- If for whatever reason I need to recreate the database, what are
Quoted 16 lines
the
Quoted 2 lines
Quoted 2 lines
exact steps that I need to do to delete/recreate?
It seems like just dropping the Œtoaster¹ database and recreating itis
Quoted 3 lines
Quoted 3 lines
insufficient, but I am not sure what else to do.
The wiki pages are a bit vague on all this stuff, thanks for any
help.
Quoted 8 lines
Quoted 8 lines
Craig
--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster--
Alex DamianYocto ProjectSSG / OTC
--
Alex Damian
Yocto Project
SSG / OTC
Signature · 3 lines
Alex Damian Yocto Project SSG / OTC
Oh, I think I have something - it happens on mysql, but not on sqlite. This is important :)
I'll dive into it.
Alex
Quoted 408 lines · Alexandru
Hi Craig - I'd like to have a chat with you, are you on IRC ?
Unfortunately, I am unable to reproduce the errors you're seeing. I created the database at commit:
*a5531a2b8983318b99c119a87b78a9**2cf84160b8*and started the bitbake server and toasterui at commit:
*5306aaab07a7a9b3b0c7e8008dabbd**2e89daec28*and the build gets recorded without error.
I'm thinking you have *.pyc files remaining on disk between git checkouts, python not picking up changes, and getting old code running - but it may be any cause.
I'd like to debug this live with you online, do you have time for that ?
Alex
Quoted 368 lines · Craig Allen
Hi Alex,
Ok, thanks. Bug 6512 was filed. Do you have any speculation about
when the problem might have been introduced? I don’t have any particular
need to run the bleeding edge toaster server; if there is an earlier branch that might work I’m happy to switch branches on the server end of things.The weird thing is that I tried reverting the server back to the Daisy branch but that also failed with a different set of problems, I received
errors when I ran the ‘migrate orm’ step. I figured that I had just fat
fingered some of the setup commands but I can’t seem to find the problem.Craig
From: <Damian>, Alexandru <[email protected]>
Date: Tuesday, July 8, 2014 at 7:09 AM
To: "Neth, Craig A" <[email protected]>
Cc: "Lerner, Dave" <[email protected]>, "[email protected]" <[email protected]>, IonutX Chisanovici < [email protected]>Subject: Re: [Toaster] Need help with Production toaster setup
Hi,
Thanks for the info -
No, the setup seems as it is designed to be.
I guess somewhere in origin/master things broke. We don't test this setup on our suite, but maybe we should start testing this, thus I CC'ed Ionut.
Meanwhile, I will start looking into fixing this. Can you please open a bug in Bugzilla so I can track it ?
Cheers,
AlexOn Mon, Jul 7, 2014 at 3:45 PM, Neth, Craig Allen <[email protected]
Quoted 284 lines
wrote:
Hi Alex,
Thanks for the response!
I just did a git pull on the master, and then did the following steps on the master machine:
mysql> drop database toaster;
mysql> create database toaster;python
bitbake/lib/toaster/manage.pysyncdb pythonbitbake/lib/toaster/manage.pymigrate orm pythonbitbake/lib/toaster/manage.pymigrate bldcontrol(The wiki page does not mention this last one but the ‘syncdb' command mentions that this one is also 'not synced’.)
To start the master, I have written a short upstart script that does the following:
DATABASE_URL='mysql://user:pass@node:3306/toaster' python
$BASEDIR/bitbake/lib/toaster/manage.pyrunserverThe server is up and running (I see the "This is Toaster" page).
On the clients, I normally use a modified version of the ‘toaster’ script (I called it toaster-remote) that avoids starting the local webserver but doing the commands listed on the wiki page doesn't change the outcome, I still see the same Assertion errors I mentioned in my initial message.
As to your questions: We are indeed using mysql on the master. Git
commit ids:master:a5531a2b8983318b99c119a87b78a92cf84160b8
client:5306aaab07a7a9b3b0c7e8008dabbd2e89daec28I mentioned the commands I used above.
Thanks for any help. As I mentioned, we did have all this working
previously before I updated the master, so I don’t think my fundamental setup is wrong...Craig
From: <Damian>, Alexandru <[email protected]> Date: Friday, July 4, 2014 at 8:06 AM To: "Lerner, Dave" <[email protected]>Cc: "Neth, Craig A" <[email protected]>, "[email protected]" <[email protected]>
Subject: Re: [Toaster] Need help with Production toaster setupQuoted 7 lines
Hi Craig,
The system should work with the server running master, and the clients running daisy. The production database MUST be set up with the master, and the clients MUST NOT be started with the toaster script - the script will get confused as to the current revision of the database. The flow
is:
Quoted 37 lines
- start toaster on the server, and let it create / update the database
- on the clients, you need to just start the bitbake server and the toasterui client before issuing command to the bitbake server - here there is the race condition that Dave already mentioned
If you need to drop and recreate the database, please always use the latest master - the clients, even if using an older version, should accomodate, we try keep the database schema changes backward compatible.
For a short while, the "master" was broken due to a bad commit - you may have landed there with your master, can you please git pull lastest master ?
About the specific bug you see - can you please let me know more about your setup ?
- db engine you're using is mysql, right ?
- commit ids for master and daisy that you're using ?
- which commands do you use to start the server and the clients ?
Quoted 7 lines
Cheers,
AlexOn Thu, Jul 3, 2014 at 10:17 PM, Lerner, Dave <
Quoted 7 lines
wrote:
Hi Craig,
Did you delete your old database and recreate it using the current clone of poky as shown on
https://wiki.yoctoproject.org/wiki/Setting_up_a_local_instance_of_Toaster
Quoted 1 line
that is, running the database creation/migration commands that execute
in
Quoted 19 lines
'source toaster start'?
-dave
Quoted 15 lines
-----Original Message-----
From: Neth, Craig Allen [mailto:[email protected]]
Sent: Thursday, July 03, 2014 4:05 PM
To: Lerner, Dave
Cc: [email protected]
Subject: Re: Need help with Production toaster setupHi Dave,
Thanks for the quick response!
I had previous experienced the problem you mentioned and worked around it
by adding a sleep between the —observe-only and the bitbake command. Without the sleep, as you mention the events were just gettingdropped.
Quoted 16 lines
Quoted 16 lines
It’s nice to see a proper fix for that, however.
But I don’t think that’s what’s happening now; from the tracebacks it looks like the clients are sending events to the database but it’s not setup the way they expect...
My suspicion is that the schemas have changed but I don’t know how to get
my database back into a state where it matches the schema the client expects.Craig
Quoted 6 lines
Quoted 6 lines · Dave
Quoted 5 lines
Hi Craig,
A patch submitted 15 minutes ago may solve your problem, it sounds similar to the problem that appeared after daisy in my script that
did:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
bitbake --server-only ...
bitbake --observe-only ... ToasterUI
bitbake <some-image>With recent releases the 'bitbake <some-image>' fires before the ToasterUI is ready (2nd command) to read events. The patch in
https://bugzilla.yoctoproject.org/show_bug.cgi?id=6504 writes amessage
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
to the log file. You can change your script to block until that log message appears, before launching a build - if that's your problem.
Hope this helps,
Dave LernerQuoted 8 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Neth, Craig Allen
Sent: Thursday, July 03, 2014 3:34 PM
To: [email protected]
Subject: [Toaster] Need help with Production toaster setupQuoted 4 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
A month or so ago, I set up a production toaster instance using the
poky
Quoted 2 lines
Quoted 2 lines
master branch.
Our projects were building with Daisy. Everything was workingfine.
Quoted 34 lines
Quoted 34 lines
Quoted 2 lines
Quoted 2 lines
For various reasons, I needed to redo the production instance and
that
Quoted 3 lines
Quoted 3 lines
involved recloning the poky master repo, and now I¹m having issuesŠ
After recloning poky and restarting the server, all my builds with
the
Quoted 1 line
Quoted 1 line
build logging turned on started throwing weird errors complaining
like
Quoted 8 lines
Quoted 8 lines
this:
ERROR: Field '
project_id' doesn't have a default value <traceback omitted>And :
Quoted 11 lines
Quoted 11 lines
ERROR:
Traceback (most recent call last):
File "/poky/bitbake/lib/bb/ui/toasterui.py", line 191, in main
buildinfohelper.store_started_task(event)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 653, instore_started_task
recipe_information=self._get_recipe_information_from_taskfile(event.taskfile)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 551, in_get_recipe_information_from_taskfile
layer_version_obj=
self._get_layer_version_for_path(localfilepath)Quoted 5 lines
Quoted 5 lines
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 533, in
_get_layer_version_for_path
assert 'build' in self.internal_state
AssertionErrorQuoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
So I figured that there was probably some difference of opinion
between
Quoted 1 line
Quoted 1 line
the client and the server about the schema; I tried running the
Œsyncdb¹
Quoted 1 line
Quoted 1 line
and Œmigrate orm¹ commands again on the server but that didn¹t
help.
Quoted 23 lines
Quoted 22 lines
Quoted 5 lines
Quoted 5 lines
---
So next I figured I would just delete the Œtoaster¹ database and
start
Quoted 15 lines
Quoted 15 lines
over. I tried going into mysql and dropping the toaster database,
recreating it, and then redoing the two python commands, but that results
in this error from the migrate orm command:python
bitbake/lib/toaster/manage.pymigrate orm
Running migrations for orm:
- Migrating forwards to 0007_auto__add_helptext.Quoted 3 lines
orm:0001_initial
orm:0002_auto__add_field_build_timespent
orm:0003_timespent- Migration 'orm:0003_timespent' is marked for no-dry-run.
Quoted 2 lines
orm:0004_auto__add_field_package_installed_name
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
orm:0005_auto__add_target_image_file__add_target_file__add_field_variab le
hi
stor
FATAL ERROR - The following SQL query failed: ALTER TABLE
orm_buildQuoted 10 lines
Quoted 10 lines
Quoted 4 lines
Quoted 4 lines
ADD
COLUMNtimespentinteger NOT NULL DEFAULT 0;
The error was: (1060, "Duplicate column name 'timespent'")
RuntimeError: Cannot reverse this migration. 'Target.file_name' andits
Quoted 5 lines
Quoted 5 lines
values cannot be restored.
This was all done while working on the daisy branch.
So, then I tried the delete/recreate database trick again and
changed
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
back
to the master branch. Now I can run the two python commands ok,but
Quoted 9 lines
Quoted 9 lines
my
Quoted 8 lines
Quoted 8 lines
daisy clients are back to throwing the assert errors...
So, a few questions:
- Does it still work to run the production server on the master and clients running daisy, or do I have to use the daisy version of the production server, or do I need something newer than daisy but not
as
Quoted 41 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
new
as master?- If for whatever reason I need to recreate the database, what are
the
Quoted 2 lines
Quoted 2 lines
exact steps that I need to do to delete/recreate?
It seems like just dropping the Œtoaster¹ database and recreatingit
Quoted 31 lines
Quoted 13 lines
is
Quoted 3 lines
Quoted 3 lines
insufficient, but I am not sure what else to do.
The wiki pages are a bit vague on all this stuff, thanks for any
help.
Quoted 8 lines
Quoted 8 lines
Craig
--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster--
Alex DamianYocto ProjectSSG / OTC
Quoted 6 lines
--
Alex Damian
Yocto Project
SSG / OTC--
Alex Damian
Yocto Project
SSG / OTC
Signature · 3 lines
Alex Damian Yocto Project SSG / OTC
Hi Craig,
This is a bit of a mess - multiple problems throught Django and MySQL layers happen here.
The gist of it is that Django aborts a transaction when Mysqldb link layer raises an exception when a warning happens in the database itself; this is a needless escalation of importance for an exception. Furthermore, the warning from MySQL is incorrect, because we already instruct MySQL that the field that it reports missing may be missing, so that's that.
I have two workarounds for this:
- use a different database engine, like postgreSQL
- on builders (yocto-1.6 branch), modify in toastermain/settings.py DEBUG from True to False
There is nothing in the code that I can do to solve this. I will document the needed setup on the wiki.
Cheers,
Alex
Quoted 444 lines · Alexandru
Oh, I think I have something - it happens on mysql, but not on sqlite. This is important :)
I'll dive into it.
Alex
Quoted 420 lines · Alexandru
Hi Craig - I'd like to have a chat with you, are you on IRC ?
Unfortunately, I am unable to reproduce the errors you're seeing. I created the database at commit:
*a5531a2b8983318b99c119a87b78a9**2cf84160b8*and started the bitbake server and toasterui at commit:
*5306aaab07a7a9b3b0c7e8008dabbd**2e89daec28*and the build gets recorded without error.
I'm thinking you have *.pyc files remaining on disk between git checkouts, python not picking up changes, and getting old code running - but it may be any cause.
I'd like to debug this live with you online, do you have time for that ?
Alex
On Tue, Jul 8, 2014 at 3:40 PM, Neth, Craig Allen <[email protected]
Quoted 387 lines
wrote:
Hi Alex,
Ok, thanks. Bug 6512 was filed. Do you have any speculation about
when the problem might have been introduced? I don’t have any particular
need to run the bleeding edge toaster server; if there is an earlier branch that might work I’m happy to switch branches on the server end of things.The weird thing is that I tried reverting the server back to the Daisy branch but that also failed with a different set of problems, I received
errors when I ran the ‘migrate orm’ step. I figured that I had just fat
fingered some of the setup commands but I can’t seem to find the problem.Craig
From: <Damian>, Alexandru <[email protected]>
Date: Tuesday, July 8, 2014 at 7:09 AM
To: "Neth, Craig A" <[email protected]>
Cc: "Lerner, Dave" <[email protected]>, " [email protected]" <[email protected]>, IonutX Chisanovici <[email protected]>Subject: Re: [Toaster] Need help with Production toaster setup
Hi,
Thanks for the info -
No, the setup seems as it is designed to be.
I guess somewhere in origin/master things broke. We don't test this setup on our suite, but maybe we should start testing this, thus I CC'ed Ionut.
Meanwhile, I will start looking into fixing this. Can you please open a bug in Bugzilla so I can track it ?
Cheers,
AlexQuoted 298 lines · Craig Allen
Hi Alex,
Thanks for the response!
I just did a git pull on the master, and then did the following steps on the master machine:
mysql> drop database toaster;
mysql> create database toaster;python
bitbake/lib/toaster/manage.pysyncdb pythonbitbake/lib/toaster/manage.pymigrate orm pythonbitbake/lib/toaster/manage.pymigrate bldcontrol(The wiki page does not mention this last one but the ‘syncdb' command mentions that this one is also 'not synced’.)
To start the master, I have written a short upstart script that does the following:
DATABASE_URL='mysql://user:pass@node:3306/toaster' python
$BASEDIR/bitbake/lib/toaster/manage.pyrunserverThe server is up and running (I see the "This is Toaster" page).
On the clients, I normally use a modified version of the ‘toaster’ script
(I called it toaster-remote) that avoids starting the local webserver but
doing the commands listed on the wiki page doesn't change the outcome,
I
still see the same Assertion errors I mentioned in my initial message.As to your questions: We are indeed using mysql on the master. Git
commit ids:master:a5531a2b8983318b99c119a87b78a92cf84160b8
client:5306aaab07a7a9b3b0c7e8008dabbd2e89daec28I mentioned the commands I used above.
Thanks for any help. As I mentioned, we did have all this working
previously before I updated the master, so I don’t think my fundamental setup is wrong...Craig
From: <Damian>, Alexandru <[email protected]> Date: Friday, July 4, 2014 at 8:06 AM To: "Lerner, Dave" <[email protected]>Cc: "Neth, Craig A" <[email protected]>, "[email protected]" <[email protected]>
Subject: Re: [Toaster] Need help with Production toaster setupQuoted 6 lines
Hi Craig,
The system should work with the server running master, and the clients running daisy. The production database MUST be set up with the master, and the clients MUST NOT be started with the toaster script - the
script
Quoted 1 line
will get confused as to the current revision of the database. The flow
is:
Quoted 10 lines
- start toaster on the server, and let it create / update the database
- on the clients, you need to just start the bitbake server and the toasterui client before issuing command to the bitbake server - here there is the race condition that Dave already mentioned
Quoted 3 lines
If you need to drop and recreate the database, please always use the latest master - the clients, even if using an older version, should accomodate, we try keep the database schema changes backward
compatible.
Quoted 5 lines
For a short while, the "master" was broken due to a bad commit - you
may
Quoted 19 lines
have landed there with your master, can you please git pull lastest master ?
About the specific bug you see - can you please let me know more about your setup ?
- db engine you're using is mysql, right ?
- commit ids for master and daisy that you're using ?
- which commands do you use to start the server and the clients ?
Quoted 7 lines
Cheers,
AlexOn Thu, Jul 3, 2014 at 10:17 PM, Lerner, Dave <
Quoted 5 lines
wrote:
Hi Craig,
Did you delete your old database and recreate it using the current
clone
Quoted 2 lines
of poky as shown on
https://wiki.yoctoproject.org/wiki/Setting_up_a_local_instance_of_Toaster
Quoted 1 line
that is, running the database creation/migration commands that execute
in
Quoted 16 lines
'source toaster start'?
-dave
Quoted 12 lines
-----Original Message-----
From: Neth, Craig Allen [mailto:[email protected]]
Sent: Thursday, July 03, 2014 4:05 PM
To: Lerner, Dave
Cc: [email protected]
Subject: Re: Need help with Production toaster setupHi Dave,
Thanks for the quick response!
I had previous experienced the problem you mentioned and worked
around
Quoted 3 lines
Quoted 3 lines
it
by adding a sleep between the —observe-only and the bitbake command. Without the sleep, as you mention the events were just gettingdropped.
Quoted 4 lines
Quoted 4 lines
It’s nice to see a proper fix for that, however.
But I don’t think that’s what’s happening now; from the tracebacks it looks like the clients are sending events to the database but it’s
not
Quoted 13 lines
Quoted 13 lines
setup the way they expect...
My suspicion is that the schemas have changed but I don’t know how to get
my database back into a state where it matches the schema the client expects.Craig
On 7/3/14, 4:52 PM, "Lerner, Dave" <[email protected]>
Quoted 5 lines · wrote:
Quoted 5 lines
Quoted 5 lines
Hi Craig,
A patch submitted 15 minutes ago may solve your problem, it sounds similar to the problem that appeared after daisy in my script that
did:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
bitbake --server-only ...
bitbake --observe-only ... ToasterUI
bitbake <some-image>With recent releases the 'bitbake <some-image>' fires before the ToasterUI is ready (2nd command) to read events. The patch in
https://bugzilla.yoctoproject.org/show_bug.cgi?id=6504 writes amessage
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
to the log file. You can change your script to block until that log message appears, before launching a build - if that's your problem.
Hope this helps,
Dave LernerQuoted 8 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Neth, Craig Allen
Sent: Thursday, July 03, 2014 3:34 PM
To: [email protected]
Subject: [Toaster] Need help with Production toaster setupQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
A month or so ago, I set up a production toaster instance using
the
Quoted 3 lines
Quoted 3 lines
poky
Quoted 2 lines
Quoted 2 lines
master branch.
Our projects were building with Daisy. Everything was workingfine.
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
For various reasons, I needed to redo the production instance and
that
Quoted 1 line
Quoted 1 line
involved recloning the poky master repo, and now I¹m having
issuesŠ
Quoted 30 lines
Quoted 30 lines
Quoted 2 lines
Quoted 2 lines
After recloning poky and restarting the server, all my builds with
the
Quoted 1 line
Quoted 1 line
build logging turned on started throwing weird errors complaining
like
Quoted 8 lines
Quoted 8 lines
this:
ERROR: Field '
project_id' doesn't have a default value <traceback omitted>And :
Quoted 11 lines
Quoted 11 lines
ERROR:
Traceback (most recent call last):
File "/poky/bitbake/lib/bb/ui/toasterui.py", line 191, in main
buildinfohelper.store_started_task(event)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 653, instore_started_task
recipe_information=self._get_recipe_information_from_taskfile(event.taskfile)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 551, in_get_recipe_information_from_taskfile
layer_version_obj=
self._get_layer_version_for_path(localfilepath)Quoted 5 lines
Quoted 5 lines
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 533, in
_get_layer_version_for_path
assert 'build' in self.internal_state
AssertionErrorQuoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
So I figured that there was probably some difference of opinion
between
Quoted 1 line
Quoted 1 line
the client and the server about the schema; I tried running the
Œsyncdb¹
Quoted 1 line
Quoted 1 line
and Œmigrate orm¹ commands again on the server but that didn¹t
help.
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
---
So next I figured I would just delete the Œtoaster¹ database and
start
Quoted 1 line
Quoted 1 line
over. I tried going into mysql and dropping the toaster
database,
Quoted 16 lines
Quoted 15 lines
Quoted 14 lines
Quoted 14 lines
recreating it, and then redoing the two python commands, but that results
in this error from the migrate orm command:python
bitbake/lib/toaster/manage.pymigrate orm Running migrations for orm:
- Migrating forwards to 0007_auto__add_helptext.Quoted 3 lines
orm:0001_initial
orm:0002_auto__add_field_build_timespent
orm:0003_timespent- Migration 'orm:0003_timespent' is marked for no-dry-run.
Quoted 2 lines
orm:0004_auto__add_field_package_installed_name
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
orm:0005_auto__add_target_image_file__add_target_file__add_field_variab le
hi
stor
FATAL ERROR - The following SQL query failed: ALTER TABLE
orm_buildQuoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
ADD
COLUMNtimespentinteger NOT NULL DEFAULT 0;
The error was: (1060, "Duplicate column name 'timespent'")
RuntimeError: Cannot reverse this migration. 'Target.file_name'and
Quoted 6 lines
Quoted 6 lines
its
Quoted 5 lines
Quoted 5 lines
values cannot be restored.
This was all done while working on the daisy branch.
So, then I tried the delete/recreate database trick again and
changed
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
back
to the master branch. Now I can run the two python commands ok,but
Quoted 7 lines
Quoted 7 lines
my
Quoted 6 lines
Quoted 6 lines
daisy clients are back to throwing the assert errors...
So, a few questions:
- Does it still work to run the production server on the master
and
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
clients running daisy, or do I have to use the daisy version of
the
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
production server, or do I need something newer than daisy but
not as
Quoted 41 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
new
as master?- If for whatever reason I need to recreate the database, what are
the
Quoted 2 lines
Quoted 2 lines
exact steps that I need to do to delete/recreate?
It seems like just dropping the Œtoaster¹ database and recreatingit
Quoted 31 lines
Quoted 13 lines
is
Quoted 3 lines
Quoted 3 lines
insufficient, but I am not sure what else to do.
The wiki pages are a bit vague on all this stuff, thanks for any
help.
Quoted 8 lines
Quoted 8 lines
Craig
--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster--
Alex DamianYocto ProjectSSG / OTC
Quoted 6 lines
--
Alex Damian
Yocto Project
SSG / OTCQuoted 5 lines
--
Alex Damian
Yocto Project
SSG / OTC--
Alex Damian
Yocto Project
SSG / OTC
Signature · 3 lines
Alex Damian Yocto Project SSG / OTC
Hi Alex,
Thanks for all the hard work. It does indeed sound a mess.
And I am able to verify that your workaround works for us. Thank you!
Craig
From: <Damian>, Alexandru <[email protected]<mailto:[email protected]>>
Date: Friday, July 11, 2014 at 6:49 AM
To: "Neth, Craig A" <[email protected]<mailto:[email protected]>>
Cc: "Lerner, Dave" <[email protected]<mailto:[email protected]>>, "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>, IonutX Chisanovici <[email protected]<mailto:[email protected]>>
Subject: Re: [Toaster] Need help with Production toaster setup
Hi Craig,
This is a bit of a mess - multiple problems throught Django and MySQL layers happen here.
The gist of it is that Django aborts a transaction when Mysqldb link layer raises an exception when a warning happens in the database itself; this is a needless escalation of importance for an exception. Furthermore, the warning from MySQL is incorrect, because we already instruct MySQL that the field that it reports missing may be missing, so that's that.
I have two workarounds for this:
- use a different database engine, like postgreSQL
- on builders (yocto-1.6 branch), modify in toastermain/settings.py DEBUG from True to False
There is nothing in the code that I can do to solve this. I will document the needed setup on the wiki.
Cheers,
Alex
On Wed, Jul 9, 2014 at 1:07 PM, Damian, Alexandru <[email protected]<mailto:[email protected]>> wrote:
Oh, I think I have something - it happens on mysql, but not on sqlite. This is important :)
I'll dive into it.
Alex
On Wed, Jul 9, 2014 at 12:54 PM, Damian, Alexandru <[email protected]<mailto:[email protected]>> wrote:
Hi Craig - I'd like to have a chat with you, are you on IRC ?
Unfortunately, I am unable to reproduce the errors you're seeing. I created the database at commit:a5531a2b8983318b99c119a87b78a92cf84160b8
and started the bitbake server and toasterui at commit:5306aaab07a7a9b3b0c7e8008dabbd2e89daec28
and the build gets recorded without error.
I'm thinking you have *.pyc files remaining on disk between git checkouts, python not picking up changes, and getting old code running - but it may be any cause.
I'd like to debug this live with you online, do you have time for that ?
Alex
On Tue, Jul 8, 2014 at 3:40 PM, Neth, Craig Allen <[email protected]<mailto:[email protected]>> wrote:
Hi Alex,
Ok, thanks. Bug 6512 was filed. Do you have any speculation about when the problem might have been introduced? I don’t have any particular need to run the bleeding edge toaster server; if there is an earlier branch that might work I’m happy to switch branches on the server end of things.
The weird thing is that I tried reverting the server back to the Daisy branch but that also failed with a different set of problems, I received errors when I ran the ‘migrate orm’ step. I figured that I had just fat fingered some of the setup commands but I can’t seem to find the problem.
Craig
From: <Damian>, Alexandru <[email protected]<mailto:[email protected]>>
Date: Tuesday, July 8, 2014 at 7:09 AM
To: "Neth, Craig A" <[email protected]<mailto:[email protected]>>
Cc: "Lerner, Dave" <[email protected]<mailto:[email protected]>>, "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>, IonutX Chisanovici <[email protected]<mailto:[email protected]>>
Subject: Re: [Toaster] Need help with Production toaster setup
Hi,
Thanks for the info -
No, the setup seems as it is designed to be.
I guess somewhere in origin/master things broke. We don't test this setup on our suite, but maybe we should start testing this, thus I CC'ed Ionut.
Meanwhile, I will start looking into fixing this. Can you please open a bug in Bugzilla so I can track it ?
Cheers,
Alex
On Mon, Jul 7, 2014 at 3:45 PM, Neth, Craig Allen <[email protected]<mailto:[email protected]>> wrote:
Hi Alex,
Thanks for the response!
I just did a git pull on the master, and then did the following steps on the master machine:
mysql> drop database toaster;
mysql> create database toaster;
python bitbake/lib/toaster/manage.py syncdb python bitbake/lib/toaster/manage.py migrate orm python bitbake/lib/toaster/manage.py migrate bldcontrol
(The wiki page does not mention this last one but the ‘syncdb' command mentions that this one is also 'not synced’.)
To start the master, I have written a short upstart script that does the following:
DATABASE_URL='mysql://user:pass@node:3306/toaster' python $BASEDIR/bitbake/lib/toaster/manage.py runserver
The server is up and running (I see the "This is Toaster" page).
On the clients, I normally use a modified version of the ‘toaster’ script (I called it toaster-remote) that avoids starting the local webserver but doing the commands listed on the wiki page doesn't change the outcome, I still see the same Assertion errors I mentioned in my initial message.
As to your questions: We are indeed using mysql on the master. Git
commit ids:
master:a5531a2b8983318b99c119a87b78a92cf84160b8
client:5306aaab07a7a9b3b0c7e8008dabbd2e89daec28
I mentioned the commands I used above.
Thanks for any help. As I mentioned, we did have all this working
previously before I updated the master, so I don’t think my fundamental setup is wrong...
Craig
From: <Damian>, Alexandru <[email protected]<mailto:[email protected]>> Date: Friday, July 4, 2014 at 8:06 AM To: "Lerner, Dave" <[email protected]<mailto:[email protected]>>
Cc: "Neth, Craig A" <[email protected]<mailto:[email protected]>>, "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
Subject: Re: [Toaster] Need help with Production toaster setup
Quoted 247 lines
Hi Craig,
The system should work with the server running master, and the clients running daisy. The production database MUST be set up with the master, and the clients MUST NOT be started with the toaster script - the script will get confused as to the current revision of the database. The flow is:
- start toaster on the server, and let it create / update the database
- on the clients, you need to just start the bitbake server and the toasterui client before issuing command to the bitbake server - here there is the race condition that Dave already mentioned
If you need to drop and recreate the database, please always use the latest master - the clients, even if using an older version, should accomodate, we try keep the database schema changes backward compatible.
For a short while, the "master" was broken due to a bad commit - you may have landed there with your master, can you please git pull lastest master ?
About the specific bug you see - can you please let me know more about your setup ?
- db engine you're using is mysql, right ?
- commit ids for master and daisy that you're using ?
- which commands do you use to start the server and the clients ?
Cheers,
AlexOn Thu, Jul 3, 2014 at 10:17 PM, Lerner, Dave <[email protected]<mailto:[email protected]>> wrote:
Hi Craig,
Did you delete your old database and recreate it using the current clone of poky as shown on
https://wiki.yoctoproject.org/wiki/Setting_up_a_local_instance_of_Toaster
that is, running the database creation/migration commands that execute in
'source toaster start'?-dave
Quoted 154 lines
-----Original Message-----
From: Neth, Craig Allen [mailto:[email protected]<mailto:[email protected]>]
Sent: Thursday, July 03, 2014 4:05 PM
To: Lerner, Dave
Cc: [email protected]<mailto:[email protected]>
Subject: Re: Need help with Production toaster setupHi Dave,
Thanks for the quick response!
I had previous experienced the problem you mentioned and worked around it
by adding a sleep between the —observe-only and the bitbake command. Without the sleep, as you mention the events were just getting dropped. It’s nice to see a proper fix for that, however.But I don’t think that’s what’s happening now; from the tracebacks it looks like the clients are sending events to the database but it’s not setup the way they expect...
My suspicion is that the schemas have changed but I don’t know how to get
my database back into a state where it matches the schema the client expects.Craig
Quoted 9 lines · On 7/3/14, 4:52 PM, "Lerner, Dave" <[email protected]<mailto:dave.lerne…
Hi Craig,
A patch submitted 15 minutes ago may solve your problem, it sounds similar to the problem that appeared after daisy in my script that did:
bitbake --server-only ...
bitbake --observe-only ... ToasterUI
bitbake <some-image>Quoted 18 lines
With recent releases the 'bitbake <some-image>' fires before the ToasterUI is ready (2nd command) to read events. The patch in
https://bugzilla.yoctoproject.org/show_bug.cgi?id=6504 writes a message to the log file. You can change your script to block until that log message appears, before launching a build - if that's your problem.Hope this helps,
Dave LernerQuoted 9 lines
-----Original Message-----
From: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>] On Behalf Of Neth, Craig Allen
Sent: Thursday, July 03, 2014 3:34 PM
To: [email protected]<mailto:[email protected]>
Subject: [Toaster] Need help with Production toaster setupA month or so ago, I set up a production toaster instance using the
poky
Quoted 4 lines
Quoted 4 lines
master branch.
Our projects were building with Daisy. Everything was working fine.For various reasons, I needed to redo the production instance and
that
Quoted 3 lines
Quoted 3 lines
involved recloning the poky master repo, and now I¹m having issuesŠ
After recloning poky and restarting the server, all my builds with
the
Quoted 1 line
Quoted 1 line
build logging turned on started throwing weird errors complaining
like
Quoted 8 lines
Quoted 8 lines
this:
ERROR: Field '
project_id' doesn't have a default value <traceback omitted>And :
Quoted 11 lines
Quoted 11 lines
ERROR:
Traceback (most recent call last):
File "/poky/bitbake/lib/bb/ui/toasterui.py", line 191, in main
buildinfohelper.store_started_task(event)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 653, instore_started_task
recipe_information=self._get_recipe_information_from_taskfile(event.taskfile)
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 551, in_get_recipe_information_from_taskfile
layer_version_obj=
self._get_layer_version_for_path(localfilepath)Quoted 6 lines
Quoted 6 lines
File "/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 533, in
_get_layer_version_for_path
assert 'build' in self.internal_state
AssertionErrorSo I figured that there was probably some difference of opinion
between
Quoted 1 line
Quoted 1 line
the client and the server about the schema; I tried running the
Œsyncdb¹
Quoted 6 lines
Quoted 6 lines
and Œmigrate orm¹ commands again on the server but that didn¹t help.
---
So next I figured I would just delete the Œtoaster¹ database and
start
Quoted 16 lines
Quoted 15 lines
over. I tried going into mysql and dropping the toaster database,
recreating it, and then redoing the two python commands, but that results
in this error from the migrate orm command:python
bitbake/lib/toaster/manage.pymigrate orm
Running migrations for orm:
- Migrating forwards to 0007_auto__add_helptext.Quoted 3 lines
orm:0001_initial
orm:0002_auto__add_field_build_timespent
orm:0003_timespent- Migration 'orm:0003_timespent' is marked for no-dry-run.
Quoted 2 lines
orm:0004_auto__add_field_package_installed_name
Quoted 9 lines
Quoted 9 lines
orm:0005_auto__add_target_image_file__add_target_file__add_field_variab le
hi
stor
FATAL ERROR - The following SQL query failed: ALTER TABLEorm_buildADD
COLUMNtimespentinteger NOT NULL DEFAULT 0;
The error was: (1060, "Duplicate column name 'timespent'")
RuntimeError: Cannot reverse this migration. 'Target.file_name' andits
Quoted 7 lines
Quoted 7 lines
values cannot be restored.
This was all done while working on the daisy branch.
So, then I tried the delete/recreate database trick again and changed back
to the master branch. Now I can run the two python commands ok, butmy
Quoted 5 lines
Quoted 5 lines
daisy clients are back to throwing the assert errors...
So, a few questions:
Quoted 7 lines
Quoted 7 lines
- Does it still work to run the production server on the master and clients running daisy, or do I have to use the daisy version of the production server, or do I need something newer than daisy but not as new
as master?- If for whatever reason I need to recreate the database, what are
Quoted 16 lines
the
Quoted 2 lines
Quoted 2 lines
exact steps that I need to do to delete/recreate?
It seems like just dropping the Œtoaster¹ database and recreating itis
Quoted 3 lines
Quoted 3 lines
insufficient, but I am not sure what else to do.
The wiki pages are a bit vague on all this stuff, thanks for any
help.
Quoted 8 lines
Quoted 8 lines
Craig
--
_______________________________________________
toaster mailing list [email protected]<mailto:[email protected]>
https://lists.yoctoproject.org/listinfo/toaster--
_______________________________________________
toaster mailing list [email protected]<mailto:[email protected]>
https://lists.yoctoproject.org/listinfo/toaster
Quoted 4 lines
--
Alex DamianYocto ProjectSSG / OTC
--
Alex Damian
Yocto Project
SSG / OTC
--
Alex Damian
Yocto Project
SSG / OTC
--
Alex Damian
Yocto Project
SSG / OTC
--
Alex Damian
Yocto Project
SSG / OTC