What version are you running?
The problem was not present in 2.5.8
What's the URL of the page containing the problem?
What steps will reproduce the problem?
- Click create new request
- Select a mercurial repository (subversion repos are fine)
What is the expected output? What do you see instead?
On the web page I see:
There was an error loading information from this repository:
HTTP 500 Internal Server Error
This may be a temporary failure. Try again
I also get an email the content of which I have attached.
Reviewboard does not crash, but the post from commit functionality obviously does not work.
What operating system are you using? What browser?
Ubuntu Xenial with updates
Chrome + FF
Please provide any additional information below.
Very likely related to https://hellosplat.com/s/beanbag/tickets/4032/
BTW, pip freeze --local outputs:
Would you mind gathering some information from your Mercurial repository for me?
First, what version of Mercurial are you running?
Can you look up the repository path for it and, in a browser, navigate to:
(I believe that's the path it's looking up in this case -- may need to try with different values inside the
Can you then provide the output? If this repository contains confidential information, perhaps you could show the entry for some innocuous commit. You can also mark your attachment as private by clicking the lock icon at the top of your post when replying.
- New + NeedInfo
- Priority:Medium + Component:HostingServices + Priority:High + SCM:Mercurial
On the HG server we are running mercurial 3.7.3-1ubuntu1.
RB itself (the client) uses (I believe) the pip installed version in the venv. Pip shows that as being at 4.1.
I created a new TestRepo on our server, added a single test commit to it, added the repo to RB and confirmed the same behaviour.
Going to the path you showed with a browser results in:
"mode": "revset expression search",
"date": [1487809516.0, -46800],
"desc": "A test file",
"user": "Sebastian Unger \firstname.lastname@example.org\u003e"
The new code here isn't properly falling back in the case where an older version of Mercurial is installed. We'll need to update things to either turn off support for Mercurial < 3.9 or, ideally, aim to support older versions.
Looks like the contribution we have only supported 3.9+ because it needed data for the parent commit for each commit returned in the log, which older versions don't support. However, we work around this for other hosting services by defaulting to using the parent for the previous/next commit in the list (depending on results ordering) and reducing the number of results by 1, which we can probably do here. Also, they seem to have renamed
I'll see if someone can work on a patch for this for the next release.
- NeedInfo + Confirmed
Let me know if you need any further info.
Is it possible to switch the hgweb path in your repository configuration to a local file path?
Mercurial 3.9 is required for hgweb only on the "repository hosting"-server. How do you serve your hg repositories?
Could you paste your used URL of the json output?
Interestingly, we already have locally modified stylesheets. In particular I had already patched the json style to implement the search API for a different use case. So it was fairly straight-forward to take the JSON template from https://www.mercurial-scm.org/repo/hg/file/tip/mercurial/templates/json/map and drop it into place in our server. I did have to patch it a little since the utf8 filter isn't available in 3.7.
I can confirm that json search works (now looking slightly different from my implementation, but that's ok) using a browser. The output of the log url above however has not changed. The full URL btw was:
http://hg.terminals.taitradio.net:8005/TTDE/TestRepo/json-log/?rev=branch(.) which of course is not accessible from outside our intranet.
However, none of this has changed the behaviour of RB. I suspect because, looking at the original RB back-trace, RB is accessing HG using something like the RL parameter ?api_format=json which as far as I can tell has no effect on my mercurial 3.7. What's the difference between api_format=json and style=json? Because the latter does work.
Upgrading the mercurial server would be a much bigger job then patching the templates.
Thanks for your information!
I can reproduce your stacktrace here with a local virtualenv with Mercurial 3.7.3.
But if I try "json-log/?rev=branch(.)" directly in the browser I get a "not yet implemented" as it is not Mercurial 3.9 or above. I cannot see how do you get the JSON structure from above. Is this your custom implementation of json style!?
Do you have your changes to Mercurial as patch?
The URL with "api_format=json" is a ReviewBoard call. This isn't the call to hgweb... if you enable the log level "INFO" on reviewboard you can see the real hgweb call like this:
2017-02-24 08:19:11,406 - DEBUG - - Initialized HgWebClient with url=u'http://localhost:8000/', username=u''
2017-02-24 08:19:11,406 - INFO - - Fetching file from http://localhost:8000/json-log/?rev=ancestors(cef139d5adc0fd512f8e62dd802a174c749ec1cc)+and+branch(default)
Re json style log/search: As mentioned above, I just replaced the json style map with the one downloaded from https://www.mercurial-scm.org/repo/hg/file/96eaefd350ae/mercurial/templates/json and removed all occurrences of the string 'utf8|'.
Re apt_format: I see. Using a similar URL to the one from the INFO line in your log I get:
"query": "ancestors(default) and branch(default)",
"date": [1487926384.0, -46800],
"desc": "A second test commit",
"user": "Sebastian Unger \email@example.com\u003e",
"date": [1487809516.0, -46800],
"desc": "A test file",
"user": "Sebastian Unger \firstname.lastname@example.org\u003e",
I assume the quick-fix will just prevent the error, right? If we can get this json-style to work, will the quick-fix allow the use of the new post-from-commit functionality with 3.7? Because it is really useful.
I left a few comments on the review you posted. Feel free to ignore them if I don't make sense. Since I've never looked at the RB code before it is likely due to me not knowing what I'm talking about.
Anyhow, I'm off to bed. Have a good weekend and thanks for looking into this.
Ok, I updated the "quickfix".
I patched a 3.7.3 with /templates/json from current stable branch of Mercurial and removed |utf8 and it works here.
So yeah, the quickfix will recognize if you patch an old version.
By the way... maybe you want to try my "pre-commit" hook of https://reviews.reviewboard.org/r/8554/ instead of a "post-commit". :-)
is it fixed for you? :-)
Our RB is still at 2.5.9. Has a new version been released?
Ok, I'm really confused now. I just had another look at our (2.5.9) RB instance and it is now showing the create-from-commit part of the create new review request but only on some (ok, most) of our mercurial repositories. One (in particular the TestRepo I created so I can experiment with this) is still generating the "internal error" message and email. This begs two questions:
- What's different about the TestRepo from all the other ones? (The only thing I can come up with is: It only has two commits in it, whereas all others have 1000's)
- I thought the quick-fix above was needed to achieve this? If so, how the hack does it work with 2.5.9? Or is the quickfix only needed to not generate an exception when running with an old and unpatched mercurial server, but since I have patched the HG server the stock 2.5.9 now works?
Can anybody cure some of my confusion?
Having the result of that request from both working and non-working servers will help. I don't know off-hand why it'd only be working on some... What version of hgweb is being used on each?
Well, I don't know your infrastructure. :-)
- If you patched Mercurial... it will work
- If you updated Mercurial to 3.9 or higher.... it will work
- If you use Mercurial lower than 3.9 AND use local repositories (no hgweb) ... it will work
- If you use Mercurial lower than 3.9 and use my fix... it won't work. But do not show any "error".
By the way... "Mercurial" means "Repository-Hosting-Server-Mercurial".
Fixed in release-2.5.x (8eba94c). This will ship in 2.5.10. Thanks!
- Confirmed + Fixed