On Mon, 2012-04-23 at 11:25 -0700, Christian Hammond wrote:
> Hi Stephen,
> 
> Hmm, that's concerning. My upgrade simulations aren't reproducing that.
> 
> The same issue should be hit for any 1.6 release. 
> 
> Is this for the packages or FedoraHosted?

This is happening from the RPMs I created for EPEL 6. They are identical
to the 1.6.5 sources except for three custom patches (attached). They
are minimally-invasive.

I also have a slightly unorthodox settings_local.py file (also attached,
portions redacted). This is because my patch for including other
apps/middleware is only in the 1.7 branch.

> It almost sounds like the syncdb didn't set up the site app. We're
> there any warnings? Do you see those in the database?

I'm not sure where to look for warnings and or what I need from the
database. Please clarify.


Slightly more complete output (this was with django_evolution 0.6.5):

[sgallagh@hosted03 conf]$ sudo rb-site upgrade /srv/reviewboard
Rebuilding directory structure
/usr/lib/python2.6/site-packages/django/db/__init__.py:60:
DeprecationWarning: Short names for ENGINE in database configurations
are deprecated. Prepend default.ENGINE with 'django.db.backends.'
  DeprecationWarning
Upgrading from version 1.5.7
Updating database. This may take a while.
Creating tables ...
Creating table accounts_localsiteprofile
Creating table attachments_fileattachment
Creating table reviews_fileattachmentcomment
Upgrading Review Board from 1.5.7 to 1.6.5
There are unapplied evolutions for sessions.
There are unapplied evolutions for accounts.
There are unapplied evolutions for reviews.
There are unapplied evolutions for scmtools.
Loading FAS groups...
FAS groups loaded. Don't forget to set FAS_USERNAME and FAS_PASSWORD to
a low-privilege account.
Adding baseline version for new models
Project signature has changed - an evolution is required
Installing custom SQL ...
Installing indexes ...
No fixtures found.
Registering new SCM Tool Plastic SCM
(reviewboard.scmtools.plastic.PlasticTool) in database
Traceback (most recent call last):
  File "/usr/bin/rb-site", line 9, in <module>
    load_entry_point('ReviewBoard==1.6.5', 'console_scripts',
'rb-site')()
  File "/usr/lib/python2.6/site-packages/reviewboard/cmdline/rbsite.py",
line 1760, in main
    command.run()
  File "/usr/lib/python2.6/site-packages/reviewboard/cmdline/rbsite.py",
line 1650, in run
    site.migrate_database()
  File "/usr/lib/python2.6/site-packages/reviewboard/cmdline/rbsite.py",
line 353, in migrate_database
    self.run_manage_command("evolve", ["--noinput", "--execute"])
  File "/usr/lib/python2.6/site-packages/reviewboard/cmdline/rbsite.py",
line 469, in run_manage_command
    execute_manager(reviewboard.settings, [__file__, cmd] + params)
  File
"/usr/lib/python2.6/site-packages/django/core/management/__init__.py",
line 438, in execute_manager
    utility.execute()
  File
"/usr/lib/python2.6/site-packages/django/core/management/__init__.py",
line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File
"/usr/lib/python2.6/site-packages/django/core/management/base.py", line
191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File
"/usr/lib/python2.6/site-packages/django/core/management/base.py", line
220, in execute
    output = self.handle(*args, **options)
  File
"/usr/lib/python2.6/site-packages/django_evolution/management/commands/evolve.py",
 line 60, in handle
    self.evolve(*app_labels, **options)
  File
"/usr/lib/python2.6/site-packages/django_evolution/management/commands/evolve.py",
 line 140, in evolve
    database))
  File "/usr/lib/python2.6/site-packages/django_evolution/mutations.py",
line 418, in mutate
    return self.add_column(app_label, proj_sig, database)
  File "/usr/lib/python2.6/site-packages/django_evolution/mutations.py",
line 426, in add_column
    self.field_attrs, model)
  File "/usr/lib/python2.6/site-packages/django_evolution/mutations.py",
line 33, in create_field
    related_model_sig = proj_sig[related_app_name][related_model_name]
KeyError: 'site'

And again after updating to django_evolution 0.6.7 (to be sure):

[sgallagh@hosted03 conf]$ sudo rb-site upgrade /srv/reviewboard
Rebuilding directory structure
/usr/lib/python2.6/site-packages/django/db/__init__.py:60:
DeprecationWarning: Short names for ENGINE in database configurations
are deprecated. Prepend default.ENGINE with 'django.db.backends.'
  DeprecationWarning
Upgrading from version 1.6.5
Updating database. This may take a while.
Creating tables ...
There are unapplied evolutions for sessions.
There are unapplied evolutions for accounts.
There are unapplied evolutions for reviews.
There are unapplied evolutions for scmtools.
Loading FAS groups...
FAS groups loaded. Don't forget to set FAS_USERNAME and FAS_PASSWORD to
a low-privilege account.
Project signature has changed - an evolution is required
Installing custom SQL ...
Installing indexes ...
No fixtures found.
Traceback (most recent call last):
  File "/usr/bin/rb-site", line 9, in <module>
    load_entry_point('ReviewBoard==1.6.5', 'console_scripts',
'rb-site')()
  File "/usr/lib/python2.6/site-packages/reviewboard/cmdline/rbsite.py",
