Re: Slow requests, due to new apache processes

2019-01-31 Thread Joshua Cannon
It also seems that now that that daemon mode is being used, I'm seeing a 
lot of "Generating diff chunks for self.filediff id ... took (>15 seconds)"

Our SCM is perforce, I wonder if using multiple threads is hitting some 
kind of limitation or is using some sort of lock with "p4 print".


On Tuesday, January 29, 2019 at 8:28:01 AM UTC-6, Joshua Cannon wrote:
>
> I set up django_debug_toolbar to ignore DEBUG and only fire for myself 
> (I'm lucky we use SSO, so I can verify myself through the X509 cert instead 
> of via IP, which changes). What I was seeing was new loading of initial 
> state.
>
> What I finally discovered was the old server had configured prefork_mpm 
> (in httpd.conf, which I didn't check to look), whereas I had not (I 
> would've assumed if no values were provided some defaults would've been 
> used but that was not seemingly the case). 
>
> The documentation I was referring to is at 
> https://www.reviewboard.org/docs/manual/3.0/admin/installation/creating-sites/#beginning-installation
>  under 
> "Apache should use the Prefork MPM".
>
>
> On Monday, January 28, 2019 at 6:49:53 PM UTC-6, Christian Hammond wrote:
>>
>> We find that mod_wsgi daemon mode works well for us. It won't solve the 
>> template rendering issue, but template structures are cached after their 
>> first parse (the cache is local per-process), so long as DEBUG=False. If 
>> you're seeing this on every page load, it could be due to DEBUG being set 
>> to True (if you're running django_debug_toolbar, this very likely may be 
>> happening), or you're just seeing new threads/processes loading initial 
>> state on first request.
>>
>> The URLResolver structure does have to be built for each new process as 
>> well, and there's no getting around that, but this is a first-time startup 
>> cost, and users shouldn't be seeing it on-going unless processes are 
>> frequently being re-launched.
>>
>> You'll also see some slowdown if using a network filesystem to store the 
>> Python packages (rare, but we've seen this happen). Those should always be 
>> local. As should the site directory.
>>
>> Running daemon mode with a multi-threaded setup should minimize these. 
>> Most of the data will be loaded either immediately on startup or on first 
>> request (per process), and shared amongst all threads. The processes should 
>> rarely recycle as well, as it's mostly the threads that will be discarded 
>> and re-created periodically.
>>
>> We used to only recommend single-threaded setups before, due to some bugs 
>> in third-party libraries and a couple in ours, but that hasn't been an 
>> issue in a long while. Do we have some stale docs still recommending this 
>> that you saw?
>>
>> Christian
>>
>> On Mon, Jan 28, 2019 at 3:13 PM Joshua Cannon  wrote:
>>
>>> Howdy folks!
>>>
>>> My users were complaining about slow performance after we re-provisioned 
>>> our VM from scratch. 
>>>
>>> After doing some sleuthing using django_debug_toolbar, I found a couple 
>>> of templates were taking a significant amount of time. The first was 
>>> "base/_mobile_navbar.html". After some profiling of rendering the template, 
>>> I found out the time is spent populating the URLResolver's internal data 
>>> structure for all the regular expressions. Every time I refresh the page, I 
>>> see the same template take the same amount of time, which tells me apache 
>>> isn't re-using the processes between requests (or something, I'm not really 
>>> a good sysadmin).
>>>
>>> I found that Django recommends deploying using mod_wsgi in daemon mode 
>>> <https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/modwsgi/#using-mod-wsgi-daemon-mode>.
>>>  
>>> But I also noticed our previous incarnation of the server didn't have this 
>>> enabled.
>>>
>>> What settings do y'all suggest to ensure each request isn't spending 
>>> lots of time rendering templates? I see y'all recommned using the 
>>> single-threaded Prefork MPM, should I configure WSGI daemon to also be 
>>> single-threaded?
>>>
>>> Thanks!
>>>
>>> -- 
>>> 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 
>>

Re: Exception when logging exception (missing local_site_name)

2019-01-30 Thread Joshua Cannon
It's an issue with django_debug_toolber. Ignore me :)

On Wednesday, January 30, 2019 at 9:05:18 AM UTC-6, Joshua Cannon wrote:
>
> OK, *seemingly* the LocalSiteMiddleware isn't executing, which would 
> explain "_local_site_name" missing.
>
> On Tuesday, January 29, 2019 at 5:07:24 PM UTC-6, Joshua Cannon wrote:
>>
>> Howdy folks!
>>
>> I'm seeing the following traceback in the log after enabling the limiting 
>> of large diffs and then attempting to render an astronomically large diff.
>>
>> [Tue Jan 29 23:00:03.687784 2019] [wsgi:error] [pid 21336] [client 
>> 130.164.38.118:61206] Traceback (most recent call last):, referer: 
>> https://review-board.mysite.com/r/266244/diff/1
>> [Tue Jan 29 23:00:03.690938 2019] [wsgi:error] [pid 21336] [client 
>> 130.164.38.118:61206]   File "/usr/lib64/python2.7/logging/__init__.py", 
>> line 851, in emit, referer: 
>> https://review-board.mysite.com/r/266244/diff/1
>> [Tue Jan 29 23:00:03.697252 2019] [wsgi:error] [pid 21336] [client 
>> 130.164.38.118:61206] msg = self.format(record), referer: 
>> https://review-board.mysite.com/r/266244/diff/1
>> [Tue Jan 29 23:00:03.697397 2019] [wsgi:error] [pid 21336] [client 
>> 130.164.38.118:61206]   File "/usr/lib64/python2.7/logging/__init__.py", 
>> line 724, in format, referer: 
>> https://review-board.mysite.com/r/266244/diff/1
>> [Tue Jan 29 23:00:03.697567 2019] [wsgi:error] [pid 21336] [client 
>> 130.164.38.118:61206] return fmt.format(record), referer: 
>> https://review-board.mysite.com/r/266244/diff/1
>> [Tue Jan 29 23:00:03.697625 2019] [wsgi:error] [pid 21336] [client 
>> 130.164.38.118:61206]   File 
>> "/opt/apps/reviewboard/venv/lib/python2.7/site-packages/djblets/log/__init__.py",
>>  
>> line 155, in format, referer: 
>> https://review-board.mysite.com/r/266244/diff/1
>> [Tue Jan 29 23:00:03.698207 2019] [wsgi:error] [pid 21336] [client 
>> 130.164.38.118:61206] getattr(record, 'request', None)), referer: 
>> https://review-board.mysite.com/r/266244/diff/1
>> [Tue Jan 29 23:00:03.698300 2019] [wsgi:error] [pid 21336] [client 
>> 130.164.38.118:61206]   File 
>> "/opt/apps/reviewboard/venv/lib/python2.7/site-packages/djblets/log/__init__.py",
>>  
>> line 161, in format_request, referer: 
>> https://review-board.mysite.com/r/266244/diff/1
>> [Tue Jan 29 23:00:03.698452 2019] [wsgi:error] [pid 21336] [client 
>> 130.164.38.118:61206] return self.request_fmt % request.__dict__, 
>> referer: https://review-board.mysite.com/r/266244/diff/1
>> [Tue Jan 29 23:00:03.699755 2019] [wsgi:error] [pid 21336] [client 
>> 130.164.38.118:61206] KeyError: u'_local_site_name', referer: 
>> https://review-board.mysite.com/r/266244/diff/1
>> [Tue Jan 29 23:00:03.699874 2019] [wsgi:error] [pid 21336] [client 
>> 130.164.38.118:61206] Logged from file views.py, line 311, referer: 
>> https://review-board.mysite.com/r/266244/diff/1
>>
>>
>> I'm guessing one of the Djblets middleware is responsible for attaching 
>> the local_site_name to the request, but isn't? But I'm sure you guys are 
>> much more equipped to debug this kind of thing :)
>>
>> Reviewboard version is 2.5.18
>>
>

