Closed ghost closed 1 year ago
The url you should use here is the url of the web version since it uses the HTTP API. Does it work if you try that?
Thank you for responding.
Unfortunately no, I receive the same fetching issues.
What happens if you try it in your browser? So going to https://git.xxx/config/server/version
? Does it find the version JSON?
Yes it does, reports 3.7.0
I am using ssh auth, but I added an http password for my account. Could that be causing issues? I noticed that was a previously stated issue.
What is odd is when I follow the link in the logs and use it in the web, it works. It fetches a change from one of our default repos.
This extension only communicates using the HTTP API. This might just mean that your credentials aren't configured correctly. When using it on web it'll just use your browser's authentication token (in the cookies) and so it works. Just ensure your username and password are properly set.
They are, unfortunately.
Can you maybe test the username/password combination in something like Postman? As authentication the API requires the Authorization
token to be set to Basic: ${base64encode(username + ':' + password)}
. Then try querying something like https://git.xxx/a/changes/
(note the trailing slash that must be there). Then we can rule out whether it's the extension itself or somehow the API connection.
Will get back to you on this.
Maybe I just don't understand how this works, but it is querying /a/changes/xx/detail/ which does not exist. When I go to that page in the browser nothing happens.
HTTPError: Response code 400 (Bad Request) 400 [object Object] Unrecognized value: ignored
Failed to fetch changes with filters for panel "CCed on" Status code = 400 response body = "Unrecognized value: ignored
When you say nothing happens do you mean you get an error 404 or something? A URL of that form should work in the browser just fine and should have you download some JSON (again double check the trailing slash). Every GET request in the logs should also work fine in the browser. If it doesn't work, there's likely something wrong with either the target URL or maybe somehow the REST API was disabled (not sure if that's even possible). So is the following correct?:
https://{url}/config/server/version
workshttps://{url}/a/accounts/self
does not workBecause that would make me lean towards the REST API somehow being disabled. I'm wondering what happens when you visit https://{url}/a/config/server/version
.
The error 400 should be fixed in the latest version of the extension (1.2.11). This is related to a filter that was deprecated in Gerrit 3.7.0.
That is correct:
/config/server/version
works and returns json
/a/config/server/version
returns Not Found
Ah so I guess authenticated REST requests are disabled on your server instance then. I'm not entirely sure as to what's causing it since I'm not a gerrit expert but it might be the auth.gitBasicAuthPolicy
setting in the config. That says something about the REST API. Could it be that?
Will check with my admin.
Unfortunately due to the plugin we are using, we can't use this as intended.
https://github.com/davido/gerrit-oauth-provider/issues/84
I appreciate your time. I am going to close this out.
Ah that's unfortunate. Glad you were able to figure out what caused the issue though :)
After plugging in the settings information; logs are showing the following:
Additionally if I put in the login url rather than the base url of our gerrit server, it prints the html of the login page in the logs. Any ideas here?