Re: Reviewboard upgrade failure

2016-01-15 Thread Ben Cooksley
On Fri, Jan 15, 2016 at 11:04 PM, Christian Hammond
 wrote:
> Hi Ben,
>
> This is due to a mismatch between MySQL table types. The existing tables are
> likely MyISAM, with MySQL now defaulting to InnoDB for new ones. You'll need
> to either migrate all the existing tables, or tell MySQL to use the existing
> type for new tables.
>
> (It's a pretty terrible error, but unfortunately, beyond our control. I just
> recognize this sort of problem.)

Argh. Our systems usually have InnoDB as default, guess that isn't the
case when we originally had Reviewboard provisioned.
I shouldn't see any issues migrating all tables into InnoDB correct?

>
> Christian

Cheers,
Ben

>
> --
> Christian Hammond - christ...@beanbaginc.com
> Review Board - https://www.reviewboard.org
> Beanbag, Inc. - https://www.beanbaginc.com
>
> On Thu, Jan 14, 2016 at 11:27 PM, Ben Cooksley  wrote:
>>
>> Hi everyone,
>>
>> While upgrading from Reviewboard 2.0.17 to 2.5.2 i've encountered a
>> few SQL errors.
>> Reviewboard itself appears to boot and run fine though, based on the
>> nature of the errors I suspect it's a case of index name collisions.
>>
>> Output from the upgrade process is below:
>>
>> (virtualenv)reviewboard@mimi:~$ rb-site upgrade
>> /srv/www/reviewboard/git.reviewboard.kde.org/
>> Rebuilding directory structure
>> Updating database. This may take a while.
>>
>> The log output below, including warnings and errors,
>> can be ignored unless upgrade fails.
>>
>> --  --
>> Creating tables ...
>> Creating table accounts_trophy
>>
>> [!] There was an error synchronizing the database. Make sure the
>> database is created and has the appropriate permissions, and then
>> continue.
>> [!] Details: (1005, "Can't create table 'reviewboard_git.#sql-
>> 331d_214215' (errno: 150)")
>>
>> Press Enter to continue
>> Creating tables ...
>> Creating table attachments_fileattachmenthistory
>> Creating table diffviewer_rawfilediffdata
>> Creating table notifications_webhooktarget_repositories
>>
>> [!] There was an error synchronizing the database. Make sure the
>> database is created and has the appropriate permissions, and then
>> continue.
>> [!] Details: (1005, "Can't create table 'reviewboard_git.#sql-
>> 331d_214215' (errno: 150)")
>>
>> Press Enter to continue
>> Creating tables ...
>> Creating table notifications_webhooktarget
>>
>> [!] There was an error synchronizing the database. Make sure the
>> database is created and has the appropriate permissions, and then
>> continue.
>> [!] Details: (1005, "Can't create table 'reviewboard_git.#sql-
>> 331d_214215' (errno: 150)")
>>
>> Press Enter to continue
>> Creating tables ...
>> Creating table webapi_webapitoken
>>
>> [!] There was an error synchronizing the database. Make sure the
>> database is created and has the appropriate permissions, and then
>> continue.
>> [!] Details: (1005, "Can't create table 'reviewboard_git.#sql-
>> 331d_214215' (errno: 150)")
>>
>> Press Enter to continue
>> Creating tables ...
>> Upgrading Review Board from 2.0.17 to 2.5.2
>> There are unapplied evolutions for accounts.
>> There are unapplied evolutions for attachments.
>> There are unapplied evolutions for diffviewer.
>> There are unapplied evolutions for notifications.
>> There are unapplied evolutions for reviews.
>> There are unapplied evolutions for webapi.
>> Adding baseline version for new models
>> Evolutions in notifications baseline: webhooktarget_extra_state,
>> webhooktarget_extra_data_null
>> Project signature has changed - an evolution is required
>> Installing custom SQL ...
>> Installing indexes ...
>> Installed 0 object(s) from 0 fixture(s)
>> CommandError: Error applying evolution: (1005, "Can't create table
>> 'reviewboard_git.#sql-331d_214238' (errno: 150)")
>>
>> Any pointers?
>>
>> Cheers,
>> Ben Cooksley
>> KDE Sysadmin
>>
>> --
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "reviewboard-dev" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to reviewboard-dev+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "reviewboard-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to reviewboard-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
Supercharge your Review Board with Power Pack: 
https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: 
https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 

Re: rb-site upgrade error: Your models contain changes that Django Evolution cannot resolve automatically

2016-01-15 Thread Christian Hammond
Hi Jasper,

This definitely looks to be due to custom model changes made by someone
there. You'll need to do some special stuff to disentangle these. You
definitely don't want to use --hint --execute is a recipe for disaster (got
a backup?).

What you're going to have to do is take those old model changes from your
custom version of Review Board and port them back to the new version. Then
try to do an upgrade. If that works properly, you can then remove those
fields again, and *then* run --hint --execute, to get the database
evolution history into a sane state.

Of course, if you have stuff in those columns that you need still, they
will be lost. We have an extra_data field on all these objects, which is
where custom state should be stored, so you may want to figure out whether
you want to migrate that and update whatever it is that was using these
fields.

Christian

-- 
Christian Hammond - christ...@beanbaginc.com
Review Board - https://www.reviewboard.org
Beanbag, Inc. - https://www.beanbaginc.com

On Wed, Jan 13, 2016 at 1:47 PM, Jasper Chow  wrote:

> Update:
>
> tried rb-site manage /path/to/site evolve -- --hint --execute
> but ends with Duplicate column error (password , or permission)
>
>
> hmm. further research it may not be due to our customization , but another
> case that the database somehow is in a bad state.
> I recall reading from some posts then manual manipulation of database
> schema is not recommended.
>
>
>
>
> On Wednesday, January 13, 2016 at 1:06:43 PM UTC-5, Jasper Chow wrote:
>>
>>
>> Attach evolve log (  rb-site manage /var/www/reviewboard evolve -- --hint
>> )  for diagnosis
>>
>> thanks
>>
>>
>> On Tuesday, January 12, 2016 at 12:58:01 PM UTC-5, Jasper Chow wrote:
>>>
>>> Hello
>>>
>>> I am having issue similar to previous reported, while running rb-site
>>> upgrade
>>>
>>> https://hellosplat.com/s/beanbag/tickets/3967/
>>> https://www.mail-archive.com/reviewboard@googlegroups.com/msg15947.html
>>>
>>>
>>> information:
>>> on Linux (CentOS) reviewboard 1.7 -> 2.0.16 ( intended to upgrade to
>>> latest but ran into some problem, thought I would do it with a smaller
>>> increment )
>>>
>>>
>>> easy_install ReviewBoard==2.0.16   (successful)
>>> rb-site upgrade [path]  fails with following error:
>>>
>>>
>>>
>>> In model reviews.ReviewRequest:
>>> Field 'related_review_number' has been deleted
>>> In model reviews.Review
>>> Field 'notify_only_submitter' has been deleted
>>> In model reviews.ReviewRequestDraft
>>> Field 'related_review_number' has been deleted
>>> In model accounts.Profile
>>> Field 'eclipse_diff_view' has been deleted
>>>
>>>
>>> Judging by the name of the columns it seems some customization done by
>>> previous admin here. So question is
>>> What is the best practice to  migrate these extension columns?
>>>
>>>
>>> I tried
>>> - drop the columns from the database ( and to restore them later ) , and
>>> run upgrade again
>>> - or used the trick provided in another post
>>>
>>> >>> from django_evolution.models import Version
>>> >>> v = Version.objects.all()[0]
>>> >>> print v
>>> Hinted version, updated on 2015-02-12 02:23:19+00:00
>>> >>> v.delete()
>>> >>>
>>>
>>>  but it doesn't seems to help either
>>>
>>> Or maybe it should be other way around that  I need to modify the schema
>>> somewhere before i run the upgrade script?
>>>
>>> any help / suggestion is appreciated.. thank you
>>>
>>>
>>> --
> Supercharge your Review Board with Power Pack:
> https://www.reviewboard.org/powerpack/
> Want us to host Review Board for you? Check out RBCommons:
> https://rbcommons.com/
> Happy user? Let us know! https://www.reviewboard.org/users/
> ---
> You received this message because you are subscribed to the Google Groups
> "reviewboard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to reviewboard+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Supercharge your Review Board with Power Pack: 
https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: 
https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Getting "The file ...... could not be found in the repository" with mercurial repository confugured with ssh

2016-01-15 Thread Ashutosh Naik
I am using Review Board 2.0.7 with mercurial repository configured with 
ssh. I created a new review request and uploaded the diff and parent diff 
for a committed changeset. But I get the following error:

There was an error displaying this diff.

The file 'kvstore/src/oracle/kv/util/PingCollector.java' (r5c2b44f746e4) 
could not be found in the repository

This may be a bug in the software, a temporary outage, or an issue with the 
format of your diff.

Please try again, and if you still have trouble,contact support.

Clicking on "Details" gives the following:

Traceback (most recent call last):
  File 
"/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/diffviewer/views.py",
 
line 265, in get
response = renderer.render_to_response(request)
  File 
"/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/diffviewer/renderers.py",
 
line 56, in render_to_response
return HttpResponse(self.render_to_string(request))
  File 
"/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/diffviewer/renderers.py",
 
line 74, in render_to_string
large_data=True)
  File 
"/usr/lib/python2.6/site-packages/Djblets-0.8.20-py2.6.egg/djblets/cache/backend.py",
 
line 111, in cache_memoize
data = lookup_callable()
  File 
"/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/diffviewer/renderers.py",
 
line 73, in 
lambda: self.render_to_string_uncached(request),
  File 
"/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/diffviewer/renderers.py",
 
line 87, in render_to_string_uncached
request=request)
  File 
"/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/diffviewer/diffutils.py",
 
line 420, in populate_diff_chunks
chunks = generator.get_chunks()
  File 
"/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/diffviewer/chunk_generator.py",
 
line 156, in get_chunks
large_data=True)
  File 
"/usr/lib/python2.6/site-packages/Djblets-0.8.20-py2.6.egg/djblets/cache/backend.py",
 
line 111, in cache_memoize
data = lookup_callable()
  File 
"/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/diffviewer/chunk_generator.py",
 
line 155, in 
lambda: list(self._get_chunks_uncached()),
  File 
"/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/diffviewer/chunk_generator.py",
 
line 162, in _get_chunks_uncached
old = get_original_file(self.filediff, self.request, encoding_list)
  File 
"/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/diffviewer/diffutils.py",
 
line 198, in get_original_file
request=request)
  File 