-- 
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 
"Review Board Community" 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: Exception when logging exception (missing local_site_name)

2019-01-30 Thread Joshua Cannon
OK, *seemingly* the LocalSiteMiddleware isn't executing, which would 
explain "_local_site_name" missing.

On Tuesday, January 29, 2019 at 5:07:24 PM UTC-6, Joshua Cannon wrote:
>
> Howdy folks!
>
> I'm seeing the following traceback in the log after enabling the limiting 
> of large diffs and then attempting to render an astronomically large diff.
>
> [Tue Jan 29 23:00:03.687784 2019] [wsgi:error] [pid 21336] [client 
> 130.164.38.118:61206] Traceback (most recent call last):, referer: 
> https://review-board.mysite.com/r/266244/diff/1
> [Tue Jan 29 23:00:03.690938 2019] [wsgi:error] [pid 21336] [client 
> 130.164.38.118:61206]   File "/usr/lib64/python2.7/logging/__init__.py", 
> line 851, in emit, referer: 
> https://review-board.mysite.com/r/266244/diff/1
> [Tue Jan 29 23:00:03.697252 2019] [wsgi:error] [pid 21336] [client 
> 130.164.38.118:61206] msg = self.format(record), referer: 
> https://review-board.mysite.com/r/266244/diff/1
> [Tue Jan 29 23:00:03.697397 2019] [wsgi:error] [pid 21336] [client 
> 130.164.38.118:61206]   File "/usr/lib64/python2.7/logging/__init__.py", 
> line 724, in format, referer: 
> https://review-board.mysite.com/r/266244/diff/1
> [Tue Jan 29 23:00:03.697567 2019] [wsgi:error] [pid 21336] [client 
> 130.164.38.118:61206] return fmt.format(record), referer: 
> https://review-board.mysite.com/r/266244/diff/1
> [Tue Jan 29 23:00:03.697625 2019] [wsgi:error] [pid 21336] [client 
> 130.164.38.118:61206]   File 
> "/opt/apps/reviewboard/venv/lib/python2.7/site-packages/djblets/log/__init__.py",
>  
> line 155, in format, referer: 
> https://review-board.mysite.com/r/266244/diff/1
> [Tue Jan 29 23:00:03.698207 2019] [wsgi:error] [pid 21336] [client 
> 130.164.38.118:61206] getattr(record, 'request', None)), referer: 
> https://review-board.mysite.com/r/266244/diff/1
> [Tue Jan 29 23:00:03.698300 2019] [wsgi:error] [pid 21336] [client 
> 130.164.38.118:61206]   File 
> "/opt/apps/reviewboard/venv/lib/python2.7/site-packages/djblets/log/__init__.py",
>  
> line 161, in format_request, referer: 
> https://review-board.mysite.com/r/266244/diff/1
> [Tue Jan 29 23:00:03.698452 2019] [wsgi:error] [pid 21336] [client 
> 130.164.38.118:61206] return self.request_fmt % request.__dict__, 
> referer: https://review-board.mysite.com/r/266244/diff/1
> [Tue Jan 29 23:00:03.699755 2019] [wsgi:error] [pid 21336] [client 
> 130.164.38.118:61206] KeyError: u'_local_site_name', referer: 
> https://review-board.mysite.com/r/266244/diff/1
> [Tue Jan 29 23:00:03.699874 2019] [wsgi:error] [pid 21336] [client 
> 130.164.38.118:61206] Logged from file views.py, line 311, referer: 
> https://review-board.mysite.com/r/266244/diff/1
>
>
> I'm guessing one of the Djblets middleware is responsible for attaching 
> the local_site_name to the request, but isn't? But I'm sure you guys are 
> much more equipped to debug this kind of thing :)
>
> Reviewboard version is 2.5.18
>

-- 
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 
"Review Board Community" 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.


Exception when logging exception (missing local_site_name)

2019-01-29 Thread Joshua Cannon
Howdy folks!

I'm seeing the following traceback in the log after enabling the limiting 
of large diffs and then attempting to render an astronomically large diff.

[Tue Jan 29 23:00:03.687784 2019] [wsgi:error] [pid 21336] [client 
130.164.38.118:61206] Traceback (most recent call last):, referer: 
https://review-board.mysite.com/r/266244/diff/1
[Tue Jan 29 23:00:03.690938 2019] [wsgi:error] [pid 21336] [client 
130.164.38.118:61206]   File "/usr/lib64/python2.7/logging/__init__.py", 
line 851, in emit, referer: https://review-board.mysite.com/r/266244/diff/1
[Tue Jan 29 23:00:03.697252 2019] [wsgi:error] [pid 21336] [client 
130.164.38.118:61206] msg = self.format(record), referer: 
https://review-board.mysite.com/r/266244/diff/1
[Tue Jan 29 23:00:03.697397 2019] [wsgi:error] [pid 21336] [client 
130.164.38.118:61206]   File "/usr/lib64/python2.7/logging/__init__.py", 
line 724, in format, referer: 
https://review-board.mysite.com/r/266244/diff/1
[Tue Jan 29 23:00:03.697567 2019] [wsgi:error] [pid 21336] [client 
130.164.38.118:61206] return fmt.format(record), referer: 
https://review-board.mysite.com/r/266244/diff/1
[Tue Jan 29 23:00:03.697625 2019] [wsgi:error] [pid 21336] [client 
130.164.38.118:61206]   File 
"/opt/apps/reviewboard/venv/lib/python2.7/site-packages/djblets/log/__init__.py",
 
line 155, in format, referer: 
https://review-board.mysite.com/r/266244/diff/1
[Tue Jan 29 23:00:03.698207 2019] [wsgi:error] [pid 21336] [client 
130.164.38.118:61206] getattr(record, 'request', None)), referer: 
https://review-board.mysite.com/r/266244/diff/1
[Tue Jan 29 23:00:03.698300 2019] [wsgi:error] [pid 21336] [client 
130.164.38.118:61206]   File 
"/opt/apps/reviewboard/venv/lib/python2.7/site-packages/djblets/log/__init__.py",
 
