Bug 7083 - Building with the "New build" button breaks the project page
Summary: Building with the "New build" button breaks the project page
Status: VERIFIED NOTABUG
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: 1.8
Hardware: x86 Multiple
: Medium+ major
Target Milestone: 1.8 M2
Assignee: Michael Wood
QA Contact: Mihail Stanciu
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2014-12-15 14:32 UTC by Mihail Stanciu
Modified: 2015-01-23 10:35 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
XHR error (16.67 KB, image/jpeg)
2014-12-15 14:32 UTC, Mihail Stanciu
no flags Details
orm column error (59.17 KB, image/jpeg)
2014-12-15 14:34 UTC, Mihail Stanciu
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mihail Stanciu 2014-12-15 14:32:02 UTC
Created attachment 2298 [details]
XHR error

Steps to reproduce:

1. In the "All builds" page, click on the "new build" button
2. Select an existing project, input image name "core-image-minimal"(for example) and click the "build" button.

Expected result:
A new build should start in the selected project.

Observed result:
The browser throws an error "Failed HTTP XHR request(0)" - see first attachment.

Afterwards, when trying to access the main project page you get a django error "no such column: orm_release.branch" - see second attachment.
Comment 1 Mihail Stanciu 2014-12-15 14:34:37 UTC
Created attachment 2299 [details]
orm column error
Comment 2 Mihail Stanciu 2014-12-15 15:01:15 UTC
Adding traceback dump:

Environment:


Request Method: GET
Request URL: http://localhost:8000/toastergui/newproject/

Django Version: 1.5
Python Version: 2.7.5
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.messages',
 'django.contrib.sessions',
 'django.contrib.admin',
 'django.contrib.staticfiles',
 'django.contrib.humanize',
 'orm',
 'toastermain',
 'south',
 'bldcontrol',
 'bldviewer',
 'toastergui')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Template error:
In template /home/gushie/poky/bitbake/lib/toaster/toastergui/templates/newproject.html, error at line 31
   no such column: orm_release.branch
   21 : 					<i class="icon-question-sign get-help" title="The go-to person for this project"></i>


   22 : 							</label>


   23 : 							<input type="text" name="username" value="{{username}}">


   24 : 							<label class="project-form">Owner's email</label>


   25 : 							<input type="email" class="input-large" name="email" value="{{email}}">


   26 : 							<label class="project-form">


   27 : 								Yocto Project version


   28 : 								<i class="icon-question-sign get-help" title="This sets the branch for the Yocto Project core layers (meta, meta-yocto and meta-yocto-bsp), and for the layers you use from the OpenEmbedded Metadata Index"></i>


   29 : 							</label>


   30 : 							<select name="projectversion" id="projectversion">


   31 : 	 {% for release in releases %} 


   32 : 		<option value="{{release.id}}"{%if projectversion == release.id %} selected{%endif%}>{{release.name}} ({{release.description}})</option>


   33 : 	{% endfor %}


   34 : 							</select>


   35 : 						</fieldset>


   36 : 


   37 : 						<div class="form-actions">


   38 : 							<input type="submit" class="btn btn-primary btn-large" value="Create project"/>


   39 : 						</div>


   40 : 					</form>


   41 : 				</div>


Traceback:
File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  115.                         response = callback(request, *callback_args, **callback_kwargs)
File "/home/gushie/poky/bitbake/lib/toaster/toastergui/views.py" in newproject
  1834.             return render(request, template, context)
File "/usr/lib/python2.7/site-packages/django/shortcuts/__init__.py" in render
  53.     return HttpResponse(loader.render_to_string(*args, **kwargs),
File "/usr/lib/python2.7/site-packages/django/template/loader.py" in render_to_string
  177.         return t.render(context_instance)
File "/usr/lib/python2.7/site-packages/django/template/base.py" in render
  140.             return self._render(context)
File "/usr/lib/python2.7/site-packages/django/template/base.py" in _render
  134.         return self.nodelist.render(context)
File "/usr/lib/python2.7/site-packages/django/template/base.py" in render
  830.                 bit = self.render_node(node, context)
File "/usr/lib/python2.7/site-packages/django/template/debug.py" in render_node
  74.             return node.render(context)
File "/usr/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  124.         return compiled_parent._render(context)
File "/usr/lib/python2.7/site-packages/django/template/base.py" in _render
  134.         return self.nodelist.render(context)
File "/usr/lib/python2.7/site-packages/django/template/base.py" in render
  830.                 bit = self.render_node(node, context)
File "/usr/lib/python2.7/site-packages/django/template/debug.py" in render_node
  74.             return node.render(context)
File "/usr/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  63.             result = block.nodelist.render(context)
File "/usr/lib/python2.7/site-packages/django/template/base.py" in render
  830.                 bit = self.render_node(node, context)
File "/usr/lib/python2.7/site-packages/django/template/debug.py" in render_node
  74.             return node.render(context)
File "/usr/lib/python2.7/site-packages/django/template/defaulttags.py" in render
  148.         len_values = len(values)
File "/usr/lib/python2.7/site-packages/django/db/models/query.py" in __len__
  90.                 self._result_cache = list(self.iterator())
File "/usr/lib/python2.7/site-packages/django/db/models/query.py" in iterator
  301.         for row in compiler.results_iter():
File "/usr/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in results_iter
  775.         for rows in self.execute_sql(MULTI):
File "/usr/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql
  840.         cursor.execute(sql, params)
File "/usr/lib/python2.7/site-packages/django/db/backends/util.py" in execute
  41.             return self.cursor.execute(sql, params)
File "/usr/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py" in execute
  366.             six.reraise(utils.DatabaseError, utils.DatabaseError(*tuple(e.args)), sys.exc_info()[2])
File "/usr/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py" in execute
  362.             return Database.Cursor.execute(self, query, params)

Exception Type: DatabaseError at /toastergui/newproject/
Exception Value: no such column: orm_release.branch
Comment 3 Michael Wood 2015-01-05 18:12:27 UTC
The commit 0b6859cd removed the branch field from the database and references to it. I'm not able to find a reference to it in the current poky/master.

Can you confirm which git repo, branch and what the HEAD SHA is currently?
Comment 4 Mihail Stanciu 2015-01-09 09:31:10 UTC
I'm sorry for the oversight.

This was tested on commit b813bdebb36501500e86fea5f7e15b4b15ea0902 
That was on master, specifically the 1.8 M1 RC1 commit issued on Dec 8th.
Comment 5 Michael Wood 2015-01-14 12:26:02 UTC
I've tested the steps to reproduce this on the same commit on a new poky/master and cannot reproduce this error. I think it must be to do with your database setup script not having run correctly or a non-migrated database schema.

If the issue persists in newer versions please feel free to re-open the bug.
Comment 6 Mihail Stanciu 2015-01-23 10:35:59 UTC
Verified.