"/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/scmtools/models.py",
 
line 344, in get_file
large_data=True)[0]
  File 
"/usr/lib/python2.6/site-packages/Djblets-0.8.20-py2.6.egg/djblets/cache/backend.py",
 
line 111, in cache_memoize
data = lookup_callable()
  File 
"/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/scmtools/models.py",
 
line 343, in 
request)],
  File 
"/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/scmtools/models.py",
 
line 531, in _get_file_uncached
base_commit_id=base_commit_id)
  File 
"/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/scmtools/hg.py",
 
line 48, in get_file
base_commit_id=base_commit_id)
  File 
"/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/scmtools/hg.py",
 
line 266, in cat_file
raise FileNotFoundError(path, rev)
FileNotFoundError: The file 'kvstore/src/oracle/kv/util/PingCollector.java' 
(r5c2b44f746e4) could not be found in the repository



-- 
Supercharge your Review Board with Power Pack: 
https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: 
https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Reviewboard upgrade failure

2016-01-15 Thread Christian Hammond
Hi Ben,

You'll have a much easier time restoring from a backup. It's hard to say
how far it went through the evolution process, and unfortunately today it
doesn't keep track of how far it got and what it'd have to do to recover.
You'd have a lot of trial and error to fix it manually. You can try it,
though.