line 1760, in main
    command.run()
  File "/usr/lib/python2.6/site-packages/reviewboard/cmdline/rbsite.py",
line 1650, in run
    site.migrate_database()
  File "/usr/lib/python2.6/site-packages/reviewboard/cmdline/rbsite.py",
line 353, in migrate_database
    self.run_manage_command("evolve", ["--noinput", "--execute"])
  File "/usr/lib/python2.6/site-packages/reviewboard/cmdline/rbsite.py",
line 469, in run_manage_command
    execute_manager(reviewboard.settings, [__file__, cmd] + params)
  File
"/usr/lib/python2.6/site-packages/django/core/management/__init__.py",
line 438, in execute_manager
    utility.execute()
  File
"/usr/lib/python2.6/site-packages/django/core/management/__init__.py",
line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File
"/usr/lib/python2.6/site-packages/django/core/management/base.py", line
191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File
"/usr/lib/python2.6/site-packages/django/core/management/base.py", line
220, in execute
    output = self.handle(*args, **options)
  File
"/usr/lib/python2.6/site-packages/django_evolution/management/commands/evolve.py",
 line 60, in handle
    self.evolve(*app_labels, **options)
  File
"/usr/lib/python2.6/site-packages/django_evolution/management/commands/evolve.py",
 line 140, in evolve
    database))
  File "/usr/lib/python2.6/site-packages/django_evolution/mutations.py",
line 426, in mutate
    return self.add_column(app_label, proj_sig, database)
  File "/usr/lib/python2.6/site-packages/django_evolution/mutations.py",
line 434, in add_column
    self.field_attrs, model)
  File "/usr/lib/python2.6/site-packages/django_evolution/mutations.py",
line 33, in create_field
    related_model_sig = proj_sig[related_app_name][related_model_name]
KeyError: 'site'

-- 
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
>From 14c57d21085537be0d71e3b061cfdfed3a2054c5 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgall...@redhat.com>
Date: Tue, 22 Jun 2010 08:14:30 -0400
Subject: [PATCH 1/2] Disable ez_setup when installing by RPM

---
 setup.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/setup.py b/setup.py
index f0745c479e4e5bd84fe39a0f37233b95cac55e63..b53619303024cb2f02b670de112bc6c42d184aaf 100755
--- a/setup.py
+++ b/setup.py
@@ -8,8 +8,8 @@
 import os
 import sys
 
-from ez_setup import use_setuptools
-use_setuptools()
+#from ez_setup import use_setuptools
+#use_setuptools()
 
 from setuptools import setup, find_packages
 from distutils.command.install_data import install_data
-- 
1.7.4

>From 6d78366500e105fb435da2250a3fe165faff00c5 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgall...@redhat.com>
Date: Mon, 10 Jan 2011 11:18:47 -0500
Subject: [PATCH 2/2] Notify WSGI users that config changes are needed

When upgrading from 1.5.1 or older, we should inform users that
changes are required to their WSGI configuration to support the
API properly
---
 reviewboard/cmdline/rbsite.py |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/reviewboard/cmdline/rbsite.py b/reviewboard/cmdline/rbsite.py
index d07f7590695f8c20a6c7501f86fe449135e1ef17..345d6f7c72c30d2004a32426643ced199fd0de54 100755
--- a/reviewboard/cmdline/rbsite.py
+++ b/reviewboard/cmdline/rbsite.py
@@ -1575,6 +1575,7 @@ class UpgradeCommand(Command):
 
     def run(self):
         site.setup_settings()
+        os.environ["DJANGO_SETTINGS_MODULE"] = "reviewboard.settings"
 
         data_dir_exists = os.path.exists(os.path.join(site.install_dir, "data"))
 
@@ -1585,6 +1586,12 @@ class UpgradeCommand(Command):
             print "Upgrading site settings_local.py"
             site.upgrade_settings()
 
+        from djblets.siteconfig.models import SiteConfiguration
+        siteconfig = SiteConfiguration.objects.get_current()
+        print "Upgrading from version %s" % str(siteconfig.version)
+
+        version = [int(x) for x in siteconfig.version.split(' ')[0].split('.')]
+
         if options.upgrade_db:
             print "Updating database. This may take a while."
             site.sync_database()
@@ -1609,6 +1616,14 @@ class UpgradeCommand(Command):
             print "    SetEnv HOME %s" % os.path.join(site.abs_install_dir,
                                                       "data")
 
