4737: Adding Gitlab Repository fails with Gitlab 11.x

mckownam
4755

What version are you running?

I have tested this with Reviewboard 3.0.6 - 3.0.8 and it always fails with the same error about being incapable of identifying the Gitlab API version that is being used by our Gitlab 11.0 CE Server (privately-hosted).

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

https://reviewboardServername.com/reviewboard/admin/db/scmtools/repository/add/

What steps will reproduce the problem?

  1. Log into Reviewboard as an Admin and go to the Add Repository page
  2. Name the repository and set the Hosting Service as "GitLab"
  3. Under Account: add new service account with your custom service URL (pointing to https://private-CE-gitlabServer.com) with the account username and it's API token (token was created with full API privileges within Gitlab)
  4. Set the repostiory plan as Group and enter in the gitlab group and repository names.
  5. Click the Save button to save the new repository.
  6. Instead of saving the repository, server will display an error about being unable to determine the Gitlab API version.

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

When pressing the save button, it is expected that Reviewboard will just save the repository.

Instead it throws an error saying that it is unable to determine the Gitlab API version.

Error in browser:
Unknown error when linking the account: Unexpected error "Could not determine GitLab API version for "https://private-CE-gitlabServer.com"". The details of the failure are in the Review Board log file.

From ReviewBoard log file:
2018-09-04 18:24:36,501 - ERROR - - root - Unexpected error when linking GitLab account for [username]: Could not determine GitLab API version for "https://private-CE-gitlabServer.com"
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/ReviewBoard-3.0.6-py2.7.egg/reviewboard/hostingsvcs/gitlab.py", line 338, in authorize
credentials['private_token'].encode('utf-8'),
File "/usr/lib/python2.7/site-packages/ReviewBoard-3.0.6-py2.7.egg/reviewboard/hostingsvcs/gitlab.py", line 1262, in _try_api_versions
errors,
GitLabAPIVersionError: Could not determine GitLab API version for "https://private-CE-gitlabServer.com"

What operating system are you using? What browser?

Reviewboard Server is Centos 7 x64 and the browsers tested have been Firefox and Chrome. Also the Reviewboard server is running Python 2.7, which is the latest supported version of python on Centos 7.

Please provide any additional information below.

I have tried to get this to work across several Gitlab servers (our sandbox and production servers, both of which are running Gitlab CE 11.0.5), with multiple different repositories, and with different users, but the error about being unable to determine the GitLab API version is always the same.

mckownam
#1 mckownam

Update: The 3.0.8 version of the reviewboard error in the error log is as follows (debug level):

2018-09-13 13:27:18,776 - ERROR - - root - Unexpected error when linking GitLab account for [username]: Could not determine GitLab API version for "https://private-CE-gitlabServer.com"
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/ReviewBoard-3.0.8-py2.7.egg/reviewboard/hostingsvcs/gitlab.py", line 338, in authorize
credentials['private_token'].encode('utf-8'),
File "/usr/lib/python2.7/site-packages/ReviewBoard-3.0.8-py2.7.egg/reviewboard/hostingsvcs/gitlab.py", line 1262, in _try_api_versions
errors,
GitLabAPIVersionError: Could not determine GitLab API version for "https://private-CE-gitlabServer.com"
2018-09-13 13:27:18,777 - ERROR - - root - Unknown error linking hosting account ID=None for hosting service='gitlab', username=u'[username]', LocalSite=None
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/ReviewBoard-3.0.8-py2.7.egg/reviewboard/hostingsvcs/forms.py", line 407, in authorize
kwargs)
File "/usr/lib/python2.7/site-packages/ReviewBoard-3.0.8-py2.7.egg/reviewboard/hostingsvcs/gitlab.py", line 359, in authorize
ugettext('Unexpected error "%s"') % e)
HostingServiceError: Unexpected error "Could not determine GitLab API version for "https://private-CE-gitlabServer.com""
2018-09-13 13:27:18,778 - ERROR - - root - Unexpected error when linking hosting service account on gitlab: Unexpected error "Could not determine GitLab API version for "https://private-CE-gitlabServer.com""
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/ReviewBoard-3.0.8-py2.7.egg/reviewboard/scmtools/forms.py", line 707, in _clean_hosting_info
trust_host=self.cleaned_data['trust_host'])
File "/usr/lib/python2.7/site-packages/ReviewBoard-3.0.8-py2.7.egg/reviewboard/hostingsvcs/forms.py", line 368, in save
authorize_kwargs)
File "/usr/lib/python2.7/site-packages/ReviewBoard-3.0.8-py2.7.egg/reviewboard/hostingsvcs/forms.py", line 407, in authorize
**kwargs)
File "/usr/lib/python2.7/site-packages/ReviewBoard-3.0.8-py2.7.egg/reviewboard/hostingsvcs/gitlab.py", line 359, in authorize
ugettext('Unexpected error "%s"') % e)
HostingServiceError: Unexpected error "Could not determine GitLab API version for "https://private-CE-gitlabServer.com""

  • -Adding Gitlab Repository fails with Gitlab 11.x
    +Adding Gitlab Repository fails with Gitlab 11.x
chipx86
#3 chipx86

Added improved error information (containing possible solutions) to diagnose failures on release-3.0.x (b7fb9cf78f10962215f22d3a552c11f23e49d987).