Basically, you'll need to dump the SQL that the evolutions want to apply,
and go through and hand-undo each thing it did until you get back to the
point of where it was. You'd definitely want to do a backup first, though.

Christian

-- 
Christian Hammond - chip...@chipx86.com
Review Board - https://www.reviewboard.org
Beanbag, Inc. - https://www.beanbaginc.com

On Fri, Jan 15, 2016 at 2:26 AM, Ben Cooksley  wrote:

> On Fri, Jan 15, 2016 at 11:09 PM, Ben Cooksley  wrote:
> > On Fri, Jan 15, 2016 at 11:04 PM, Christian Hammond
> >  wrote:
> >> Hi Ben,
> >>
> >> This is due to a mismatch between MySQL table types. The existing
> tables are
> >> likely MyISAM, with MySQL now defaulting to InnoDB for new ones. You'll
> need
> >> to either migrate all the existing tables, or tell MySQL to use the
> existing
> >> type for new tables.
> >>
> >> (It's a pretty terrible error, but unfortunately, beyond our control. I
> just
> >> recognize this sort of problem.)
> >
> > Argh. Our systems usually have InnoDB as default, guess that isn't the
> > case when we originally had Reviewboard provisioned.
> > I shouldn't see any issues migrating all tables into InnoDB correct?
>
> Seems it is safe.
> Unfortunately it looks like one of the evolutions got part way through
> the process.
>
> CommandError: Error applying evolution: (1060, "Duplicate column name
> 'visibility'")
>
> Any suggestions (I could restore from backups, but if I can avoid it...)?
>
> >
> >>
> >> Christian
> >
> > Cheers,
> > Ben
>
> Thanks,
> Ben
>
> >
> >>
> >> --
> >> Christian Hammond - christ...@beanbaginc.com
> >> Review Board - https://www.reviewboard.org
> >> Beanbag, Inc. - https://www.beanbaginc.com
> >>
> >> On Thu, Jan 14, 2016 at 11:27 PM, Ben Cooksley 
> wrote:
> >>>
> >>> Hi everyone,
> >>>
> >>> While upgrading from Reviewboard 2.0.17 to 2.5.2 i've encountered a
> >>> few SQL errors.
> >>> Reviewboard itself appears to boot and run fine though, based on the
> >>> nature of the errors I suspect it's a case of index name collisions.
> >>>
> >>> Output from the upgrade process is below:
> >>>
> >>> (virtualenv)reviewboard@mimi:~$ rb-site upgrade
> >>> /srv/www/reviewboard/git.reviewboard.kde.org/
> >>> Rebuilding directory structure
> >>> Updating database. This may take a while.
> >>>
> >>> The log output below, including warnings and errors,
> >>> can be ignored unless upgrade fails.
> >>>
> >>> --  --
> >>> Creating tables ...
> >>> Creating table accounts_trophy
> >>>
> >>> [!] There was an error synchronizing the database. Make sure the
> >>> database is created and has the appropriate permissions, and then
> >>> continue.
> >>> [!] Details: (1005, "Can't create table 'reviewboard_git.#sql-
> >>> 331d_214215' (errno: 150)")
> >>>
> >>> Press Enter to continue
> >>> Creating tables ...
> >>> Creating table attachments_fileattachmenthistory
> >>> Creating table diffviewer_rawfilediffdata
> >>> Creating table notifications_webhooktarget_repositories
> >>>
> >>> [!] There was an error synchronizing the database. Make sure the
> >>> database is created and has the appropriate permissions, and then
> >>> continue.
> >>> [!] Details: (1005, "Can't create table 'reviewboard_git.#sql-
> >>> 331d_214215' (errno: 150)")
> >>>
> >>> Press Enter to continue
> >>> Creating tables ...
> >>> Creating table notifications_webhooktarget
> >>>
> >>> [!] There was an error synchronizing the database. Make sure the
> >>> database is created and has the appropriate permissions, and then
> >>> continue.
> >>> [!] Details: (1005, "Can't create table 'reviewboard_git.#sql-
> >>> 331d_214215' (errno: 150)")
> >>>
> >>> Press Enter to continue
> >>> Creating tables ...
> >>> Creating table webapi_webapitoken
> >>>
> >>> [!] There was an error synchronizing the database. Make sure the
> >>> database is created and has the appropriate permissions, and then
> >>> continue.
> >>> [!] Details: (1005, "Can't create table 'reviewboard_git.#sql-
> >>> 331d_214215' (errno: 150)")
> >>>
> >>> Press Enter to continue
> >>> Creating tables ...
> >>> Upgrading Review Board from 2.0.17 to 2.5.2
> >>> There are unapplied evolutions for accounts.
> >>> There are unapplied evolutions for attachments.
> >>> There are unapplied evolutions for diffviewer.
> >>> There are unapplied evolutions for notifications.
> >>> There are unapplied evolutions for reviews.
> >>> There are unapplied evolutions for webapi.
> >>> Adding baseline version for new models
> >>> Evolutions in notifications baseline: 

Re: Getting "The file ...... could not be found in the repository" with mercurial repository confugured with ssh

2016-01-15 Thread David Trowbridge
2.0.7 is pretty old at this point. Is it possible to see if this still
fails with the latest 2.0.x release?

-David

On Fri, Jan 15, 2016 at 8:04 AM Ashutosh Naik 
wrote:

> I am using Review Board 2.0.7 with mercurial repository configured with
> ssh. I created a new review request and uploaded the diff and parent diff
> for a committed changeset. But I get the following error:
>
> There was an error displaying this diff.
>
> The file 'kvstore/src/oracle/kv/util/PingCollector.java' (r5c2b44f746e4)
> could not be found in the repository
>
> This may be a bug in the software, a temporary outage, or an issue with
> the format of your diff.
>
> Please try again, and if you still have trouble,contact support.
>
> Clicking on "Details" gives the following:
>
> Traceback (most recent call last):
>   File
> "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/diffviewer/views.py",
> line 265, in get
> response = renderer.render_to_response(request)
>   File
> "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/diffviewer/renderers.py",
> line 56, in render_to_response
> return HttpResponse(self.render_to_string(request))
>   File
> "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/diffviewer/renderers.py",
> line 74, in render_to_string
> large_data=True)
>   File
> "/usr/lib/python2.6/site-packages/Djblets-0.8.20-py2.6.egg/djblets/cache/backend.py",
> line 111, in cache_memoize
> data = lookup_callable()
>   File
> "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/diffviewer/renderers.py",
> line 73, in 
> lambda: self.render_to_string_uncached(request),
>   File
> "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/diffviewer/renderers.py",
> line 87, in render_to_string_uncached
> request=request)
>   File
> "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/diffviewer/diffutils.py",
> line 420, in populate_diff_chunks
> chunks = generator.get_chunks()
>   File
> "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/diffviewer/chunk_generator.py",
> line 156, in get_chunks
> large_data=True)
>   File
> "/usr/lib/python2.6/site-packages/Djblets-0.8.20-py2.6.egg/djblets/cache/backend.py",
> line 111, in cache_memoize
> data = lookup_callable()
>   File
> "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/diffviewer/chunk_generator.py",
> line 155, in 
> lambda: list(self._get_chunks_uncached()),
>   File
> "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/diffviewer/chunk_generator.py",
> line 162, in _get_chunks_uncached
> old = get_original_file(self.filediff, self.request, encoding_list)
>   File
> "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/diffviewer/diffutils.py",
> line 198, in get_original_file
> request=request)
>   File
> "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/scmtools/models.py",
> line 344, in get_file
> large_data=True)[0]
>   File
> "/usr/lib/python2.6/site-packages/Djblets-0.8.20-py2.6.egg/djblets/cache/backend.py",
> line 111, in cache_memoize
> data = lookup_callable()
>   File
> "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/scmtools/models.py",
> line 343, in 
> request)],
>   File
> "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/scmtools/models.py",
> line 531, in _get_file_uncached
> base_commit_id=base_commit_id)
>   File
> "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/scmtools/hg.py",
> line 48, in get_file
> base_commit_id=base_commit_id)
>   File
> "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.17-py2.6.egg/reviewboard/scmtools/hg.py",
> line 266, in cat_file
> raise FileNotFoundError(path, rev)
> FileNotFoundError: The file
> 'kvstore/src/oracle/kv/util/PingCollector.java' (r5c2b44f746e4) could not
> be found in the repository
>
>
>
> --
> Supercharge your Review Board with Power Pack:
> https://www.reviewboard.org/powerpack/
> Want us to host Review Board for you? Check out RBCommons:
> https://rbcommons.com/
> Happy user? Let us know! https://www.reviewboard.org/users/
> ---
> You received this message because you are subscribed to the Google Groups
> "reviewboard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to reviewboard+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
-- 
-David

