2186: Upgrading site on 1.6 RC2 gives evolution errors

chris.a.********@gmai***** (Google Code) (Is this you? Claim this profile.)
chipx86
chipx86
Aug. 28, 2011
What version are you running?
1.6 RC 2

What's the URL of the page containing the problem?


What steps will reproduce the problem?
1. Upgrade ReviewBoard install from 1.6 RC 1 to 1.6 RC2
2. Upgrade existing site with reviews, repos, etc using "rb-site upgrade".
3. Receive the following errors:
Rebuilding directory structure
Updating database. This may take a while.
Creating tables ...
There are unapplied evolutions for diffviewer.
Project signature has changed - an evolution is required
Installing custom SQL ...
Installing indexes ...
No fixtures found.
The stored evolutions do not completely resolve all model changes.
Run `./manage.py evolve --hint` to see a suggestion for the changes required.

The following are the changes that could not be resolved:
In model reviews.ReviewRequest:
    Field 'inactive_file_attachments' has been added
    Field 'file_attachments' has been added
In model reviews.Review:
    Field 'file_attachment_comments' has been added
In model reviews.ReviewRequestDraft:
    Field 'inactive_file_attachments' has been added
    Field 'file_attachments' has been added
In model accounts.Profile:
    Field 'is_private' has been added
In model sessions.Session:
    In field 'expire_date':
        Property 'db_index' has changed
Error: Your models contain changes that Django Evolution cannot resolve automatically.

What is the expected output? What do you see instead?


What operating system are you using? What browser?


Please provide any additional information below.
chipx86
#1 chipx86
What version did you start with? Was 1.6 RC1 the first installed version in that database?

What database are you using?

Can you run the following and provide the output:

    rb-site manage /path/to/site evolve -- --hint
  • +NeedInfo
  • -Type-Defect
    +Type-Support
  • +chipx86
#2 chris.a.********@gmai***** (Google Code) (Is this you? Claim this profile.)
I've been using reviewBoard with this site for a number of versions, since at least 1.1 (possibly even 1.0?).

Using MySQL, Server version: 5.0.51a-3ubuntu5.4 (Ubuntu)

Output of rb-site manage evolve --hint:
#----- Evolution for sessions
from django_evolution.mutations import *
from django.db import models

MUTATIONS = [
    ChangeField('Session', 'expire_date', initial=None, db_index=True)
]
#----------------------
#----- Evolution for accounts
from django_evolution.mutations import *
from django.db import models

MUTATIONS = [
    AddField('Profile', 'is_private', models.BooleanField, initial=False)
]
#----------------------
#----- Evolution for reviews
from django_evolution.mutations import *
from django.db import models

MUTATIONS = [
    AddField('ReviewRequest', 'inactive_file_attachments', models.ManyToManyField, related_model='attachments.FileAttachment'),
    AddField('ReviewRequest', 'file_attachments', models.ManyToManyField, related_model='attachments.FileAttachment'),
    AddField('Review', 'file_attachment_comments', models.ManyToManyField, related_model='reviews.FileAttachmentComment'),
    AddField('ReviewRequestDraft', 'inactive_file_attachments', models.ManyToManyField, related_model='attachments.FileAttachment'),
    AddField('ReviewRequestDraft', 'file_attachments', models.ManyToManyField, related_model='attachments.FileAttachment')
]
#----------------------
Trial evolution successful.
Run './manage.py evolve --hint --execute' to apply evolution.
chipx86
#3 chipx86
Okay, can you also provide the following:

1) A dump of the database schema (use mysqldump -d)
2) A screenshot of your Django Evolution Versions and Evolutions entry listings in the admin UI -> Database.
3) Verify you're running the newest Django by doing the following from the console:

    $ python
    >>> import django
    >>> print django.VERSION

And showing what that says.
chipx86
#4 chipx86
Since other people are hitting this, it's possible there's a root cause somewhere we haven't identified.

Can you also provide the Python version?
  • -Type-Support
    +Type-Defect
    +Milestone-Release1.6
chipx86
#5 chipx86
I have spent a considerable amount of time on this and can't find anything on our end that could cause it. I have a new script that can simulate all kinds of database upgrades, with various combinations of versions and database types and it never hit this. So I'm a bit stuck.

Having the latest requested info would help a lot.
#6 chris.a.********@gmai***** (Google Code) (Is this you? Claim this profile.)
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) 
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> print django.VERSION
(1, 3, 0, 'final', 0)

