Closed Bug 681523 Opened 14 years ago Closed 12 years ago

[traceback] OperationalError: (1054, "Unknown column 'user_profiles.irc_nickname' in 'field list'")

Categories

(developer.mozilla.org Graveyard :: Wiki pages, defect)

defect
Not set
critical

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: retornam, Unassigned)

References

()

Details

(Whiteboard: [fromAutomation])

Traceback (most recent call last): File "/data/www/django/developer-stage9.mozilla.org/kuma/vendor/src/django/django/core/handlers/base.py", line 100, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/data/www/django/developer-stage9.mozilla.org/kuma/apps/demos/views.py", line 90, in home template_name='demos/home.html') File "/data/www/django/developer-stage9.mozilla.org/kuma/vendor/src/django/django/views/generic/list_detail.py", line 101, in object_list return HttpResponse(t.render(c), mimetype=mimetype) File "/data/www/django/developer-stage9.mozilla.org/kuma/lib/utils.py", line 104, in render return self.template.render(context_dict) File "/usr/lib/python2.6/site-packages/jinja2/environment.py", line 891, in render return self.environment.handle_exception(exc_info, True) File "/data/www/django/developer-stage9.mozilla.org/kuma/apps/demos/templates/demos/home.html", line 1, in top-level template code {% extends "demos/base.html" %} File "/data/www/django/developer-stage9.mozilla.org/kuma/apps/demos/templates/demos/base.html", line 1, in top-level template code {% extends "base.html" %} File "/data/www/django/developer-stage9.mozilla.org/kuma/templates/base.html", line 138, in top-level template code {% block content %}{% endblock %} File "/data/www/django/developer-stage9.mozilla.org/kuma/apps/demos/templates/demos/home.html", line 64, in block "content" <p class="byline vcard">{{ profile_link(submission.creator, show_gravatar=True) }}</p> File "/data/www/django/developer-stage9.mozilla.org/kuma/vendor/src/jingo/jingo/__init__.py", line 146, in wrapper t = env.get_template(template).render(context) File "/usr/lib/python2.6/site-packages/jinja2/environment.py", line 891, in render return self.environment.handle_exception(exc_info, True) File "/data/www/django/developer-stage9.mozilla.org/kuma/apps/demos/templates/demos/elements/profile_link.html", line 2, in top-level template code <a href="{{ url('devmo.views.profile_view', username=user.username) }}" class="url fn" title="{{_('See {display_name}\'s profile') | f(display_name=display_name)}}">{% if show_gravatar %}<img src="{{ user.get_profile().gravatar }}" class="photo avatar" width="{{ gravatar_size }}" height="{{ gravatar_size }}" border="0" /> {% endif %}<span>{{ display_name }}</span></a> File "/data/www/django/developer-stage9.mozilla.org/kuma/vendor/src/django/django/contrib/auth/models.py", line 373, in get_profile self._profile_cache = model._default_manager.using(self._state.db).get(user__id__exact=self.id) File "/data/www/django/developer-stage9.mozilla.org/kuma/vendor/src/django/django/db/models/query.py", line 342, in get num = len(clone) File "/data/www/django/developer-stage9.mozilla.org/kuma/vendor/src/django/django/db/models/query.py", line 80, in __len__ self._result_cache = list(self.iterator()) File "/data/www/django/developer-stage9.mozilla.org/kuma/vendor/src/django-cache-machine/caching/base.py", line 106, in __iter__ obj = iterator.next() File "/data/www/django/developer-stage9.mozilla.org/kuma/vendor/src/django/django/db/models/query.py", line 271, in iterator for row in compiler.results_iter(): File "/data/www/django/developer-stage9.mozilla.org/kuma/vendor/src/django/django/db/models/sql/compiler.py", line 677, in results_iter for rows in self.execute_sql(MULTI): File "/data/www/django/developer-stage9.mozilla.org/kuma/vendor/src/django/django/db/models/sql/compiler.py", line 732, in execute_sql cursor.execute(sql, params) File "/data/www/django/developer-stage9.mozilla.org/kuma/vendor/src/django/django/db/backends/mysql/base.py", line 86, in execute return self.cursor.execute(query, args) File "/usr/lib/python2.6/site-packages/MySQLdb/cursors.py", line 173, in execute self.errorhandler(self, exc, value) File "/usr/lib/python2.6/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler raise errorclass, errorvalue OperationalError: (1054, "Unknown column 'user_profiles.irc_nickname' in 'field list'")
This happened multiple times
Severity: normal → critical
OS: Mac OS X → All
Hardware: x86 → All
Summary: OperationalError: (1054, "Unknown column 'user_profiles.irc_nickname' in 'field list'") → [traceback] OperationalError: (1054, "Unknown column 'user_profiles.irc_nickname' in 'field list'")
Looks like somewhere in the merging process for bug 674755 the migration that adds that column in the DB got lost. Not sure how it got this far, since the added tests require that column to exist and Jenkins passed it. But grabbing this commit will get the migration, and then we should be clear again: https://github.com/ubernostrum/kuma/commit/fe500bf23e8c28bc1e7b4ca8213e67c5611da664
The CI machine and the stage server use different build scripts. CI uses scripts/build.sh and update_stage cron job uses scripts/update_sit.py build.sh uses FORCE_DB='yes sir' which uses syncdb so it recreates the entire database from scratch straight from the models. update_site.py duplicates the push process using the schematic and south migrations we write so that it preserves the data on stage9. I wonder - should we adjust build.sh to use schematic & south migrations instead of forcing the syncdb?
Whiteboard: [fromAutomation]
The other benefit of FORCE_DB='yes' is that it clears out any lingering test data. I wouldn't be surprised if that caused quite a number of tests to break, since I don't think it tends to be common practice to clean up after themselves.
build.sh already uses FORCE_DB='yes' for the CI machine tests. I don't know how much work goes into "adjust build.sh to use schematic & south migrations instead of forcing syncdb" ... it seems like we'd have to dive into django-nose?
Well, I think it's more like we'd have to dive into every test class and make sure each one deletes all the data that tests create on setUp/tearDown
Version: Kuma → unspecified
Component: Website → Landing pages
James: Still an issue?
Flags: needinfo?(jbennett)
The commit mentioned in my comment was merged at about the time I made that comment. If nobody's reported issues in the intervening nearly-two-year period, I'd say we can call this fixed.
Status: NEW → RESOLVED
Closed: 12 years ago
Flags: needinfo?(jbennett)
Resolution: --- → FIXED
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.