Hi Christian, Your instinct is correct. I printed out the mutations in the evolve process, and find the faulting field 'raw_file_url' is 'AddField' in hinted version and 'ChangeField' in stored version. I don't know why this is happening but it seems that the evolve history contained an entry of 'raw_file_url' but in fact not applied. After a manual remove of the history, rb-site successfully upgraded the instance.
Thanks for your help and I'd like to know the reason of this confusion. Terry On Jan 11, 7:46 pm, Christian Hammond <chip...@chipx86.com> wrote: > What I think is happening is that it's attempting to apply the > database migration for lengthening the raw URL field's maximum size > without having applied the addition of that field first. It's possible > that this is due to some confusion in your database's migration > history. > > Can you go to:http://yoursite/admin/db/django_evolution/evolution/ > and screenshot what you see? You can send it to me privately. It'll > help figure out what's been applied and what hasn't. We may be able to > fix this manually. > > Before we do anything further, though, please make sure you have a > full backup of your database. > > Christian > > -- > Christian Hammond - chip...@chipx86.com > Review Board -http://www.reviewboard.org > VMware, Inc. -http://www.vmware.com > > > > On Tue, Jan 11, 2011 at 3:39 AM, Christian Hammond <chip...@chipx86.com> > wrote: > > Hi Terry, > > > Just for future reference, you specifically need the -- before the > > --hint. This tells rb-site to ignore the --hint and to instead pass it > > on to the evolve management command. > > > What version of Django do you have running on there? > > > Christian > > > -- > > Christian Hammond - chip...@chipx86.com > > Review Board -http://www.reviewboard.org > > VMware, Inc. -http://www.vmware.com > > > On Tue, Jan 11, 2011 at 3:26 AM, Terry Zhong <think...@gmail.com> wrote: > >> Hi Christian, > > >> Thanks for the reply. > >> "rb-site manage /var/reviewboard evolve -- --hint" gives option error, > >> however, I tried something else. > >> The instance has been running for over 2 years, I don't know the exact > >> version I install at first but I believe it's 0.9.x. It has been > >> upgraded all the way to 1.0.9, nice and smooth. No in-development > >> release has been used ever since 1.0. > > >> I even tried to edit diffviewer/models.py to add a default value 'M' > >> to FileDiff.status, so that "evolve --hint --execute" was a success, > >> but syncdb still reports errors: > >> Upgrading Review Board from 1.0.9 to 1.5.2 > >> There are unapplied evolutions for diffviewer. > >> There are unapplied evolutions for reviews. > >> There are unapplied evolutions for scmtools. > >> No fixtures found. > > >> # pwd > >> /usr/local/lib/python2.6/dist-packages/ReviewBoard-1.5.2-py2.6.egg/ > >> reviewboard > > >> # rb-site manager /var/reviewboard evolve -- --hint > >> Usage: rb-site command [options] path > > >> Options: > >> --version show program's version number and exit > >> -h, --help show this help message and exit > >> (and more) > > >> # rb-site manage /var/reviewboard evolve --hint > >> Usage: rb-site command [options] path > > >> rb-site: error: no such option: --hint > > >> # PYTHONPATH=/var/reviewboard/conf ./manage.py evolve --hint > >> #----- Evolution for diffviewer > >> from django_evolution.mutations import * > >> from django.db import models > > >> MUTATIONS = [ > >> AddField('DiffSet', 'basedir', models.CharField, initial=u'', > >> max_length=256), > >> AddField('FileDiff', 'status', models.CharField, initial=<<USER > >> VALUE REQUIRED>>, max_length=1) > >> ] > >> #---------------------- > >> #----- Evolution for reviews > >> from django_evolution.mutations import * > >> from django.db import models > > >> MUTATIONS = [ > >> AddField('DefaultReviewer', 'repository', models.ManyToManyField, > >> related_model='scmtools.Repository'), > >> ChangeField('ReviewRequest', 'repository', initial=None, > >> null=True) > >> ] > >> #---------------------- > >> #----- Evolution for scmtools > >> from django_evolution.mutations import * > >> from django.db import models > > >> MUTATIONS = [ > >> AddField('Repository', 'visible', models.BooleanField, > >> initial=True), > >> AddField('Repository', 'raw_file_url', models.CharField, > >> initial='', max_length=255), > >> ChangeField('Repository', 'path', initial=None, max_length=255), > >> ChangeField('Repository', 'mirror_path', initial=None, > >> max_length=255) > >> ] > >> #---------------------- > >> Trial evolution successful. > >> Run './manage.py evolve --hint --execute' to apply evolution. > > >> On Jan 11, 4:59 am, Christian Hammond <chip...@chipx86.com> wrote: > >>> Hi Terry, > > >>> That's strange... Can you run a test for me: > > >>> do: > > >>> rb-site manage /var/reviewboard evolve -- --hint > > >>> (Note that those are double hyphens, not single hyphens) > > >>> Show me the results. May hopefully shed some light on it. > > >>> At any point, did you try to upgrade to an in-development release > >>> (either nightly or straight from Git)? > > >>> Also, do you remember what version of Review Board you started with? > > >>> Christian > > >>> -- > >>> Christian Hammond - chip...@chipx86.com > >>> Review Board -http://www.reviewboard.org > >>> VMware, Inc. -http://www.vmware.com > > >>> On Mon, Jan 10, 2011 at 12:29 PM, Terry Zhong <think...@gmail.com> wrote: > >>> > Hi all, > > >>> > We have a Review Board 1.0.9 server running smoothly, but the > >>> > upgrading to 1.5 fails, with tracebacks below. We've tried 1.5, 1.5.1 > >>> > and 1.5.2 with easy_install, same tracebacks. Would you please help us > >>> > out, thanks a lot. > > >>> > Debian Squeeze > >>> > Python 2.6.6 > >>> > MySQL 5.1.49 > > >>> > # rb-site upgrade /var/reviewboard/ > >>> > Rebuilding directory structure > >>> > Updating database. This may take a while. > >>> > Upgrading Review Board from 1.0.9 to 1.5.2 > >>> > There are unapplied evolutions for diffviewer. > >>> > There are unapplied evolutions for reviews. > >>> > There are unapplied evolutions for scmtools. > >>> > Project signature has changed - an evolution is required > >>> > No fixtures found. > >>> > /usr/lib/python2.6/dist-packages/Crypto/Util/randpool.py:40: > >>> > RandomPool_DeprecationWarning: This application uses RandomPool, which > >>> > is BROKEN in older releases. Seehttp://www.pycrypto.org/randpool-broken > >>> > RandomPool_DeprecationWarning) > >>> > Traceback (most recent call last): > >>> > File "/usr/local/bin/rb-site", line 9, in <module> > >>> > load_entry_point('ReviewBoard==1.5.2', 'console_scripts', 'rb- > >>> > site')() > >>> > File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-1.5.2- > >>> > py2.6.egg/reviewboard/cmdline/rbsite.py", line 1611, in main > >>> > command.run() > >>> > File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-1.5.2- > >>> > py2.6.egg/reviewboard/cmdline/rbsite.py", line 1512, in run > >>> > site.migrate_database() > >>> > File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-1.5.2- > >>> > py2.6.egg/reviewboard/cmdline/rbsite.py", line 346, in > >>> > migrate_database > >>> > self.run_manage_command("evolve", ["--noinput", "--execute"]) > >>> > File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-1.5.2- > >>> > py2.6.egg/reviewboard/cmdline/rbsite.py", line 397, in > >>> > run_manage_command > >>> > execute_manager(reviewboard.settings, [__file__, cmd] + params) > >>> > File "/usr/lib/pymodules/python2.6/django/core/management/ > >>> > __init__.py", line 438, in execute_manager > >>> > utility.execute() > >>> > File "/usr/lib/pymodules/python2.6/django/core/management/ > >>> > __init__.py", line 379, in execute > >>> > self.fetch_command(subcommand).run_from_argv(self.argv) > >>> > File "/usr/lib/pymodules/python2.6/django/core/management/base.py", > >>> > line 191, in run_from_argv > >>> > self.execute(*args, **options.__dict__) > >>> > File "/usr/lib/pymodules/python2.6/django/core/management/base.py", > >>> > line 220, in execute > >>> > output = self.handle(*args, **options) > >>> > File "/usr/local/lib/python2.6/dist-packages/django_evolution-0.6.2- > >>> > py2.6.egg/django_evolution/management/commands/evolve.py", line 60, in > >>> > handle > >>> > self.evolve(*app_labels, **options) > >>> > File "/usr/local/lib/python2.6/dist-packages/django_evolution-0.6.2- > >>> > py2.6.egg/django_evolution/management/commands/evolve.py", line 140, > >>> > in evolve > >>> > database)) > >>> > File "/usr/local/lib/python2.6/dist-packages/django_evolution-0.6.2- > >>> > py2.6.egg/django_evolution/mutations.py", line 599, in mutate > >>> > old_field_sig = model_sig['fields'][self.field_name] > >>> > KeyError: 'raw_file_url' > > >>> > -- > >>> > Want to help the Review Board project? Donate today > >>> > athttp://www.reviewboard.org/donate/ > >>> > Happy user? Let us know athttp://www.reviewboard.org/users/ > >>> > -~----------~----~----~----~------~----~------~--~--- > >>> > To unsubscribe from this group, send email to > >>> > reviewboard+unsubscr...@googlegroups.com > >>> > For more options, visit this group > >>> > athttp://groups.google.com/group/reviewboard?hl=en > > >> -- > >> Want to help the Review Board project? Donate today > >> athttp://www.reviewboard.org/donate/ > >> Happy user? Let us know athttp://www.reviewboard.org/users/ > >> -~----------~----~----~----~------~----~------~--~--- > >> To unsubscribe from this group, send email to > >> reviewboard+unsubscr...@googlegroups.com > >> For more options, visit this group > >> athttp://groups.google.com/group/reviewboard?hl=en -- Want to help the Review Board project? Donate today at http://www.reviewboard.org/donate/ Happy user? Let us know at http://www.reviewboard.org/users/ -~----------~----~----~----~------~----~------~--~--- To unsubscribe from this group, send email to reviewboard+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/reviewboard?hl=en