4575: RB crash when trying to raise new review request on small mercurial repository

seb
chipx86
chipx86

What version are you running?

2.5.15

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

http://reviewboard.taitradio.net/r/new/

What steps will reproduce the problem?

  1. Go to the above URL
  2. Select repository

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

I expect to be presented with a list of recent commits in that repository.
Instead I get the following message where normally the list is displayed:

There was an error loading information from this repository:
HTTP 500 Internal Server Error
This may be a temporary failure. Try again

What operating system are you using? What browser?

Ubuntu 16.04.3 LTS
Chrome 60.0.3112.101-1

Please provide any additional information below.

I also get the attached stack trace sent via email.

Traceback (most recent call last):
  File "/home/reviewboard/.venv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/reviewboard/.venv/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 52, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/home/reviewboard/.venv/local/lib/python2.7/site-packages/django/views/decorators/vary.py", line 19, in inner_func
    response = func(*args, **kwargs)
  File "/home/reviewboard/.venv/local/lib/python2.7/site-packages/djblets/webapi/resources/base.py", line 199, in __call__
    request, method, view, api_format=api_format, *args, **kwargs)
  File "/home/reviewboard/.venv/local/lib/python2.7/site-packages/djblets/webapi/resources/mixins/api_tokens.py", line 65, in call_method_view
    return view(request, *args, **kwargs)
  File "/home/reviewboard/.venv/local/lib/
seb
#1 seb

Blimey, I forgot to mention the most important bit: The repository has only 3 commits in it. That is the only thing that sets it apart from a number of others we have on the same server that all work fine.

chipx86
#2 chipx86

Yeah, it looks to be related to that fact. The pagination code is assuming a parent commit always exists. Easy to fix.

David, got time to poke at this?

  • -New
    +Confirmed
  • +Release-2.5.x
  • +EasyFix
    +SCM:Mercurial
  • +david
chipx86
#3 chipx86

Hi Sebastian,

What version of Mercurial do you have both for the server and for the client on the Review Board server?

Would you by chance be able to provide the output of git log --template json ? I specifically need to know the last entry. You can replace any confidential text. I just need the fields, SHAs, and the basic structure of the thing.

  • -Confirmed
    +NeedInfo
  • -david
    +chipx86
seb
#4 seb

Mhmm, git log? We were talking about mercurial repositories here. So I'll just pretend that you asked for hg log --template json. However, that makes little sense (to me), since hg log only works on local repositories and there's no local repository involved here?!

So overall I'm confused as to what information you are asking for exactly.

seb
#5 seb

However, I can at least answer the version question:
Locally, reviewboard is using a pip-installed HG client version 4.3.1.
On the server, we run mercurial 3.7.3 but with the json templates from https://www.mercurial-scm.org/repo/hg/file/96eaefd350ae/mercurial/templates/json

seb
#6 seb

In case this was what you were asking for:

curl 'http://hg.terminals.taitradio.net:8005/SLA/SoftwareCodecModule/shortlog?style=json'

resulted in (pretty printed):

{
  "node": "a16fd06a825e5ad8d48dfc639adf65be8984b7bb",
  "changeset_count": 3,
  "changesets": [
    {
      "node": "a16fd06a825e5ad8d48dfc639adf65be8984b7bb",
      "date": [
        1500865172,
        -43200
      ],
      "desc": "New import received via Alfresko (lib-c-scm-21072017.tgz)",
      "branch": "default",
      "bookmarks": [],
      "tags": [
        "tip"
      ],
      "user": "Sebastian Unger <sebastian.unger@taitradio.com>",
      "phase": "public",
      "parents": []
    },
    {
      "node": "3c417750f20d386f33342cf39691d736132a4eca",
      "date": [
        1487305260,
        -46800
      ],
      "desc": "scm_170217_1721.tgz received from Nathalie on 22/02/2017",
      "branch": "default",
      "bookmarks": [],
      "tags": [],
      "user": "Sebastian Unger <sebastian.unger@taitradio.com>",
      "phase": "public",
      "parents": []
    },
    {
      "node": "6ddc11e651982210b0d543345a18f3664cc868a4",
      "date": [
        1485830130,
        -46800
      ],
      "desc": "Initial interface draft (v0.1) received from Brett Moser via Nathalie Giraudon.",
      "branch": "default",
      "bookmarks": [],
      "tags": [],
      "user": "Sebastian Unger <sebastian.unger@taitradio.com>",
      "phase": "public",
      "parents": []
    }
  ]
}
chipx86
#7 chipx86

Sorry, I definitely meant hg log, not git log. I was jumping between a few support incidents while replying to this ticket.

Some people host Mercurial on the same server accessed by Review Board, or at least accessible over the network. I was just making a bad assumption (see aforementioned distraction due to support incidents).

The information you provided is perfect. I'm a bit mystified as to why nothing has a parent listed... Strange. That doesn't really seem right. We can try working around that, but this seems more like an upstream bug at this point.

seb
#8 seb

No worries. I know the feeling of working on too many things at the same time myself.
I think it is normal for mercurial not to list the parent if there is only one and it is the preceding changeset in revision order. Although I am a bit surprised why it is showing the 'parents' array at all in that case.

misery
#9 misery

does it still happen with RB 3.0.5?

seb
#10 seb

Hi, sorry, I seem to not have been subscribed to this issue (and cannot subscribe now either), but I just retested it on 3.0.11 and that seemed to work. I don't have a repo with only three commits anymore, but I had one that I could still scroll all the way to the bottom and nothing crashed. I think this is fixed.