line 161, in format_request, referer: 
https://review-board.mysite.com/r/266244/diff/1
[Tue Jan 29 23:00:03.698452 2019] [wsgi:error] [pid 21336] [client 
130.164.38.118:61206] return self.request_fmt % request.__dict__, 
referer: https://review-board.mysite.com/r/266244/diff/1
[Tue Jan 29 23:00:03.699755 2019] [wsgi:error] [pid 21336] [client 
130.164.38.118:61206] KeyError: u'_local_site_name', referer: 
https://review-board.mysite.com/r/266244/diff/1
[Tue Jan 29 23:00:03.699874 2019] [wsgi:error] [pid 21336] [client 
130.164.38.118:61206] Logged from file views.py, line 311, referer: 
https://review-board.mysite.com/r/266244/diff/1


I'm guessing one of the Djblets middleware is responsible for attaching the 
local_site_name to the request, but isn't? But I'm sure you guys are much 
more equipped to debug this kind of thing :)

Reviewboard version is 2.5.18

-- 
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 
"Review Board Community" 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: Slow requests, due to new apache processes

2019-01-29 Thread Joshua Cannon
I set up django_debug_toolbar to ignore DEBUG and only fire for myself (I'm 
lucky we use SSO, so I can verify myself through the X509 cert instead of 
via IP, which changes). What I was seeing was new loading of initial state.

What I finally discovered was the old server had configured prefork_mpm (in 
httpd.conf, which I didn't check to look), whereas I had not (I would've 
assumed if no values were provided some defaults would've been used but 
that was not seemingly the case). 

The documentation I was referring to is at 
https://www.reviewboard.org/docs/manual/3.0/admin/installation/creating-sites/#beginning-installation
 under 
"Apache should use the Prefork MPM".


On Monday, January 28, 2019 at 6:49:53 PM UTC-6, Christian Hammond wrote:
>
> We find that mod_wsgi daemon mode works well for us. It won't solve the 
> template rendering issue, but template structures are cached after their 
> first parse (the cache is local per-process), so long as DEBUG=False. If 
> you're seeing this on every page load, it could be due to DEBUG being set 
> to True (if you're running django_debug_toolbar, this very likely may be 
> happening), or you're just seeing new threads/processes loading initial 
> state on first request.
>
> The URLResolver structure does have to be built for each new process as 
> well, and there's no getting around that, but this is a first-time startup 
> cost, and users shouldn't be seeing it on-going unless processes are 
> frequently being re-launched.
>
> You'll also see some slowdown if using a network filesystem to store the 
> Python packages (rare, but we've seen this happen). Those should always be 
> local. As should the site directory.
>
> Running daemon mode with a multi-threaded setup should minimize these. 
> Most of the data will be loaded either immediately on startup or on first 
> request (per process), and shared amongst all threads. The processes should 
> rarely recycle as well, as it's mostly the threads that will be discarded 
> and re-created periodically.
>
> We used to only recommend single-threaded setups before, due to some bugs 
> in third-party libraries and a couple in ours, but that hasn't been an 
> issue in a long while. Do we have some stale docs still recommending this 
> that you saw?
>
> Christian
>
> On Mon, Jan 28, 2019 at 3:13 PM Joshua Cannon  > wrote:
>
>> Howdy folks!
>>
>> My users were complaining about slow performance after we re-provisioned 
>> our VM from scratch. 
>>
>> After doing some sleuthing using django_debug_toolbar, I found a couple 
>> of templates were taking a significant amount of time. The first was 
>> "base/_mobile_navbar.html". After some profiling of rendering the template, 
>> I found out the time is spent populating the URLResolver's internal data 
>> structure for all the regular expressions. Every time I refresh the page, I 
>> see the same template take the same amount of time, which tells me apache 
>> isn't re-using the processes between requests (or something, I'm not really 
>> a good sysadmin).
>>
>> I found that Django recommends deploying using mod_wsgi in daemon mode 
>> <https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/modwsgi/#using-mod-wsgi-daemon-mode>.
>>  
>> But I also noticed our previous incarnation of the server didn't have this 
>> enabled.
>>
>> What settings do y'all suggest to ensure each request isn't spending lots 
>> of time rendering templates? I see y'all recommned using the 
>> single-threaded Prefork MPM, should I configure WSGI daemon to also be 
>> single-threaded?
>>
>> Thanks!
>>
>> -- 
>> 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 
>> "Review Board Community" 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.
>>
>
>
> -- 
> Christian Hammond
> President/CEO of Beanbag <https://www.beanbaginc.com/>
> Makers of Review Board <https://www.reviewboard.org/>
>

-- 
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 
"Review Board Community" 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: Power Pack Exception

2019-01-29 Thread Joshua Cannon
User 2128 (https://review-board.natinst.com/admin/db/auth/user/2128/) does 
exist. It's a dummy user we created to let people earmark reviews to be 
pre-submit built by our build farm. But that *shouldn't* make a difference. 
FWIW the user is active with just a first name and no last name. Not staff 
or superuser.

I also remember seeing the same error for user with ID 9 which is a real 
user. Has username/first name/last name/email/active/not staff/not 
superuser.


On Monday, January 28, 2019 at 6:39:28 PM UTC-6, Christian Hammond wrote:
>
> Hi Josh,
>
> We'll need to poke around for this in our code. It's going to be entirely 
> within Power Pack code. Can you tell me if User #2128 is in the database, 
> and whether there's anything special about it (is it an active user?)
>
> Christian
>
> On Mon, Jan 28, 2019 at 11:40 AM Joshua Cannon  > wrote:
>
>> Howdy folks!
>>
>>
>> I'm seeing the following exceptions from a user using Power Pack. I'd 
>> usually debug this kind of thing myself, but I see that rbpowerpack is 
>> closed source (only ships .pyc files).
>>
>> I'm gonna guess the missing key is the ID of something in the database, 
>> but that's just a guess.
>>
>>
>> Below is the stack trace. What area of RB should I be poking around in 
>> for the source of this issue?
>>
>>
>>
>> Traceback (most recent call last):
>>
>>  
>>
>>   File 
>> "/opt/apps/reviewboard/venv/lib/python2.7/site-packages/django/core/handlers/base.py",
>>  
>> line 112, in get_response
>>
>> response = wrapped_callback(request, *callback_args, 
>> **callback_kwargs)
>>
>>  
>>
>>   File 
>> "/opt/apps/reviewboard/venv/lib/python2.7/site-packages/reviewboard/accounts/decorators.py",
>>  
>> line 23, in _check
>>
>> return login_required(view_func)(*args, **kwargs)
>>
>>  
>>
>>   File 
>> "/opt/apps/reviewboard/venv/lib/python2.7/site-packages/django/contrib/auth/decorators.py",
>>  
>> line 22, in _wrapped_view
>>
>> return view_func(request, *args, **kwargs)
>>
>>  
>>
>>   File 
>> "/opt/apps/reviewboard/venv/lib/python2.7/site-packages/reviewboard/site/decorators.py",
>>  
>> line 35, in _check
>>
>> return view_func(request, local_site=local_site, *args, **kwargs)
>>
>>  
>>
>>   File "/rbpowerpack/reports/decorators.py", line 29, in _check
>>
>>  
>>
>>   File "/rbpowerpack/reports/views.py", line 58, in report_data
>>
>>  
>>
>>   File "/rbpowerpack/reports/reports.py", line 1192, in get_csv
>>
>>  
>>
>> KeyError: 2128L
>>
>>  
>>
>>  
>>
>> >
>> path:/reports/review-relationships/data/,
>>
>> GET:> [u'2019-01-26'], u'users': [u''], u'groups': 
>> [u'group1,group2,group3,group4,group5']}>,
>>
>> ...
>>
>> -- 
>> 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 
>> "Review Board Community" 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.
>>
>
>
> -- 
> Christian Hammond
> President/CEO of Beanbag <https://www.beanbaginc.com/>
> Makers of Review Board <https://www.reviewboard.org/>
>

