Re: Backup and Restore of Reviewboard 2.0 failing (mysqldump issues)

2016-07-29 Thread harish varadarajan
Hi Eric,

Thanks for your post, that I could understand the issue that was happening 
at my reviewboard instance.

Did you figure out the solution for this.
With your approach to turning the Debug = True, I am currently able to 
access the repositories / enter the edit screen.
But unfortunately, the password field for the user who access on 
repositories is not editable.

But, still while creating newer reviews for older repositories, it states 
that the content / change is not available.
Is the only way to make it work, is to copy the SECRET_KEY from the older 
instance ? 
any ideas on how this could be solved, if access to the older host / 
instance is not available.

Thanks.

Harish

On Thursday, 29 October 2015 12:19:12 UTC+5:30, er...@tibco.com wrote:
>
> I figured out what my issue was. Copying the database from one machine to 
> another isn't sufficient.
>
> ReviewBoard has a "SECRET_KEY" that is used when encrypting passwords into 
> the database. If you're restoring your database backup to a different 
> machine (as I was doing), and you don't copy over the SECRET_KEY, then 
> stuff will break.
>
> If you re-save the passwords from the web UI, it uses the SECRET_KEY when 
> re-obfuscating the password.
>
> Might that be the problem?
>
> Eric.
>
> On Wednesday, October 28, 2015 at 9:56:15 AM UTC-7, er...@tibco.com wrote:
>>
>> Turns out I've been fighting this issue on and off for several days now.
>>
>> This looks like it is one of those particularly evil bugs. I've captured 
>> a lot of details about it below:
>>
>> Situation very similar - I'm using mysqldump to backup a database. In my 
>> case, I'm trying to restore to a different machine for testing purposes.
>>
>> When I bring up the test instance, I get an error 500 when I attempt to 
>> examine the details of a configured repository.
>>
>> Email contains this (trimmed somewhat to avoid the long stack trace):
>>   File "/usr/lib64/python2.7/site-packages/django/template/base.py", 
>> line 897, in render
>> return render_value_in_context(output, context)
>>
>>   File "/usr/lib64/python2.7/site-packages/django/template/base.py", 
>> line 875, in render_value_in_context
>> value = force_text(value)
>>
>>   File "/usr/lib64/python2.7/site-packages/django/utils/encoding.py", 
>> line 116, in force_text
>> raise DjangoUnicodeDecodeError(s, *e.args)
>>
>> DjangoUnicodeDecodeError: 'utf8' codec can't decode byte 0xad in position 
>> 0: invalid start byte. You passed in > at 0x7effbb2e0510> ()
>>
>> 
>> So, seems obvious - an encoding issue. Except, it isn't.
>>
>> I've been very careful to ensure that MySQL uses UTF-8 everywhere (on 
>> both production and testing). A mysqldump of the tables on the production 
>> database, and the test instance database shows that the scmtools_repository 
>> tables are *identical*, including the schema, and show use of UTF-8 as 
>> the charset. I even did a mysql --xml -e query of the tables, and found 
>> that they're identical. A hexdump of the results shows no non-ASCII 
>> characters. In fact, the only odd character is a 09 at the beginning of the 
>> password field (which looks to be intentional?). Mind you, this is as 
>> expected, because the password field looks to be a base64 encoding of an 
>> actual password, so it necessarily wouldn't encode any non-ASCII characters.
>>
>> I've confirmed that changing the password field using SQL, then resetting 
>> the password in the web UI makes the problem go away (for how long?).
>>
>> So now for the *really* messed up part. To try to get more / better 
>> diagnostics, I went to the "conf" folder for my ReviewBoard instance. I 
>> changed "Debug" flag to "True". Restart Apache (hosted via wsgi, FYI).
>>
>> Ready to look at details problem reports. Except ... problem gone
>>
>> I've now repeated this experiment several times. Set "Debug" to "False", 
>> problem occurs. "Debug = True", and problem goes away.
>>
>> This has all the classic signs of being an uninitialized variable. Arghhh.
>>
>> Any suggestions you have for further debugging would be most welcome. I 
>> fear that this is a bug in Django treatment of password fields.
>>
>> Eric.
>>
>> On Monday, December 22, 2014 at 4:53:35 AM UTC-8, Daniel Laird wrote:
>>>
>>> All,
>>>
>>> Since RB 1.5 I have backed up the RB installation everynight be by using
>>> mysqldump user=x password=y reviewboard > backup.sql
>>>
>>> I have also backed up all attachments etc.
>>> I could then restore the data easily with another script.
>>>
>>> I used this method to upgrade from 1.7.25 -> 2.0.11 and with the 
>>> additional rb-site upgrade etc, it all worked great.
>>> However, after 2 days I noticed an error on my setup and re-created the 
>>> site and re-imported the data.
>>>
>>> At this point it was a RB 2.0.11 backup being restored to a RB2.0.11 
>>> database.
>>> It all appeared to go ok, but when I clicked on any review i got
>>> Error 500, something broke, I also got the following email:
>>>
>>> 

Re: Mercurial repository access error post rb-site upgrade "Something broke! (Error 500)"