The screenshots and schema are attached.
  • +
    +
    +
    -- MySQL dump 10.11
    --
    -- Host: localhost    Database: reviewboard
    -- ------------------------------------------------------
    -- Server version	5.0.51a-3ubuntu5.4
    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8 */;
    /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
    /*!40103 SET TIME_ZONE='+00:00' */;
    /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
    /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
    --
    -- Table structure for table `accounts_localsiteprofile`
    --
    DROP TABLE IF EXISTS `accounts_localsiteprofile`;
    SET @saved_cs_client     = @@character_set_client;
    SET character_set_client = utf8;
    CREATE TABLE `accounts_localsiteprofile` (
     
chipx86
#7 chipx86
Two more bits of info:

1) Can you dump the contents of the django_project_version and django_evolution tables?

2) To the best of your ability, can you tell me exactly what versions you've used with this database over the course of its existence? Mostly interested in 1.5/1.6 timelines, but any info helps for me to simulate this.
chipx86
#8 chipx86
Ping?
#9 chris.a.********@gmai***** (Google Code) (Is this you? Claim this profile.)
Attached are the dumps of those tables.

It's a best guess, but I've probably used every version of 1.5 since beta 2, and have used 1.6 RC2 on this install.
  • +
    -- MySQL dump 10.11
    --
    -- Host: localhost    Database: reviewboard
    -- ------------------------------------------------------
    -- Server version	5.0.51a-3ubuntu5.4
    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8 */;
    /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
    /*!40103 SET TIME_ZONE='+00:00' */;
    /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
    /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
    --
    -- Table structure for table `django_project_version`
    --
    DROP TABLE IF EXISTS `django_project_version`;
    SET @saved_cs_client     = @@character_set_client;
    SET character_set_client = utf8;
    CREATE TABLE `django_project_version` (
      `id` int
    +
    -- MySQL dump 10.11
    --
    -- Host: localhost    Database: reviewboard
    -- ------------------------------------------------------
    -- Server version	5.0.51a-3ubuntu5.4
    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8 */;
    /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
    /*!40103 SET TIME_ZONE='+00:00' */;
    /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
    /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
    --
    -- Table structure for table `django_evolution`
    --
    DROP TABLE IF EXISTS `django_evolution`;
    SET @saved_cs_client     = @@character_set_client;
    SET character_set_client = utf8;
    CREATE TABLE `django_evolution` (
      `id` int(11) NOT NULL auto
chipx86
#10 chipx86
Thanks.

I suspect if you upgrade to the latest Django-Evolution and the latest RB 1.6 nightly, the problem will go away. Would you mind trying that?
#11 chris.a.********@gmai***** (Google Code) (Is this you? Claim this profile.)
Attached are the dumps of those tables.

It's a best guess, but I've probably used every version of 1.5 since beta 2, and have used 1.6 RC2 on this install.
  • +
    -- MySQL dump 10.11
    --
    -- Host: localhost    Database: reviewboard
    -- ------------------------------------------------------
    -- Server version	5.0.51a-3ubuntu5.4
    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8 */;
    /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
    /*!40103 SET TIME_ZONE='+00:00' */;
    /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
    /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
    --
    -- Table structure for table `django_project_version`
    --
    DROP TABLE IF EXISTS `django_project_version`;
    SET @saved_cs_client     = @@character_set_client;
    SET character_set_client = utf8;
    CREATE TABLE `django_project_version` (
      `id` int
    +
    -- MySQL dump 10.11
    --
    -- Host: localhost    Database: reviewboard
    -- ------------------------------------------------------
    -- Server version	5.0.51a-3ubuntu5.4
    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8 */;
    /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
    /*!40103 SET TIME_ZONE='+00:00' */;
    /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
    /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
    --
    -- Table structure for table `django_evolution`
    --
    DROP TABLE IF EXISTS `django_evolution`;
    SET @saved_cs_client     = @@character_set_client;
    SET character_set_client = utf8;
    CREATE TABLE `django_evolution` (
      `id` int(11) NOT NULL auto
chipx86
#12 chipx86
I believe this is now fixed. If you get a new version of Django Evolution and a Review Board nightly, it will hopefully fix itself, but if not, at least it'll prevent it from happening again... Mind trying?
chipx86
#13 chipx86
Assuming this is fixed.
  • -NeedInfo
    +Fixed