-- 
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 
"Review Board Community" 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.


Slow requests, due to new apache processes

2019-01-28 Thread Joshua Cannon
Howdy folks!

My users were complaining about slow performance after we re-provisioned 
our VM from scratch. 

After doing some sleuthing using django_debug_toolbar, I found a couple of 
templates were taking a significant amount of time. The first was 
"base/_mobile_navbar.html". After some profiling of rendering the template, 
I found out the time is spent populating the URLResolver's internal data 
structure for all the regular expressions. Every time I refresh the page, I 
see the same template take the same amount of time, which tells me apache 
isn't re-using the processes between requests (or something, I'm not really 
a good sysadmin).

I found that Django recommends deploying using mod_wsgi in daemon mode 
.
 
But I also noticed our previous incarnation of the server didn't have this 
enabled.

What settings do y'all suggest to ensure each request isn't spending lots 
of time rendering templates? I see y'all recommned using the 
single-threaded Prefork MPM, should I configure WSGI daemon to also be 
single-threaded?

Thanks!

-- 
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 
"Review Board Community" 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.


Power Pack Exception

2019-01-28 Thread Joshua Cannon


Howdy folks!


I'm seeing the following exceptions from a user using Power Pack. I'd 
usually debug this kind of thing myself, but I see that rbpowerpack is 
closed source (only ships .pyc files).

I'm gonna guess the missing key is the ID of something in the database, but 
that's just a guess.


Below is the stack trace. What area of RB should I be poking around in for 
the source of this issue?



Traceback (most recent call last):

 

  File 
"/opt/apps/reviewboard/venv/lib/python2.7/site-packages/django/core/handlers/base.py",
 
line 112, in get_response

response = wrapped_callback(request, *callback_args, **callback_kwargs)

 

  File 
"/opt/apps/reviewboard/venv/lib/python2.7/site-packages/reviewboard/accounts/decorators.py",
 
line 23, in _check

return login_required(view_func)(*args, **kwargs)

 

  File 
"/opt/apps/reviewboard/venv/lib/python2.7/site-packages/django/contrib/auth/decorators.py",
 
line 22, in _wrapped_view

return view_func(request, *args, **kwargs)

 

  File 
"/opt/apps/reviewboard/venv/lib/python2.7/site-packages/reviewboard/site/decorators.py",
 
line 35, in _check

return view_func(request, local_site=local_site, *args, **kwargs)

 

  File "/rbpowerpack/reports/decorators.py", line 29, in _check

 

  File "/rbpowerpack/reports/views.py", line 58, in report_data

 

  File "/rbpowerpack/reports/reports.py", line 1192, in get_csv

 

KeyError: 2128L

 

 

,

...

-- 
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 
"Review Board Community" 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 #4784: X509 authentication hits database for every request

2019-01-25 Thread Joshua Cannon
--
To reply, visit https://hellosplat.com/s/beanbag/tickets/4784/
--

New ticket #4784 by jcannon
For Beanbag, Inc. > Review Board

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


--
X509 authentication hits database for every request
==

Compare The X509Middleware 
https://github.com/reviewboard/reviewboard/blob/master/reviewboard/accounts/middleware.py#L58from
 Review-board with the RemoteUserMiddleware from Django 
https://github.com/django/django/blob/master/django/contrib/auth/middleware.py#L27

Specifically see [this 
comment/code](https://github.com/django/django/blob/master/django/contrib/auth/middleware.py#L65)
 from RemoteUserMiddleware which simply returns if the request's session 
already has a user and that user has the same username.

ReviewBoard currently hits the DB for every request, as it doesn't have this 
logic.

See [this 
commit](https://github.com/pds-support/reviewboard/commit/08dd68343ecdb569c73d178cf9d0e1cdc76e3c7c#diff-93d6d4bee8444b20040a56f7b48877f5)
 of our fork of ReviewBoard for changes that add this improvement (along with 
other X509 fields to use when creating users, feel free to ignore).


--

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


Slow SQL query for dashboard

2018-10-25 Thread Joshua Cannon
Howdy folks!

My users have noticed that the dashboard has gotten increasingly slower, 
taking several seconds to completely load (I think historically it's always 
been slow, but recently people have come out of the woodwork to complain). 
I noticed in the MySQL "High Cost SQL Statements" most of them are a very 
similar SELECT COUNT or SELECT DISTINCTROW which on average takes around 3 
or 4 seconds to complete.

Our setup is apache + mod_wsgi, MySQL InnoDB database.

An example of the first ~20 or so rows that MySQL says are "high cost" are 
attached (note that times are in microseconds)

Happy to provide more info, and thanks in advanced!


-- 
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 
"Review Board Community" 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.
Query,Full Table Scan,Executed (#),Errors (#),Warnings (#),Total Time,Max Time,Avg Time,Rows Sent (#),Avg. Rows Sent (#),Rows Scanned (#),Avg. Rows Scanned (#),Temp. Tables (#)
SELECT COUNT ( DISTINCTROW `reviews_reviewrequest` . `id` ) FROM `reviews_reviewrequest` INNER JOIN `auth_user` ON ( `reviews_reviewrequest` . `submitter_id` = `auth_user` . `id` ) LEFT OUTER JOIN `reviews_reviewrequest_target_people` ON ( `reviews_reviewrequest` . `id` = `reviews_reviewrequest_target_people` . `reviewrequest_id` ) LEFT OUTER JOIN `reviews_reviewrequest_target_groups` ON ( `reviews_reviewrequest` . `id` = `reviews_reviewrequest_target_groups` . `reviewrequest_id` ) LEFT OUTER JOIN `accounts_profile_starred_review_requests` ON ( `reviews_reviewrequest` . `id` = `accounts_profile_starred_review_requests` . `reviewrequest_id` ) WHERE ( ( `reviews_reviewrequest` . `public` = ? OR `reviews_reviewrequest` . `submitter_id` = ? ) AND `auth_user` . `is_active` = ? AND `reviews_reviewrequest` . `status` = ? AND `reviews_reviewrequest` . `local_site_id` IS NULL AND ( `reviews_reviewrequest_target_people` . `user_id` = ? OR `reviews_reviewrequest_target_groups` . `group_id` IN (...) OR `accounts_profile_starred_review_requests` . `profile_id` = ? ) AND ,,69553,1,0,2.86803E+11,75910190.32,4123522.02,69553,1,9381694476,134886,100532
SELECT COUNT ( DISTINCTROW `reviews_reviewrequest` . `id` ) FROM `reviews_reviewrequest` INNER JOIN `auth_user` ON ( `reviews_reviewrequest` . `submitter_id` = `auth_user` . `id` ) LEFT OUTER JOIN `reviews_reviewrequest_target_people` ON ( `reviews_reviewrequest` . `id` = `reviews_reviewrequest_target_people` . `reviewrequest_id` ) LEFT OUTER JOIN `reviews_reviewrequest_target_groups` ON ( `reviews_reviewrequest` . `id` = `reviews_reviewrequest_target_groups` . `reviewrequest_id` ) LEFT OUTER JOIN `accounts_profile_starred_review_requests` ON ( `reviews_reviewrequest` . `id` = `accounts_profile_starred_review_requests` . `reviewrequest_id` ) WHERE ( ( `reviews_reviewrequest` . `public` = ? OR `reviews_reviewrequest` . `submitter_id` = ? ) AND `auth_user` . `is_active` = ? AND `reviews_reviewrequest` . `status` = ? AND `reviews_reviewrequest` . `local_site_id` IS NULL AND ( `reviews_reviewrequest_target_people` . `user_id` = ? OR `reviews_reviewrequest_target_groups` . `group_id` IN (?) OR `accounts_profile_starred_review_requests` . `profile_id` = ? ) AND ,,58915,0,0,2.42122E+11,77549288.2,4109689.27,58915,1,8210335156,139359,99326
"SELECT DISTINCTROW `reviews_reviewrequest` . `id` , `reviews_reviewrequest` . `description` , `reviews_reviewrequest` . `description_rich_text` , `reviews_reviewrequest` . `testing_done` , `reviews_reviewrequest` . `testing_done_rich_text` , `reviews_reviewrequest` . `bugs_closed` , `reviews_reviewrequest` . `branch` , `reviews_reviewrequest` . `commit_id` , `reviews_reviewrequest` . `extra_data` , `reviews_reviewrequest` . `rich_text` , `reviews_reviewrequest` . `summary` , `reviews_reviewrequest` . `submitter_id` , `reviews_reviewrequest` . `time_added` , `reviews_reviewrequest` . `last_updated` , `reviews_reviewrequest` . `status` , `reviews_reviewrequest` . `public` , `reviews_reviewrequest` . `changenum` , `reviews_reviewrequest` . `repository_id` , `reviews_reviewrequest` . `email_message_id` , `reviews_reviewrequest` . `time_emailed` , `reviews_reviewrequest` . `diffset_history_id` , `reviews_reviewrequest` . `last_review_timestamp` , `reviews_reviewrequest` . ",*,17175,0,0,1.57455E+11,181180256,9167663.68,533120,31,15093158090,878786,17567
SELECT COUNT ( DISTINCTROW `reviews_reviewrequest` . `id` ) FROM `reviews_reviewrequest` INNER JOIN `auth_user` ON ( `reviews_reviewrequest` . `submitter_id` = `auth_user` . `id` ) LEFT OUTER JOIN `reviews_reviewrequest_target_people` ON ( `reviews_reviewrequest` . 

Re: posting review with X509 Authentication turned on

2018-09-12 Thread Joshua Cannon
Ignore this. My browser was caching the result :)

On Tuesday, September 11, 2018 at 5:18:01 PM UTC-5, Joshua Cannon wrote:
>
> OK I found out I had to turn the SSL Verify flag to optional, but Mellon 
> was still redirecting /api URLS. That combined with adding a configuration 
> in apache to allow access for /api allows stuff to work (if they use API 
> token for posting). But it also means anonymous users can access the 
> reviews through the API (Even with allow anonymous access disabled).
>
> What is the smallest set of directories underneath /api I would need to 
> allow to still make the scripts work?
>
> On Monday, September 10, 2018 at 5:10:13 PM UTC-5, Joshua Cannon wrote:
>>
>> Howdy folks,
>>
>> I'm testing out SSO with our Review Board server and am having some 
>> difficulty posting review (as you'd expect). Do you guys have documentation 
>> on how to to use the tools with an SSO server (I see the "ext-auth-cookies" 
>> flag, but I'm unsure how to use it.)?
>>
>> Thanks!
>>
>

-- 
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 
"Review Board Community" 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: posting review with X509 Authentication turned on

2018-09-11 Thread Joshua Cannon
OK I found out I had to turn the SSL Verify flag to optional, but Mellon 
was still redirecting /api URLS. That combined with adding a configuration 
in apache to allow access for /api allows stuff to work (if they use API 
token for posting). But it also means anonymous users can access the 
reviews through the API (Even with allow anonymous access disabled).

What is the smallest set of directories underneath /api I would need to 
allow to still make the scripts work?

On Monday, September 10, 2018 at 5:10:13 PM UTC-5, Joshua Cannon wrote:
>
> Howdy folks,
>
> I'm testing out SSO with our Review Board server and am having some 
> difficulty posting review (as you'd expect). Do you guys have documentation 
> on how to to use the tools with an SSO server (I see the "ext-auth-cookies" 
> flag, but I'm unsure how to use it.)?
>
> Thanks!
>

-- 
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 
"Review Board Community" 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.


posting review with X509 Authentication turned on

2018-09-10 Thread Joshua Cannon
Howdy folks,

I'm testing out SSO with our Review Board server and am having some 
difficulty posting review (as you'd expect). Do you guys have documentation 
on how to to use the tools with an SSO server (I see the "ext-auth-cookies" 
flag, but I'm unsure how to use it.)?

Thanks!

-- 
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 
"Review Board Community" 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.


Disallowing large file uploads

2018-09-10 Thread Joshua Cannon
Howdy folks!

I recently ran into an issue where our users uploaded a diff against a 173 
MB JSON file (I suspect the diff was very involved too) which ate up all of 
our servers memory and started thrashing.
Is there a way to limit the diff size/source file size to something 
reasonable?

(Fun fact, the diff is large enough to blow through the Python stack frame 
limit when trying to render)

Thanks!

-- 
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 
"Review Board Community" 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: ReviewBot configuration form nonexistent

2018-09-07 Thread Joshua Cannon
Unfortunately, I already have that patch applied locally (without, I just 
get 500 and DEBUG=True gives me unicode decode error when trying to load 
the extensions. It stems from the Unicode characters in the reviewbot 
README which is pulled in the long_description).
So this symptom is after patching.

On Thursday, September 6, 2018 at 7:00:45 PM UTC-5, Christian Hammond wrote:
>
> I'm attaching the patch we'll be including. If this doesn't fix it, then 
> there's an entirely different problem that I haven't seen yet.
>
> Christian
>
> On Thu, Sep 6, 2018 at 4:57 PM Joshua Cannon  > wrote:
>
>> I've restarted apache probably more than was warranted trying to figure 
>> this one out :)
>> I got here after the unicode decode error with the latest ReviewBot 
>> (using the rst long description)
>> Is there a link to the fix on the reviewboard reviews or a commit ID? If 
>> so I can apply it locally for the time being.
>>
>> On Thursday, September 6, 2018 at 6:53:22 PM UTC-5, Christian Hammond 
>> wrote:
>>>
>>> Hi Joshua,
>>>
>>> Hmm, this *might* have something to due with a metadata loading bug that 
>>> we've fixed in Djblets and will be putting out a release for hopefully this 
>>> coming week. I'm not certain, though. That's certainly unusual-looking, and 
>>> you'd have seen something in a log if you hit it.
>>>
>>> Does restarting Apache solve anything? (I hate giving those kinds of 
>>> attempts at answers, but worth checking.)
>>>
>>> Christian
>>>
>>> On Thu, Sep 6, 2018 at 2:46 PM Joshua Cannon  wrote:
>>>
>>>> Hey guys, 
>>>>
>>>> I'm seeing the following nonexistent form:
>>>>
>>>> [image: Capture.PNG]
>>>>
>>>> Nothing in the log (with level DEBUG) or in the apache error log.
>>>>
>>>> ReviewBoard 3.0.8 and ReviewBot 1.0.1
>>>>
>>>> Any ideas?
>>>>
>>>> -- 
>>>> 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 "Review Board Community" 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.
>>>>
>>>
>>>
>>> -- 
>>> Christian Hammond
>>> President/CEO of Beanbag <https://www.beanbaginc.com/>
>>> Makers of Review Board <https://www.reviewboard.org/>
>>>
>> -- 
>> 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 
>> "Review Board Community" 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.
>>
>
>
> -- 
> Christian Hammond
> President/CEO of Beanbag <https://www.beanbaginc.com/>
> Makers of Review Board <https://www.reviewboard.org/>
>

-- 
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 
"Review Board Community" 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: ReviewBot configuration form nonexistent

2018-09-06 Thread Joshua Cannon
I've restarted apache probably more than was warranted trying to figure 
this one out :)
I got here after the unicode decode error with the latest ReviewBot (using 
the rst long description)
Is there a link to the fix on the reviewboard reviews or a commit ID? If so 
I can apply it locally for the time being.

On Thursday, September 6, 2018 at 6:53:22 PM UTC-5, Christian Hammond wrote:
>
> Hi Joshua,
>
> Hmm, this *might* have something to due with a metadata loading bug that 
> we've fixed in Djblets and will be putting out a release for hopefully this 
> coming week. I'm not certain, though. That's certainly unusual-looking, and 
> you'd have seen something in a log if you hit it.
>
> Does restarting Apache solve anything? (I hate giving those kinds of 
> attempts at answers, but worth checking.)
>
> Christian
>
> On Thu, Sep 6, 2018 at 2:46 PM Joshua Cannon  > wrote:
>
>> Hey guys, 
>>
>> I'm seeing the following nonexistent form:
>>
>> [image: Capture.PNG]
>>
>> Nothing in the log (with level DEBUG) or in the apache error log.
>>
>> ReviewBoard 3.0.8 and ReviewBot 1.0.1
>>
>> Any ideas?
>>
>> -- 
>> 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 
>> "Review Board Community" 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.
>>
>
>
> -- 
> Christian Hammond
> President/CEO of Beanbag <https://www.beanbaginc.com/>
> Makers of Review Board <https://www.reviewboard.org/>
>

-- 
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 
"Review Board Community" 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.


ReviewBot configuration form nonexistent

2018-09-06 Thread Joshua Cannon
Hey guys, 

I'm seeing the following nonexistent form:

[image: Capture.PNG] 

Nothing in the log (with level DEBUG) or in the apache error log.

ReviewBoard 3.0.8 and ReviewBot 1.0.1

Any ideas?

-- 
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 
"Review Board Community" 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: Review Board Ticket #4533: Interdiffs are not working on some files

2018-08-14 Thread Joshua Cannon
--
To reply, visit https://hellosplat.com/s/beanbag/tickets/4533/
--

New update by besperon
For Beanbag, Inc. > Review Board > Ticket #4533


Reply:

I'm still seeing this when upgrading from 2.5 to 3.0 on a Perforce repo. 
Any updates on this? Also there seems to be Ticket #4625 and #4682 about the 
same thing.

-- 
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: Djblets Ticket #4723: Djblets should allow decorated methods to use exceptions for response errors

2018-07-19 Thread Joshua Cannon
--
To reply, visit https://hellosplat.com/s/beanbag/tickets/4723/
--

New update by jcannon
For Beanbag, Inc. > Djblets > Ticket #4723


Reply:

`decorators.py` is `djblets/webapi/decorators.py` and is just the relvant 
djblits module.
Example is:

```python
class MyResource(WebAPIResource):
   # ...
   @webapi_response_errors(INVALID_FORM_DATA)
   @webapi_request_fields(...)
   def create(self, data1, data2):
  data1 = self._helper(data1)
  data2 = self._helper(data2)
  return 201, {...}
  
   def _helper(self, data):
  if 'my_key' not in data:
 # I can't return the error here, or else the caller would
 # need to check for it.
 # It would be nice if I could raise ResponseError(INVALID, ...)
 # Or even better, rase InvalidFormData(...)
 error()
  return {...}
```

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


Djblets Ticket #4723: Djblets should allow decorated methods to use exceptions for response errors

2018-07-19 Thread Joshua Cannon
--
To reply, visit https://hellosplat.com/s/beanbag/tickets/4723/
--

New ticket #4723 by jcannon
For Beanbag, Inc. > Djblets

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


--
Djblets should allow decorated methods to use exceptions for response errors
==

# What version are you using?
master

# Which module(s) does this relate to?
decorators.py

# Describe the enhancement and the motivation for it.
I have a decorated method that might respond with some errors, but those errors 
are generated in a helper method. There's no natural way for me to write the 
helper method to return error-or-data.
The decorated method should be able to `raise djblets.ResponseError(err, info)` 
to mean error, and just return `info` (which it turns into `(201, info)`).

This would greatly improve the code flow of the decorated methods.

# Please provide any additional information below.


--

-- 
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: API Error 103 during ReviewBot 1.0 setup

2018-07-18 Thread Joshua Cannon
I just applied the patch 
(https://reviews.reviewboard.org/r/10080/diff/3/#index_header) and it 
worked like a charm!

On Tuesday, July 17, 2018 at 6:33:46 PM UTC-5, David Trowbridge wrote:
>
> Not yet, it’s still in the review process.
>
> -David 
>
> On Tue, Jul 17, 2018 at 5:27 PM Joshua Cannon  > wrote:
>
>> Does ReviewBot master have the fix?
>>
>> On Tue, Jul 17, 2018, 5:19 PM David Trowbridge > > wrote:
>>
>>> Hi,
>>>
>>> Some changes in Review Board 3.0.8 introduced this problem. It will be 
>>> fixed soon in Review Bot 1.0.1
>>>
>>> -David
>>>
>>> On Tue, Jul 17, 2018 at 3:49 PM Joshua Cannon >> > wrote:
>>>
>>>> I'm seeing a similar error and have yet to find out how to fix it.
>>>>
>>>> My stack trace is:
>>>> [2018-07-17 17:47:28,319: ERROR/MainProcess] ???[???]: Problem POSTing 
>>>> tools: You are not logged in (HTTP 401, API Error 103)
>>>> Traceback (most recent call last):
>>>>   File 
>>>> "/home/user/envs/worker/lib/python2.7/site-packages/reviewbot/tasks.py", 
>>>> line 289, in update_tools_list
>>>> api_tools.create(hostname=hostname, tools=json.dumps(tools))
>>>>   File 
>>>> "/home/user/envs/worker/lib/python2.7/site-packages/rbtools/api/resource.py",
>>>>  
>>>> line 181, in 
>>>> meth(resource, **kwargs)))
>>>>   File 
>>>> "/home/user/envs/worker/lib/python2.7/site-packages/rbtools/api/decorators.py",
>>>>  
>>>> line 27, in request_method
>>>> *args, **kwargs)
>>>>   File 
>>>> "/home/user/envs/worker/lib/python2.7/site-packages/rbtools/api/transport/sync.py",
>>>>  
>>>> line 77, in execute_request_method
>>>> return self._execute_request(request)
>>>>   File 
>>>> "/home/user/envs/worker/lib/python2.7/site-packages/rbtools/api/transport/sync.py",
>>>>  
>>>> line 86, in _execute_request
>>>> rsp = self.server.make_request(request)
>>>>   File 
>>>> "/home/user/envs/worker/lib/python2.7/site-packages/rbtools/api/request.py",
>>>>  
>>>> line 603, in make_request
>>>> self.process_error(e.code, e.read())
>>>>   File 
>>>> "/home/user/envs/worker/lib/python2.7/site-packages/rbtools/api/request.py",
>>>>  
>>>> line 577, in process_error
>>>> rsp['err']['msg'])
>>>> AuthorizationError: You are not logged in (HTTP 401, API Error 103)
>>>>
>>>> I'm running the master reviewboard server (devserver.py) with 
>>>> reviewbot-extension installed. Running master reviewboard-worker.
>>>>
>>>> Connection to broker happens just fine, but when I try to refresh the 
>>>> tools, it errors.
>>>>
>>>>
>>>> On Saturday, April 14, 2018 at 4:43:41 AM UTC-5, Hema wrote:
>>>>>
>>>>> I'm trying to setup ReviewBot 1.0 in ReviewBoard 3.0.3. It says 
>>>>> "Connected to broker" when the worker nodes are not started. But when I 
>>>>> start the worker nodes, it throws the following error.
>>>>>
>>>>> [2018-04-14 05:35:24,736: ERROR/MainProcess] ???[???]: Could not reach 
>>>>> RB server: You are not logged in (HTTP 401, API Error 103)
>>>>> Traceback (most recent call last):
>>>>>   File 
>>>>> "/opt/software/lib/python2.7/site-packages/reviewbot_worker-1.0-py2.7.egg/reviewbot/tasks.py",
>>>>>  
>>>>> line 280, in update_tools_list
>>>>> api_root = api_client.get_root()
>>>>>   File 
>>>>> "/opt/software/lib/python2.7/site-packages/RBTools-0.7.11-py2.7.egg/rbtools/api/client.py",
>>>>>  
>>>>> line 21, in get_root
>>>>> return self._transport.get_root(*args, **kwargs)
>>>>>   File 
>>>>> "/opt/software/lib/python2.7/site-packages/RBTools-0.7.11-py2.7.egg/rbtools/api/transport/sync.py",
>>>>>  
>>>>> line 47, in get_root
>>>>> return self._execute_request(HttpRequest(self.server.url))
>>>>>   File 
>>>>> "/opt/software/lib/python2.7/site-packages/RBTools-0.7.11-py2.7.egg/rbtools/api/transport/sync.py",
>>>>>  
>>>>> 

Re: API Error 103 during ReviewBot 1.0 setup

2018-07-17 Thread Joshua Cannon
Does ReviewBot master have the fix?

On Tue, Jul 17, 2018, 5:19 PM David Trowbridge  wrote:

> Hi,
>
> Some changes in Review Board 3.0.8 introduced this problem. It will be
> fixed soon in Review Bot 1.0.1
>
> -David
>
> On Tue, Jul 17, 2018 at 3:49 PM Joshua Cannon 
> wrote:
>
>> I'm seeing a similar error and have yet to find out how to fix it.
>>
>> My stack trace is:
>> [2018-07-17 17:47:28,319: ERROR/MainProcess] ???[???]: Problem POSTing
>> tools: You are not logged in (HTTP 401, API Error 103)
>> Traceback (most recent call last):
>>   File 
>> "/home/user/envs/worker/lib/python2.7/site-packages/reviewbot/tasks.py",
>> line 289, in update_tools_list
>> api_tools.create(hostname=hostname, tools=json.dumps(tools))
>>   File 
>> "/home/user/envs/worker/lib/python2.7/site-packages/rbtools/api/resource.py",
>> line 181, in 
>> meth(resource, **kwargs)))
>>   File 
>> "/home/user/envs/worker/lib/python2.7/site-packages/rbtools/api/decorators.py",
>> line 27, in request_method
>> *args, **kwargs)
>>   File "/home/user/envs/worker/lib/python2.7/site-packages/
>> rbtools/api/transport/sync.py", line 77, in execute_request_method
>> return self._execute_request(request)
>>   File "/home/user/envs/worker/lib/python2.7/site-packages/
>> rbtools/api/transport/sync.py", line 86, in _execute_request
>> rsp = self.server.make_request(request)
>>   File 
>> "/home/user/envs/worker/lib/python2.7/site-packages/rbtools/api/request.py",
>> line 603, in make_request
>> self.process_error(e.code, e.read())
>>   File 
>> "/home/user/envs/worker/lib/python2.7/site-packages/rbtools/api/request.py",
>> line 577, in process_error
>> rsp['err']['msg'])
>> AuthorizationError: You are not logged in (HTTP 401, API Error 103)
>>
>> I'm running the master reviewboard server (devserver.py) with
>> reviewbot-extension installed. Running master reviewboard-worker.
>>
>> Connection to broker happens just fine, but when I try to refresh the
>> tools, it errors.
>>
>>
>> On Saturday, April 14, 2018 at 4:43:41 AM UTC-5, Hema wrote:
>>>
>>> I'm trying to setup ReviewBot 1.0 in ReviewBoard 3.0.3. It says
>>> "Connected to broker" when the worker nodes are not started. But when I
>>> start the worker nodes, it throws the following error.
>>>
>>> [2018-04-14 05:35:24,736: ERROR/MainProcess] ???[???]: Could not reach
>>> RB server: You are not logged in (HTTP 401, API Error 103)
>>> Traceback (most recent call last):
>>>   File "/opt/software/lib/python2.7/site-packages/reviewbot_
>>> worker-1.0-py2.7.egg/reviewbot/tasks.py", line 280, in update_tools_list
>>> api_root = api_client.get_root()
>>>   File "/opt/software/lib/python2.7/site-packages/RBTools-0.7.11-
>>> py2.7.egg/rbtools/api/client.py", line 21, in get_root
>>> return self._transport.get_root(*args, **kwargs)
>>>   File "/opt/software/lib/python2.7/site-packages/RBTools-0.7.11-
>>> py2.7.egg/rbtools/api/transport/sync.py", line 47, in get_root
>>> return self._execute_request(HttpRequest(self.server.url))
>>>   File "/opt/software/lib/python2.7/site-packages/RBTools-0.7.11-
>>> py2.7.egg/rbtools/api/transport/sync.py", line 84, in _execute_request
>>> rsp = self.server.make_request(request)
>>>   File "/opt/software/lib/python2.7/site-packages/RBTools-0.7.11-
>>> py2.7.egg/rbtools/api/request.py", line 587, in make_request
>>> self.process_error(e.code, e.read())
>>>   File "/opt/software/lib/python2.7/site-packages/RBTools-0.7.11-
>>> py2.7.egg/rbtools/api/request.py", line 560, in process_error
>>> rsp['err']['msg'])
>>> AuthorizationError: You are not logged in (HTTP 401, API Error 103)
>>>
>>> Who do I get this error?
>>>
>> --
>> 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
>> "Review Board Community" 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/

Re: API Error 103 during ReviewBot 1.0 setup

2018-07-17 Thread Joshua Cannon
I'm seeing a similar error and have yet to find out how to fix it.

My stack trace is:
[2018-07-17 17:47:28,319: ERROR/MainProcess] ???[???]: Problem POSTing 
tools: You are not logged in (HTTP 401, API Error 103)
Traceback (most recent call last):
  File 
"/home/user/envs/worker/lib/python2.7/site-packages/reviewbot/tasks.py", 
line 289, in update_tools_list
api_tools.create(hostname=hostname, tools=json.dumps(tools))
  File 
"/home/user/envs/worker/lib/python2.7/site-packages/rbtools/api/resource.py", 
line 181, in 
meth(resource, **kwargs)))
  File 
"/home/user/envs/worker/lib/python2.7/site-packages/rbtools/api/decorators.py", 
line 27, in request_method
*args, **kwargs)
  File 
"/home/user/envs/worker/lib/python2.7/site-packages/rbtools/api/transport/sync.py",
 
line 77, in execute_request_method
return self._execute_request(request)
  File 
"/home/user/envs/worker/lib/python2.7/site-packages/rbtools/api/transport/sync.py",
 
line 86, in _execute_request
rsp = self.server.make_request(request)
  File 
"/home/user/envs/worker/lib/python2.7/site-packages/rbtools/api/request.py", 
line 603, in make_request
self.process_error(e.code, e.read())
  File 
"/home/user/envs/worker/lib/python2.7/site-packages/rbtools/api/request.py", 
line 577, in process_error
rsp['err']['msg'])
AuthorizationError: You are not logged in (HTTP 401, API Error 103)

I'm running the master reviewboard server (devserver.py) with 
reviewbot-extension installed. Running master reviewboard-worker.

Connection to broker happens just fine, but when I try to refresh the 
tools, it errors.


On Saturday, April 14, 2018 at 4:43:41 AM UTC-5, Hema wrote:
>
> I'm trying to setup ReviewBot 1.0 in ReviewBoard 3.0.3. It says "Connected 
> to broker" when the worker nodes are not started. But when I start the 
> worker nodes, it throws the following error.
>
> [2018-04-14 05:35:24,736: ERROR/MainProcess] ???[???]: Could not reach RB 
> server: You are not logged in (HTTP 401, API Error 103)
> Traceback (most recent call last):
>   File 
> "/opt/software/lib/python2.7/site-packages/reviewbot_worker-1.0-py2.7.egg/reviewbot/tasks.py",
>  
> line 280, in update_tools_list
> api_root = api_client.get_root()
>   File 
> "/opt/software/lib/python2.7/site-packages/RBTools-0.7.11-py2.7.egg/rbtools/api/client.py",
>  
> line 21, in get_root
> return self._transport.get_root(*args, **kwargs)
>   File 
> "/opt/software/lib/python2.7/site-packages/RBTools-0.7.11-py2.7.egg/rbtools/api/transport/sync.py",
>  
> line 47, in get_root
> return self._execute_request(HttpRequest(self.server.url))
>   File 
> "/opt/software/lib/python2.7/site-packages/RBTools-0.7.11-py2.7.egg/rbtools/api/transport/sync.py",
>  
> line 84, in _execute_request
> rsp = self.server.make_request(request)
>   File 
> "/opt/software/lib/python2.7/site-packages/RBTools-0.7.11-py2.7.egg/rbtools/api/request.py",
>  
> line 587, in make_request
> self.process_error(e.code, e.read())
>   File 
> "/opt/software/lib/python2.7/site-packages/RBTools-0.7.11-py2.7.egg/rbtools/api/request.py",
>  
> line 560, in process_error
> rsp['err']['msg'])
> AuthorizationError: You are not logged in (HTTP 401, API Error 103)
>
> Who do I get this error?
>