+        if version[0] < 1 or (version[0] == 1 and (version[1] < 5 or (version[1] == 5 and version[2] < 2))):
+            print "############################################################################################"
+            print "# Warning: your configuration may require an update                                        #"
+            print "# If you are running ReviewBoard on mod_wsgi, you need to update your Apache configuration #"
+            print "# as described at:                                                                         #"
+            print "# http://www.reviewboard.org/docs/releasenotes/dev/reviewboard/1.5.2/#important-updates    #"
+            print "############################################################################################"
+
 
 class ManageCommand(Command):
     """
-- 
1.7.4

>From 06ff349cab6d6597f7f38e9b5fbe7f6cc0b45457 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgall...@redhat.com>
Date: Fri, 17 Jun 2011 15:50:05 -0400
Subject: [PATCH 3/3] Change default cache file path

FHS requirement
---
 contrib/conf/settings_local.py.tmpl |    2 +-
 reviewboard/cmdline/rbsite.py       |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/conf/settings_local.py.tmpl b/contrib/conf/settings_local.py.tmpl
index a2773ffb9ba4ad0b44d1d0868e15db5a692ce1b4..3db98dc5d7d82065d36dc0c15f53058e383099f4 100644
--- a/contrib/conf/settings_local.py.tmpl
+++ b/contrib/conf/settings_local.py.tmpl
@@ -14,7 +14,7 @@ SECRET_KEY = '***********************************************'
 # In most Installations, memcached is the best option. Development
 # installations can get away with a file-based or local memory cache.
 #
-# CACHE_BACKEND = 'file:///tmp/reviewboard_cache?max_entries=5000'
+# CACHE_BACKEND = 'file:///var/cache/reviewboard/cache?max_entries=5000'
 # CACHE_BACKEND = 'memcached://localhost:11211//'
 CACHE_BACKEND = 'locmem:///'
 
diff --git a/reviewboard/cmdline/rbsite.py b/reviewboard/cmdline/rbsite.py
index 0d204a6ca1876746be78f5e35b39e37d8e906d2c..2fd1e7e8fec56cd62e2522f34fcbe28a59d04154 100755
--- a/reviewboard/cmdline/rbsite.py
+++ b/reviewboard/cmdline/rbsite.py
@@ -1386,7 +1386,7 @@ class InstallCommand(Command):
                        is_visible_func=lambda: site.cache_type == "file")
 
         ui.prompt_input(page, "Cache Directory",
-                        site.cache_info or "/tmp/reviewboard_cache",
+                        site.cache_info or "/var/cache/reviewboard/cache",
                         normalize_func=lambda value: "file://" + value,
                         save_obj=site, save_var="cache_info")
 
-- 
1.7.5.4

# Site-specific configuration settings for Review Board
# Definitions of these settings can be found at
# http://docs.djangoproject.com/en/dev/ref/settings/

# Database configuration
DATABASES = {
    'default': {
        'ENGINE': 'postgresql_psycopg2',
        'NAME': 'reviewboard',
        'USER': 'reviewboard',
        'PASSWORD': '<redacted>',
        'HOST': 'db01',
    },
}

# Unique secret key. Don't share this with anybody.
SECRET_KEY = '<redacted>'

# Cache backend settings.
CACHE_BACKEND = 'memcached://memcached04:11211'

# Extra site information.
SITE_ID = 1
SITE_ROOT = '/reviewboard/'
FORCE_SCRIPT_NAME = ''
DEBUG = False

# Fedora FAS2 Integration
FAS_USERNAME = 'fedoradummy'
FAS_PASSWORD = "<redacted>"
FAS_USERAGENT = 'ReviewBoard'
FAS_URL = 'https://admin.fedoraproject.org/accounts'
FAS_ADMINS = ( "mmcgrath", "sgallagh", "admiyo", "toshio" )

AUTHENTICATION_BACKENDS = (
    'fedora.django.auth.backends.FasBackend',
)

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.markup',
    'django.contrib.sites',
    'django.contrib.sessions',
    'djblets.datagrid',
    'djblets.feedview',
    'djblets.gravatars',
    'djblets.log',
    'djblets.siteconfig',
    'djblets.util',
    'djblets.webapi',
    'reviewboard.accounts',
    'reviewboard.admin',
    'reviewboard.attachments',
    'reviewboard.changedescs',
    'reviewboard.diffviewer',
    'reviewboard.notifications',
    'reviewboard.reports',
    'reviewboard.reviews',
    'reviewboard.scmtools',
    'reviewboard.webapi',
    'fedora.django.auth',
    'django_evolution', # Must be last
)

MIDDLEWARE_CLASSES = (
    'django.middleware.gzip.GZipMiddleware', # Keep this first.
    'django.middleware.common.CommonMiddleware',
    'django.middleware.doc.XViewMiddleware',
    'django.middleware.http.ConditionalGetMiddleware',
    'django.middleware.locale.LocaleMiddleware',

    'django.contrib.sessions.middleware.SessionMiddleware',
    'fedora.django.auth.middleware.FasMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',

    # These must go before anything that deals with settings.
    'djblets.siteconfig.middleware.SettingsMiddleware',
    'reviewboard.admin.middleware.LoadSettingsMiddleware',

    'djblets.log.middleware.LoggingMiddleware',
    'reviewboard.admin.middleware.CheckUpdatesRequiredMiddleware',
    'reviewboard.admin.middleware.X509AuthMiddleware',
    'reviewboard.site.middleware.LocalSiteMiddleware',
)

Reply via email to