2016-07-29 Thread harish varadarajan
Further, the reviewboard database was created with UTF8 character set.

MariaDB [reviewboard]> show variables like "character_set_database";
++---+
| Variable_name  | Value |
++---+
| character_set_database | utf8  |

The specific error from the server log seems to be

DjangoUnicodeDecodeError: 'utf8' codec can't decode byte 0x8b in position 
0: invalid start byte. You passed in  ()



On Friday, 29 July 2016 20:26:38 UTC+5:30, harish varadarajan wrote:
>
> Hi,
>
 

>
> I am pretty new to reviewboard and have attempted to migrate reviewboard 
> instance across hosts and versions.
> Our older RB version was and the upgrade was to 2.5.6.1
>
> Steps followed for the upgrade were
> (1) Dump data on the older server (mysql)
> (2) Drop the previously created reviewboard database, created by rb-site 
> install
> (3) Manually create a database named reviewboard with UTF8
> (4) load the data from the mysql dump
> (5) Run rb-site upgrade.
>
> Post the upgrade which completed successfully, the dashboard, contents and 
> other information came up properly, including the repository listing.
> But, the issue is that neither the properties of repositories are editable 
> in newer instance nor or the older diff's from reviews accessible . The 
> creation of newer reviews for the repositories, which get imported are as 
> well not happening due to this..
>
> While trying to access the repository from Manage -> Repositories -> 
> Select repository to change is as below.
> Something broke! (Error 500)
>
> It appears something broke when you tried to go to here. This is either a 
> bug in Review Board or a server configuration error. Please report this to 
> your administrator.
>
>
> Please note that the creation of newer repositories and using them for 
> review requests.
>
>
> The errors in the server error log are similar to the ones below.
>
> Can someone please throw light on what the issue is and how it could be 
> fixed.
>
>
> Unexpected error fetching file from $"http path of the file": 'ascii' 
> codec can't decode byte 0xfe in position 3: ordinal not in range(128)
>
>
> - /usr/lib/python2.7/site-packages/django/forms/widgets.py:237: 
> UnicodeWarning: Unicode unequal comparison failed to convert both arguments 
> to Unicode - interpreting them as being unequal
>   if value != '':
>
>
> Thanks.
>
>
> Harish.
>

-- 
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.


Review Board Ticket #4446: RBTools requesting a .reviewboardrc setting for --svn-prompt-password

2016-07-29 Thread sdubrul
--
To reply, visit https://hellosplat.com/s/beanbag/tickets/4446/
--

New ticket #4446 by sdubrul
For Beanbag, Inc. > Review Board

Status: New
Tags: Priority:Medium, Type:Enhancement


--
RBTools requesting a .reviewboardrc setting for --svn-prompt-password
==

# What version are you running?
RBTools (0.7.6)

# What's the URL of the page this enhancement relates to, if any?
NA

# Describe the enhancement and the motivation for it.
As our svn passwords are never stored locally in our enviroment I have to 
provide --svn-prompt-password on every post or update. It would be nice if 
.reviewboardrc would have a setting so that it is provided automagically.

# What operating system are you using? What browser?
RHEL 6.7

# Please provide any additional information below.
NA

--

-- 
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard-issues+unsubscr...@googlegroups.com.
To post to this group, send email to reviewboard-issues@googlegroups.com.
Visit this group at https://groups.google.com/group/reviewboard-issues.
For more options, visit https://groups.google.com/d/optout.


Re: reverse-proxy ReviewBoard through external Apache with basic auth?

2016-07-29 Thread Will Partain
Christian Hammond  writes:

> If the external Review Board server is requiring Basic Auth for access
> (outside of our Basic Auth requests in the API), then that may be a
> problem. You're dealing with two different kinds of authentication. I'm not
> sure from your description whether things are set up so that Review Board
> is expecting Basic Auth for authentication using some custom backend, or if
> you just have an extra layer around the access to your server.
>
> Can you tell me more about the auth setup, and how/why things are set up
> this way?

Hi, Christian -- the machine I am calling external.example.com
faces the public internet and is the "front door"/gatekeeper for
several services (of which ReviewBoard is one).  It requires
basic HTTP auth to get it to do anything at all.  It's DMZ-ish --
can't see any filesystems, etc.; just reverse-proxies requests
back to the right place.

ReviewBoard runs on (what I am calling) backend.example.com.  We
need "users", so we can tell who did what, but
authentication/authorization aren't critical.  In the past,
passwords were a standard pattern that everyone knew.  (The
authentication that mattered was at the "front door".)

(Some old chat re REMOTE_USER etc is related -- "I already know
this person is OK, let's get on with it".  I can't tell if any of
that stuff is in modern ReviewBoard.)

With the standard Auth, it looked to me like the Authorization
HTTP header (with Basic auth info in it) was coming in from the
reverse proxy and ReviewBoard was using that to authenticate to
the Web API. (Yes?)  What I didn't quite get was: if I made the
ReviewBoard usernames and passwords the same as the "front door"
auth, i.e. the "correct" info should be in the Authorization HTTP
header, it still didn't quite work.  (E.g. I never got a Publish
button for a comment on a review.)

