Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Response #37

Closed
ghost opened this issue Feb 6, 2023 · 15 comments
Closed

Invalid Response #37

ghost opened this issue Feb 6, 2023 · 15 comments

Comments

@ghost
Copy link

ghost commented Feb 6, 2023

After plugging in the settings information; logs are showing the following:

Invalid response
GET request to "https://git.xxx/a/changes
GET request to "https://git.xxx/a/accounts/self"
GET request to "https://git.xxx/a/changes


Invalid response
HTTPError: Response code 404 (Not Found) 404 [object Object] Not found: xxx

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?

@SanderRonde
Copy link
Owner

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?

@ghost
Copy link
Author

ghost commented Feb 6, 2023

Thank you for responding.

Unfortunately no, I receive the same fetching issues.

@SanderRonde
Copy link
Owner

What happens if you try it in your browser? So going to https://git.xxx/config/server/version? Does it find the version JSON?

@ghost
Copy link
Author

ghost commented Feb 6, 2023

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.

@SanderRonde
Copy link
Owner

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.

@ghost
Copy link
Author

ghost commented Feb 6, 2023

They are, unfortunately.

@SanderRonde
Copy link
Owner

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.

@ghost
Copy link
Author

ghost commented Feb 6, 2023

Will get back to you on this.

@ghost
Copy link
Author

ghost commented Feb 8, 2023

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

@SanderRonde
Copy link
Owner

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 works
  • https://{url}/a/accounts/self does not work

Because 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.

@ghost
Copy link
Author

ghost commented Feb 8, 2023

That is correct:

/config/server/version works and returns json
/a/config/server/version returns Not Found

@SanderRonde
Copy link
Owner

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?

@ghost
Copy link
Author

ghost commented Feb 8, 2023

Will check with my admin.

@ghost
Copy link
Author

ghost commented Feb 9, 2023

Unfortunately due to the plugin we are using, we can't use this as intended.

davido/gerrit-oauth-provider#84

I appreciate your time. I am going to close this out.

@ghost ghost closed this as completed Feb 9, 2023
@SanderRonde
Copy link
Owner

Ah that's unfortunate. Glad you were able to figure out what caused the issue though :)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant