HTTP 500 with rbt post and Perforce - object is unsubscriptable

280 views
Skip to first unread message

Jamie Penman-Smithson

unread,
Apr 11, 2014, 4:26:50 PM4/11/14
to revie...@googlegroups.com
Hi all,

I'm having problems using rbt post against ReviewBoard 1.7.24, RBTools 0.6 with Perforce 2013.3.

ReviewBoard and RBTools have been installed from RPMs on a RHEL 6 box.

$ rbt --version
RBTools 0.6

When posting a review (whether it's shelved or committed) I get a 500 HTTP error and in the Apache error log I'm getting:

[Fri Apr 11 20:12:15 2014] [error] ERROR:root:Exception thrown for user jamie.penman at http://reviews/api/review-requests/
[Fri Apr 11 20:12:15 2014] [error]
[Fri Apr 11 20:12:15 2014] [error] '1' object is unsubscriptable
[Fri Apr 11 20:12:15 2014] [error] Traceback (most recent call last):
[Fri Apr 11 20:12:15 2014] [error]   File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 111, in get_response
[Fri Apr 11 20:12:15 2014] [error]     response = callback(request, *callback_args, **callback_kwargs)
[Fri Apr 11 20:12:15 2014] [error]   File "/usr/lib/python2.6/site-packages/django/views/decorators/cache.py", line 89, in _wrapped_view_func
[Fri Apr 11 20:12:15 2014] [error]     response = view_func(request, *args, **kwargs)
[Fri Apr 11 20:12:15 2014] [error]   File "/usr/lib/python2.6/site-packages/django/views/decorators/vary.py", line 19, in inner_func
[Fri Apr 11 20:12:15 2014] [error]     response = func(*args, **kwargs)
[Fri Apr 11 20:12:15 2014] [error]   File "/usr/lib/python2.6/site-packages/djblets/webapi/resources.py", line 482, in __call__
[Fri Apr 11 20:12:15 2014] [error]     result = view(request, api_format=api_format, *args, **kwargs)
[Fri Apr 11 20:12:15 2014] [error]   File "/usr/lib/python2.6/site-packages/djblets/webapi/resources.py", line 692, in post
[Fri Apr 11 20:12:15 2014] [error]     return self.create(*args, **kwargs)
[Fri Apr 11 20:12:15 2014] [error]   File "/usr/lib/python2.6/site-packages/reviewboard/webapi/decorators.py", line 127, in _check
[Fri Apr 11 20:12:15 2014] [error]     return view_func(*args, **kwargs)
[Fri Apr 11 20:12:15 2014] [error]   File "/usr/lib/python2.6/site-packages/djblets/webapi/decorators.py", line 113, in _call
[Fri Apr 11 20:12:15 2014] [error]     return view_func(*args, **kwargs)
[Fri Apr 11 20:12:15 2014] [error]   File "/usr/lib/python2.6/site-packages/djblets/webapi/decorators.py", line 134, in _checklogin
[Fri Apr 11 20:12:15 2014] [error]     return view_func(*args, **kwargs)
[Fri Apr 11 20:12:15 2014] [error]   File "/usr/lib/python2.6/site-packages/djblets/webapi/decorators.py", line 113, in _call
[Fri Apr 11 20:12:15 2014] [error]     return view_func(*args, **kwargs)
[Fri Apr 11 20:12:15 2014] [error]   File "/usr/lib/python2.6/site-packages/djblets/webapi/decorators.py", line 113, in _call
[Fri Apr 11 20:12:15 2014] [error]     return view_func(*args, **kwargs)
[Fri Apr 11 20:12:15 2014] [error]   File "/usr/lib/python2.6/site-packages/djblets/webapi/decorators.py", line 283, in _validate
[Fri Apr 11 20:12:15 2014] [error]     return view_func(*args, **new_kwargs)
[Fri Apr 11 20:12:15 2014] [error]   File "/usr/lib/python2.6/site-packages/reviewboard/webapi/resources.py", line 7152, in create
[Fri Apr 11 20:12:15 2014] [error]     changenum, local_site)
[Fri Apr 11 20:12:15 2014] [error]   File "/usr/lib/python2.6/site-packages/reviewboard/reviews/managers.py", line 123, in create
[Fri Apr 11 20:12:15 2014] [error]     review_request.update_from_changenum(changenum)
[Fri Apr 11 20:12:15 2014] [error]   File "/usr/lib/python2.6/site-packages/reviewboard/reviews/models.py", line 409, in update_from_changenum
[Fri Apr 11 20:12:15 2014] [error]     changeset = self.repository.get_scmtool().get_changeset(changenum)
[Fri Apr 11 20:12:15 2014] [error]   File "/usr/lib/python2.6/site-packages/reviewboard/scmtools/perforce.py", line 314, in get_changeset
[Fri Apr 11 20:12:15 2014] [error]     return self.parse_change_desc(changeset[0], changesetid, allow_empty)
[Fri Apr 11 20:12:15 2014] [error] TypeError: '1' object is unsubscriptable
[Fri Apr 11 20:12:15 2014] [error] ERROR:django.request:Internal Server Error: /api/review-requests/

This seems to be due to a problem getting the changelist description. I've checked that the user I have provided to ReviewBoard for Perforce has read access to the repository.

I'm wondering if there is some compatibility issue with Django because I'm seeing other warnings in the log file:

... brokerAddress ->
... brokerVersion ->
... userName ->
... password ->
... clientName ->
... clientCwd ->
... clientHost ->
... peerAddress ->
... clientAddress ->
... serverName ->
... monitor ->
... serverAddress ->
... serverRoot ->
... serverDate ->
... serverUptime ->
... serverVersion ->
... ServerID ->
... serverServices ->
... serverLicense ->
... serverLicense-ip ->
... caseHandling ->
... integEngine ->
[Fri Apr 11 20:12:00 2014] [error] /usr/lib/python2.6/site-packages/django/contrib/auth/__init__.py:26: DeprecationWarning: Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in <class 'reviewboard.accounts.backends.LDAPBackend'>.
[Fri Apr 11 20:12:00 2014] [error]   DeprecationWarning)
[Fri Apr 11 20:12:00 2014] [error] /usr/lib/python2.6/site-packages/django/template/defaulttags.py:1235: DeprecationWarning: The syntax for the url template tag is changing. Load the `url` tag from the `future` tag library to start using the new behavior.
[Fri Apr 11 20:12:00 2014] [error]   category=DeprecationWarning)

According to yum we have Django 1.4 which I believe is the supported version...?

Has anyone come across this issue before?

Thanks very much,
Jamie

David Trowbridge

unread,
Apr 12, 2014, 2:46:48 AM4/12/14
to reviewboard
I've never seen anything like this before. Can you tell us what 'rbt' command-line you're running, and additionally add --debug to that and include the output?

-David


--
Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
---
Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
---
Happy user? Let us know at http://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.

Jamie Penman-Smithson

unread,
Apr 13, 2014, 3:59:21 PM4/13/14
to revie...@googlegroups.com
Hi David,


On Saturday, 12 April 2014 07:46:48 UTC+1, David Trowbridge wrote:
I've never seen anything like this before. Can you tell us what 'rbt' command-line you're running, and additionally add --debug to that and include the output?

On Fri, Apr 11, 2014 at 1:26 PM, Jamie Penman-Smithson <jpenman....@gmail.com> wrote:
Hi all,

I'm having problems using rbt post against ReviewBoard 1.7.24, RBTools 0.6 with Perforce 2013.3.

ReviewBoard and RBTools have been installed from RPMs on a RHEL 6 box.

$ rbt --version
RBTools 0.6


Here is the full output:

lo1-daor-fid-5{aoc}580: rbt post --target-groups=rti --debug 317291
>>> RBTools 0.6
>>> Python 2.6.6 (r266:84292, May 27 2013, 05:35:12) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)]
>>> Running on Linux-2.6.32-358.18.1.el6.x86_64-x86_64-with-redhat-6.4-Santiago
>>> Home = /data/aoc
>>> Current directory = /data/aoc/run/aoc/cfg
>>> Checking for a Subversion repository...
>>> Unable to execute "svn help": skipping SVN
>>> Checking for a Git repository...
>>> Unable to execute "git --help" or "git.cmd --help": skipping Git
>>> Checking for a Mercurial repository...
>>> Unable to execute "hg --help": skipping Mercurial
>>> Checking for a CVS repository...
>>> Unable to execute "cvs": skipping CVS
>>> Checking for a Perforce repository...
>>> Running: p4 info
>>> Running: diff --version
>>> repository info: Path: perforce1:9019, Base path: None, Supports changesets: True
>>> Running: p4 counters
>>> Making HTTP GET request to http://reviews/api/
>>> Making HTTP GET request to http://reviews/api/info/
Generating diff for shelved changeset 317291
>>> Processing edit of //depot/aoc_EngineBench.cfg
>>> Writing "//depot/aoc_EngineBench.cfg#2" to "/tmp/tmpxGVcSY"
>>> Running: p4 print -o /tmp/tmpxGVcSY -q //depot/aoc_EngineBench.cfg#2
>>> Writing "//depot/aoc_EngineBench.cfg@=317291" to "/tmp/tmpAL13a9"
>>> Running: p4 print -o /tmp/tmpAL13a9 -q //depot/aoc_EngineBench.cfg@=317291
>>> Running: diff -urNp /tmp/tmpxGVcSY /tmp/tmpAL13a9
>>> Command exited with rc 1: ['diff', '-urNp', '/tmp/tmpxGVcSY', '/tmp/tmpAL13a9']
--- /tmp/tmpxGVcSY      2014-04-12 10:37:27.522514169 +0100
+++ /tmp/tmpAL13a9      2014-04-12 10:37:27.549514168 +0100
@@ -1,4 +1,6 @@
 EngineBench
 {
     delayMs 500
+
+    itemNames   ( L1, ORDER, SNAPSHOT, TIME )
 }
---
>>> Making HTTP GET request to http://reviews/api/review-requests/
>>> Making HTTP POST request to http://reviews/api/review-requests/

==> HTTP Authentication Required
Enter authorization information for "Web API" at reviews
Username: jamie.penman
Password: 
>>> Got HTTP error: 500: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>500 - Internal Server Error | Review Board</title>
 </head>
 <body>
  <h1>Something broke! (Error 500)</h1>
  <p>
   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.
  </p>
 </body>
</title>

Traceback (most recent call last):
  File "/usr/local/fidessa/bin/rbt", line 9, in <module>
    load_entry_point('RBTools==0.6', 'console_scripts', 'rbt')()
  File "/data/aoc/.local/lib/python2.6/site-packages/rbtools/commands/main.py", line 134, in main
    command.run_from_argv([RB_MAIN, command_name] + args)
  File "/data/aoc/.local/lib/python2.6/site-packages/rbtools/commands/__init__.py", line 422, in run_from_argv
    exit_code = self.main(*args) or 0
  File "/data/aoc/.local/lib/python2.6/site-packages/rbtools/commands/post.py", line 769, in main
    submit_as=self.options.submit_as)
  File "/data/aoc/.local/lib/python2.6/site-packages/rbtools/commands/post.py", line 503, in post_request
    raise CommandError("Error creating review request: %s" % e)
rbtools.commands.CommandError: Error creating review request: HTTP 500

From Apache:

[...]
  File "/usr/lib/python2.6/site-packages/reviewboard/reviews/managers.py", line 123, in create
    review_request.update_from_changenum(changenum)
  File "/usr/lib/python2.6/site-packages/reviewboard/reviews/models.py", line 409, in update_from_changenum
    changeset = self.repository.get_scmtool().get_changeset(changenum)
  File "/usr/lib/python2.6/site-packages/reviewboard/scmtools/perforce.py", line 314, in get_changeset
    return self.parse_change_desc(changeset[0], changesetid, allow_empty)
TypeError: '1' object is unsubscriptable

It appears to be failing to get the changelist information, line 314 is part of get_changeset:

    def get_changeset(self, changesetid, allow_empty=False):
        changeset = self.client.get_changeset(changesetid)
        if changeset:
            return self.parse_change_desc(changeset[0], changesetid, allow_empty)
        else:
            return None

In case it helps, here are the versions of Apache and mod_wsgi that we're running:

[Sat Apr 12 03:42:57 2014] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_wsgi/3.2 Python/2.6.6 configured -- resuming normal operations

Name        : ReviewBoard
Arch        : noarch
Version     : 1.7.24
Release     : 1.el6
Size        : 11 M
Repo        : installed
From repo   : /ReviewBoard-1.7.24-1.el6.noarch

Name        : RBTools
Arch        : noarch
Version     : 0.6
Release     : 1.el6
Size        : 970 k
Repo        : installed
From repo   : /RBTools-0.6-1.el6.noarch

We were running P4Python 2013.1, I've just updated to 2014.1 but still get the same error

$ python -c "from P4 import P4; print P4.identify()"
Rev. P4PYTHON/LINUX26X86_64/2014.1/812584 (2014.1/807760 API) (2014/03/25).

Thanks very much,
Jamie

Jamie Penman-Smithson

unread,
Apr 15, 2014, 6:06:55 AM4/15/14
to revie...@googlegroups.com


On Friday, 11 April 2014 21:26:50 UTC+1, Jamie Penman-Smithson wrote:
I'm having problems using rbt post against ReviewBoard 1.7.24, RBTools 0.6 with Perforce 2013.3.

ReviewBoard and RBTools have been installed from RPMs on a RHEL 6 box.


It turns out this was a compatibility problem with P4Python. Downgrading to P4Python 2012.2 resolves the issue.

Thanks,
Jamie 
Reply all
Reply to author
Forward
0 new messages