> Generally, I'd recommend not using Basic Auth for your Review Board server,
> and instead using something backed by LDAP, if you need some kind of
> external management of users.

For our ReviewBoard, pretty brainless auth would be fine (see
above).  LDAP would be overkill.  I'd actually prefer ReviewBoard
never saw users' real passwords.  Hmm... is there a way to just
blindly let them in?

(I am also not sure why... if you stick a ReviewBoard server
directly on external.example.com -- still doing HTTP Basic auth
-- and get rid of the reverse-proxying, it all works fine.  I
can't quite see what difference the RB server sees.)

Maybe we'll figure it out :-)  Thanks for your help,

Will

-- 
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.


Mercurial repository access error post rb-site upgrade "Something broke! (Error 500)"

2016-07-29 Thread harish varadarajan
Hi,

I am pretty new to reviewboard and have attempted to migrate reviewboard 
instance across hosts and versions.
Our older RB version was and the upgrade was to 2.5.6.1

Steps followed for the upgrade were
(1) Dump data on the older server (mysql)
(2) Drop the previously created reviewboard database, created by rb-site 
install
(3) Manually create a database named reviewboard with UTF8
(4) load the data from the mysql dump
(5) Run rb-site upgrade.

Post the upgrade which completed successfully, the dashboard, contents and 
other information came up properly, including the repository listing.
But, the issue is that neither the properties of repositories are editable 
in newer instance nor or the older diff's from reviews accessible . The 
creation of newer reviews for the repositories, which get imported are as 
well not happening due to this..

While trying to access the repository from Manage -> Repositories -> Select 
repository to change is as below.
Something broke! (Error 500)

It appears something broke when you tried to go to here. This is either a 
bug in Review Board or a server configuration error. Please report this to 
your administrator.


Please note that the creation of newer repositories and using them for 
review requests.


The errors in the server error log are similar to the ones below.

Can someone please throw light on what the issue is and how it could be 
fixed.


Unexpected error fetching file from $"http path of the file": 'ascii' codec 
can't decode byte 0xfe in position 3: ordinal not in range(128)


- /usr/lib/python2.7/site-packages/django/forms/widgets.py:237: UnicodeWarning: 
Unicode unequal comparison failed to convert both arguments to Unicode - 
interpreting them as being unequal
  if value != '':


Thanks.


Harish.

-- 
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: Using REMOTE_USER to authenticate in reviewboard

2016-07-29 Thread Abhishek Choudhary
Hi,

Wierdly, I tried following approach and it worked:

-copied MIDDLEWARE_CLASSES from settings.py and added 
django.contrib.auth.middleware.RemoteUserMiddleware 
after AuthenticationMiddleware in settings.py
-Went to admin account using username and password that was created at 
rb-site installation and edited Authentication method to Legacy 
Authentication Module and in backends I gave full path of my custom auth 
backend that inherits from RemoteUserBackend

After this It started respecting REMOTE_USER and logged users automatically 
and I was able to create new review requests and had access to dashboard.

Let me know if there is anything wrong with this approach and If I should 
do this some other way.

Thanks,
Abhi

On Friday, July 29, 2016 at 3:38:47 AM UTC+5:30, Christian Hammond wrote:
>
> Hi Abhi,
>
> The authenticate() method is needed for the login page, which will require 
> a password. If you just never use that page, you won't have to worry about 
> using those parameters as-is (see X509AuthBackend and X509AuthMiddleware).
>
> What kind of problems are you hitting, specifically? Any errors?
>
> For the record, your auth backend will need to be a subclass of our 
> AuthBackend class. You can use multiple inheritance for this, though. We 
> have more specialized needs than what Django provides by default, so just 
> dropping in a subclass of RemoteUserBackend without complying with 
> AuthBackend won't work.
>
> Christian
>
> -- 
> Christian Hammond
> President/CEO of Beanbag 
> Makers of Review Board 
>
> On Wed, Jul 27, 2016 at 5:46 AM, Abhishek Choudhary  > wrote:
>
>> Hi,
>>
>> I would like to use REMOTE_USER set by Apache to authenticate users in 
>> ReviewBoard. I have tried adding RemoteUserMiddleware in MIDDLEWARE_CLASSES 
>> and my custom auth backend which extends django's RemoteUserBackend 
>> in AUTHENTICATION_BACKENDS in settings_local.py. But the authentication is 
>> not working. 
>>
>> I looked at 
>> https://www.reviewboard.org/docs/manual/2.5/extending/extensions/hooks/auth-backend-hook/#auth-backend-hook
>>  
>> but it requires that I provide a subclass of 
>> reviewboard.accounts.backends.AuthBackend 
>> 
>>  
>> whose authenticate method takes username and password as arguments. But i 
>> don't have password corresponding to the username.
>>
>> Could you someone help me with this? Has anyone tried using this with 
>> ReviewBoard v2.5.x?
>>
>> Thanks,
>> Abhi
>>
>> -- 
>> 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...@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.