3625: Bad error message when trying to create a duplicate repository via REST API 2.0

z*@zakj***** (Google Code) (Is this you? Claim this profile.)
david
david
Jan. 17, 2015
What version are you running?

2.0.6

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

POST /api/repositories/

What steps will reproduce the problem?

1. try to create a repository via REST API 2.0 with already used path

```curl -X POST -H 'Cookie: rbsessionid=<session-cookie>' -F 'name=testrepo' -F 'tool=Git' -F 'path=git@github.com:organization/repository.git' https://review.localhost/api/repositories/```

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

an error message like in GUI "A repository with this path already exists"

but I receive 500 Internal Server Error response, and in logs I can see:

  File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.6-py2.6.egg/reviewboard/webapi/resources/repository.py", line 358, in create
    e.params['field']: e.message,
AttributeError: 'ValidationError' object has no attribute 'params'

What operating system are you using? What browser?

irrelevant
david
#1 david
  • +EasyFix
    +Component-WebUI
  • +Bad error message when trying to create a duplicate repository via REST API 2.0
david
#2 david
  • -Component-WebUI
    +Component-API
#3 sorin.*******@gmai***** (Google Code) (Is this you? Claim this profile.)
Quite and ugly user experience, as they have the impression that the server installation is broken.
#4 sorin.*******@gmai***** (Google Code) (Is this you? Claim this profile.)
This bug is still present in trunk https://github.com/reviewboard/reviewboard/blob/master/reviewboard/webapi/resources/repository.py#L358
#5 sorin.*******@gmai***** (Google Code) (Is this you? Claim this profile.)
Here is a pull request for this: https://github.com/reviewboard/reviewboard/pull/31 -- it would be so nice if you would gut drop this issue tracker and use github instead, so we would have a proper integration.

Google code was great when it was released but its time has gone.
david
#6 david
I agree that Google Code is long in the tooth, but GitHub issues isn't really a good match for our workflow. We also couldn't migrate to it without sending several thousand e-mails to hundreds (or thousands) of people. We're investigating bug tracker options but it's not a super high priority task.
#7 z*@zakj***** (Google Code) (Is this you? Claim this profile.)
Sorin, thanks for quick fixing this bug!

What is status of it? I can see the pull request was closed, but I can't find if it was commited to official source code.
david
#8 david
  • +PendingReview
  • -EasyFix
  • +david
david
#9 david
Fixed in release-2.0.x (47cd8fa). Thanks!
  • -PendingReview
    +Fixed
#10 craig******@citri***** (Google Code) (Is this you? Claim this profile.)
When is the next 2.0.x release?
chipx86
#11 chipx86
There's a couple patches we're still working to get in for 2.0.13. Maybe next week? Week after at the latest.

You can apply the change to your tree if it's blocking you.

We also supply custom builds with backported patches on demand, along with other benefits, for companies that have support contracts with us. We'd be happy to talk to you about what we offer in more detail (sales@beanbaginc.com) if interested.