-- 
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 
"Review Board Community" 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: Flake8 always passes review

2018-07-03 Thread Joshua Cannon
I noticed that flake8 would "pass" if it internally errored. It has since 
been fixed (but not yet released)
See https://hellosplat.com/s/beanbag/tickets/4710/

On Friday, June 8, 2018 at 11:46:57 AM UTC-5, Peter Simms wrote:
>
> Seems it happens when I add a lot of different files and languages.
>
> So if I add just some python files it will work, but if I add a lot of 
> python, c++ and javascript, the cppchecks will fail with issues but flake8 
> and also jshint will pass even though it should fail.
>
> Is there a limit to the amount of files/languages that it will flag up 
> issues?
>
> It appears to be inconsistent when working with lots of different file 
> types.
>
> On Thursday, 7 June 2018 12:12:24 UTC+1, Peter Simms wrote:
>>
>> That was ticked, I am not sure how but it seems to have fixed itself, 
>> thank you for getting back to me
>>
>> On Tuesday, 5 June 2018 07:44:30 UTC+1, David Trowbridge wrote:
>>>
>>> Hi,
>>>
>>> In the integration configuration, did you select "Comment on unmodified 
>>> code"? If not, the errors will be filtered to include only those things 
>>> which occur in lines that are actually changed in the diff, which might be 
>>> nothing even if the file itself has a bunch of problems.
>>>
>>> -David
>>>
>>> On Mon, Jun 4, 2018 at 10:38 AM Peter Simms  wrote:
>>>
 Hi all,

 I have recently setup a test reviewboard server.  I am experimenting 
 with setting up reviewbot to run tests on posting a review.

 I am trying to get flake8 setup correctly, however it seems to always 
 pass, I know there are issues with the python files however it always 
 passes, I am not 100% on where to troubleshoot as the logs don't seem to 
 say anything.

 Can someone point me in the right direction as to why flake8 always 
 passes?

 Machine setup
 Centos 7
 Review Board 3.0.6

 -- 
 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 "Review Board Community" 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 
"Review Board Community" 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: Review Board Ticket #4712: Internal Error when getting status updates when a previous status update is error.

2018-07-03 Thread Joshua Cannon
--
To reply, visit https://hellosplat.com/s/beanbag/tickets/4712/
--

New update by jcannon
For Beanbag, Inc. > Review Board > Ticket #4712


Reply:

Attaching log


Files:
- reviewboard.log
  

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