-- 
Supercharge your Review Board with Power Pack: 
https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: 
https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To unsubscribe from this 

Re: Reviewboard upgrade failure

2016-01-15 Thread Ben Cooksley
On Sat, Jan 16, 2016 at 6:09 AM, Christian Hammond  wrote:
> Hi Ben,
>
> You'll have a much easier time restoring from a backup. It's hard to say how
> far it went through the evolution process, and unfortunately today it
> doesn't keep track of how far it got and what it'd have to do to recover.
> You'd have a lot of trial and error to fix it manually. You can try it,
> though.
>
> Basically, you'll need to dump the SQL that the evolutions want to apply,
> and go through and hand-undo each thing it did until you get back to the
> point of where it was. You'd definitely want to do a backup first, though.

Unfortunately people had started using it already so this was the
easiest approach :(

Would it be possible to get a copy of a normally, safely upgraded
schema so I can double check I haven't clobbered anything?

The queries I ended up having to run to revert things to a state where
the upgrade process would work was:

160115 19:34:12 2197763 Query   ALTER TABLE
accounts_reviewrequestvisit DROP COLUMN visibility
160115 19:34:24 2197763 Query   DROP INDEX
`accounts_reviewrequestvisit_05ee5d21` ON
`accounts_reviewrequestvisit`
160115 19:34:45 2197763 Query   ALTER TABLE attachments_fileattachment
DROP COLUMN attachment_revision, DROP COLUMN attachment_history_id
160115 19:34:58 2197763 Query   ALTER TABLE diffviewer_filediff DROP
COLUMN raw_diff_hash_id, DROP COLUMN raw_parent_diff_hash_id
160115 19:36:18 2197763 Query   ALTER TABLE `reviews_group` DROP
COLUMN `email_list_only`, DROP COLUMN is_default_group
160115 19:36:25 2197763 Query   DROP TABLE
reviews_reviewrequest_file_attachment_histories

Note that I observed that the Reviewboard process tries to reverse
it's failed upgrade by doing a rollback. It is noted in the case of
InnoDB that schema changes cannot be rolled back (see
http://www.sitepoint.com/mysql-transaction-gotchas-good-parts/)

>
> Christian

Cheers,
Ben

>
> --
> Christian Hammond - chip...@chipx86.com
> Review Board - https://www.reviewboard.org
> Beanbag, Inc. - https://www.beanbaginc.com
>
> On Fri, Jan 15, 2016 at 2:26 AM, Ben Cooksley  wrote:
>>
>> On Fri, Jan 15, 2016 at 11:09 PM, Ben Cooksley  wrote:
>> > On Fri, Jan 15, 2016 at 11:04 PM, Christian Hammond
>> >  wrote:
>> >> Hi Ben,
>> >>
>> >> This is due to a mismatch between MySQL table types. The existing
>> >> tables are
>> >> likely MyISAM, with MySQL now defaulting to InnoDB for new ones. You'll
>> >> need
>> >> to either migrate all the existing tables, or tell MySQL to use the
>> >> existing
>> >> type for new tables.
>> >>
>> >> (It's a pretty terrible error, but unfortunately, beyond our control. I
>> >> just
>> >> recognize this sort of problem.)
>> >
>> > Argh. Our systems usually have InnoDB as default, guess that isn't the
>> > case when we originally had Reviewboard provisioned.
>> > I shouldn't see any issues migrating all tables into InnoDB correct?
>>
>> Seems it is safe.
>> Unfortunately it looks like one of the evolutions got part way through
>> the process.
>>
>> CommandError: Error applying evolution: (1060, "Duplicate column name
>> 'visibility'")
>>
>> Any suggestions (I could restore from backups, but if I can avoid it...)?
>>
>> >
>> >>
>> >> Christian
>> >
>> > Cheers,
>> > Ben
>>
>> Thanks,
>> Ben
>>
>> >
>> >>
>> >> --
>> >> Christian Hammond - christ...@beanbaginc.com
>> >> Review Board - https://www.reviewboard.org
>> >> Beanbag, Inc. - https://www.beanbaginc.com
>> >>
>> >> On Thu, Jan 14, 2016 at 11:27 PM, Ben Cooksley 
>> >> wrote:
>> >>>
>> >>> Hi everyone,
>> >>>
>> >>> While upgrading from Reviewboard 2.0.17 to 2.5.2 i've encountered a
>> >>> few SQL errors.
>> >>> Reviewboard itself appears to boot and run fine though, based on the
>> >>> nature of the errors I suspect it's a case of index name collisions.
>> >>>
>> >>> Output from the upgrade process is below:
>> >>>
>> >>> (virtualenv)reviewboard@mimi:~$ rb-site upgrade
>> >>> /srv/www/reviewboard/git.reviewboard.kde.org/
>> >>> Rebuilding directory structure
>> >>> Updating database. This may take a while.
>> >>>
>> >>> The log output below, including warnings and errors,
>> >>> can be ignored unless upgrade fails.
>> >>>
>> >>> --  --
>> >>> Creating tables ...
>> >>> Creating table accounts_trophy
>> >>>
>> >>> [!] There was an error synchronizing the database. Make sure the
>> >>> database is created and has the appropriate permissions, and then
>> >>> continue.
>> >>> [!] Details: (1005, "Can't create table 'reviewboard_git.#sql-
>> >>> 331d_214215' (errno: 150)")
>> >>>
>> >>> Press Enter to continue
>> >>> Creating tables ...
>> >>> Creating table attachments_fileattachmenthistory
>> >>> Creating table diffviewer_rawfilediffdata
>> >>> Creating table notifications_webhooktarget_repositories
>> >>>
>> >>> [!] There was an error synchronizing the database. Make sure the
>> >>> database 

Re: rb-site upgrade error: Your models contain changes that Django Evolution cannot resolve automatically

2016-01-15 Thread Jasper Chow
Thanks for the feedback Christian 

I actually managed to get further by even smaller increments. 1.7.1 -> 
1.7.2 ->1.7.28 and finally 2.0   
The process is slow and i have to resolve things like Djblet needs to be 
updated, importlib missing etc

so it seems to be working so far - why is --execute a last resort? what 
does it really do?
Unfortunately I have to do  a --hint --execute EVERYTIME before a rb-site 
upgrade.   as rb-site upgrade gives out different conflicts every time - i 
thought as long as i can upgrade once, then subsequent should be good. - ( 
since i am installing using egg from 
http://downloads.reviewboard.org/releases/ReviewBoard/ )  

I looked into our cloned repository and i don't think there is any model 
change, It seems all the changes were cosmetic. Is there a documentation / 
certain step that i can perform to check the discrepancy systematically.?  





On Friday, January 15, 2016 at 5:12:04 AM UTC-5, Christian Hammond wrote
>
> Hi Jasper,
>
> This definitely looks to be due to custom model changes made by someone 
> there. You'll need to do some special stuff to disentangle these. You 
> definitely don't want to use --hint --execute is a recipe for disaster (got 
> a backup?).
>
> What you're going to have to do is take those old model changes from your 
> custom version of Review Board and port them back to the new version. Then 
> try to do an upgrade. If that works properly, you can then remove those 
> fields again, and *then* run --hint --execute, to get the database 
> evolution history into a sane state.
>
> Of course, if you have stuff in those columns that you need still, they 
> will be lost. We have an extra_data field on all these objects, which is 
> where custom state should be stored, so you may want to figure out whether 
> you want to migrate that and update whatever it is that was using these 
> fields.
>
> Christian
>
> -- 
> Christian Hammond - chri...@beanbaginc.com 
> Review Board - https://www.reviewboard.org
> Beanbag, Inc. - https://www.beanbaginc.com
>
> On Wed, Jan 13, 2016 at 1:47 PM, Jasper Chow  > wrote:
>
>> Update:
>>
>> tried rb-site manage /path/to/site evolve -- --hint --execute
>> but ends with Duplicate column error (password , or permission)
>>
>>
>> hmm. further research it may not be due to our customization , but 
>> another case that the database somehow is in a bad state.  
>> I recall reading from some posts then manual manipulation of database 
>> schema is not recommended. 
>>
>>
>>
>>
>> On Wednesday, January 13, 2016 at 1:06:43 PM UTC-5, Jasper Chow wrote:
>>>
>>>
>>> Attach evolve log (  rb-site manage /var/www/reviewboard evolve -- 
>>> --hint )  for diagnosis
>>>
>>> thanks
>>>
>>>
>>> On Tuesday, January 12, 2016 at 12:58:01 PM UTC-5, Jasper Chow wrote:

 Hello 

 I am having issue similar to previous reported, while running rb-site 
 upgrade

 https://hellosplat.com/s/beanbag/tickets/3967/
 https://www.mail-archive.com/reviewboard@googlegroups.com/msg15947.html


 information:
 on Linux (CentOS) reviewboard 1.7 -> 2.0.16 ( intended to upgrade to 
 latest but ran into some problem, thought I would do it with a smaller 
 increment )


 easy_install ReviewBoard==2.0.16   (successful)
 rb-site upgrade [path]  fails with following error:



 In model reviews.ReviewRequest: 
 Field 'related_review_number' has been deleted
 In model reviews.Review
 Field 'notify_only_submitter' has been deleted
 In model reviews.ReviewRequestDraft
 Field 'related_review_number' has been deleted
 In model accounts.Profile
 Field 'eclipse_diff_view' has been deleted


 Judging by the name of the columns it seems some customization done by 
 previous admin here. So question is
 What is the best practice to  migrate these extension columns?


 I tried 
 - drop the columns from the database ( and to restore them later ) , 
 and run upgrade again 
 - or used the trick provided in another post 

 >>> from django_evolution.models import Version
 >>> v = Version.objects.all()[0]
 >>> print v
 Hinted version, updated on 2015-02-12 02:23:19+00:00
 >>> v.delete()
 >>> 

  but it doesn't seems to help either 

 Or maybe it should be other way around that  I need to modify the 
 schema somewhere before i run the upgrade script?

 any help / suggestion is appreciated.. thank you


 -- 
>> Supercharge your Review Board with Power Pack: 
>> https://www.reviewboard.org/powerpack/
>> Want us to host Review Board for you? Check out RBCommons: 
>> https://rbcommons.com/
>> Happy user? Let us know! https://www.reviewboard.org/users/
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "reviewboard" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 

Re: Reviewboard upgrade failure

2016-01-15 Thread Christian Hammond
Hi Ben,

This is due to a mismatch between MySQL table types. The existing tables
are likely MyISAM, with MySQL now defaulting to InnoDB for new ones. You'll
need to either migrate all the existing tables, or tell MySQL to use the
existing type for new tables.

(It's a pretty terrible error, but unfortunately, beyond our control. I
just recognize this sort of problem.)

Christian

-- 
Christian Hammond - christ...@beanbaginc.com
Review Board - https://www.reviewboard.org
Beanbag, Inc. - https://www.beanbaginc.com

On Thu, Jan 14, 2016 at 11:27 PM, Ben Cooksley  wrote:

> Hi everyone,
>
> While upgrading from Reviewboard 2.0.17 to 2.5.2 i've encountered a
> few SQL errors.
> Reviewboard itself appears to boot and run fine though, based on the
> nature of the errors I suspect it's a case of index name collisions.
>
> Output from the upgrade process is below:
>
> (virtualenv)reviewboard@mimi:~$ rb-site upgrade
> /srv/www/reviewboard/git.reviewboard.kde.org/
> Rebuilding directory structure
> Updating database. This may take a while.
>
> The log output below, including warnings and errors,
> can be ignored unless upgrade fails.
>
> --  --
> Creating tables ...
> Creating table accounts_trophy
>
> [!] There was an error synchronizing the database. Make sure the
> database is created and has the appropriate permissions, and then
> continue.
> [!] Details: (1005, "Can't create table 'reviewboard_git.#sql-
> 331d_214215' (errno: 150)")
>
> Press Enter to continue
> Creating tables ...
> Creating table attachments_fileattachmenthistory
> Creating table diffviewer_rawfilediffdata
> Creating table notifications_webhooktarget_repositories
>
> [!] There was an error synchronizing the database. Make sure the
> database is created and has the appropriate permissions, and then
> continue.
> [!] Details: (1005, "Can't create table 'reviewboard_git.#sql-
> 331d_214215' (errno: 150)")
>
> Press Enter to continue
> Creating tables ...
> Creating table notifications_webhooktarget
>
> [!] There was an error synchronizing the database. Make sure the
> database is created and has the appropriate permissions, and then
> continue.
> [!] Details: (1005, "Can't create table 'reviewboard_git.#sql-
> 331d_214215' (errno: 150)")
>
> Press Enter to continue
> Creating tables ...
> Creating table webapi_webapitoken
>
> [!] There was an error synchronizing the database. Make sure the
> database is created and has the appropriate permissions, and then
> continue.
> [!] Details: (1005, "Can't create table 'reviewboard_git.#sql-
> 331d_214215' (errno: 150)")
>
> Press Enter to continue
> Creating tables ...
> Upgrading Review Board from 2.0.17 to 2.5.2
> There are unapplied evolutions for accounts.
> There are unapplied evolutions for attachments.
> There are unapplied evolutions for diffviewer.
> There are unapplied evolutions for notifications.
> There are unapplied evolutions for reviews.
> There are unapplied evolutions for webapi.
> Adding baseline version for new models
> Evolutions in notifications baseline: webhooktarget_extra_state,
> webhooktarget_extra_data_null
> Project signature has changed - an evolution is required
> Installing custom SQL ...
> Installing indexes ...
> Installed 0 object(s) from 0 fixture(s)
> CommandError: Error applying evolution: (1005, "Can't create table
> 'reviewboard_git.#sql-331d_214238' (errno: 150)")
>
> Any pointers?
>
> Cheers,
> Ben Cooksley
> KDE Sysadmin
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "reviewboard-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to reviewboard-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Supercharge your Review Board with Power Pack: 
https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: 
https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.