-
Notifications
You must be signed in to change notification settings - Fork 91
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
Connections and Disconnect calls started to return 404 #103
Comments
Hey @saboter - the methods should still be returning the JSON in the exact same format so However they will now throw @simbiont123 are you experiencing the same? |
@saboter can you post the whole 404 stack trace? I'd maybe expect to see 401 but if SDK is producing "Not Found" i'd like to get that sorted asap.. |
Exception (body is empty):
Relevant stack trace lines:
The reason why our flow is broken is most probably because before without proper exception we handled the 404 simply like blank connection (no match to the auth event id). But why 404? OT: There is a typo in connections method comment.
|
"The reason why our flow is broken is most probably because before without proper exception we handled the 404 simply like blank connection (no match to the auth event id)." Taking back this part. When I rescued the 404 it still fails on missing "state" param which is not forwarded in case of 404. |
@saboter - Not sure I understand. I just released 2.5.1 which includes an optional state param to be passed through the authorization URL and subsequent callback.
A few more questions:
This might be a better case for [email protected] as we might just need to look through your specific app logs. What is your client ID? @simbiont123 are you also experiencing this? P.S. Thanks - I will fix |
@SerKnight Before the optional state param support we simply add it to at the end of authorization url string. Will try the new feature, but it should not change much in our case. The code which triggers the connection is equivalent of this:
It happens in callback handler where we need to get connections for freshly authorized client. The broken version was couple of hours in production and other API calls were working only ".connections" and ".disconnect" have problems. Will do some more debugging and then I will contact Xero Support or [email protected] directly. No public client ID disclosing :). Thank you. |
@SerKnight I have examined the request differences between 2.4.1 and 2.5.1 into detail and the reason for the 404 is malformed url:
During refactoring was omitted the fact that the call_api takes "path" not full url, it prefixes standard api url:
the full url added in path param is processed in this method, where it is also malformed
Some Xero Api endpoints are special, with different base url, which most probably the initial reason why they were implemented without call_api method. |
So the
The Are you using the I might need to add another test around this. Can you log what your |
@SerKnight Later in our code is accounting_api.get_organisations call. Need to test if it is the reason why the url is malformed. In general it is not very fortunate when the same instance of client can have the config altered with forwarded accounting_api call. |
Yea agreed. Let me know reality of test + I’ll recreate and get that fixed and well tested. |
We've just updated xero-ruby on our OAuth2 migration branch and we're also getting this issue, the rspec output demonstrates it best:
The code that triggers it: xero_client = XeroRuby::ApiClient.new(...)
token_set = xero_client.get_token_set_from_callback('code' => @code)
xero_client.set_token_set(token_set)
connections = xero_client.connections |
It's a little tricky to follow the implementation, but I think one of the issues might be that the config is actually shared between api client instances here. So in our case a different test might have mutated the global config (and changed the base_url), even though it was using a different client instance. @SerKnight could you comment if that is accurate/done intentionally? Thanks! |
Sorry, miss-clicked and closed the issue by accident :). |
This is related to the base url fix in the next release |
@SerKnight Thanks for this fix, we experienced this issue as well so are grateful for the fix, will upgrade to 2.6.0 shortly. |
Thanks @SerKnight but I'm still getting the same issue with 2.6.0 |
Hmm @matthieua - can you share an example of how you triggered the issue using 2.6.0? There might be some situations that we can improve in the specs for this. |
@SerKnight Sorry for the slow reply, this is what I get. I just tested it with 2.6.1 and still the same so I'm reverting back to 2.4.1 which works great. |
@SerKnight sorry to bother you but we're still getting this issue even with the latest release 2.7.0 :( |
Hey @matthieua not a bother at all. Can you share the whole method stack that is triggering this and your gemfile lock? Seeing the I can re-open this issue or we can start a new one. I wasn't able to reproduce really want to make sure you get it solved. |
Actually sorry to trouble but can you create a new issue with everything summarized? In addition the fastest way to get a bug triaged is if we can replicate it in the sample app - https://github.com/XeroAPI/xero-ruby-oauth2-app There are obviously different dependencies / setup in every system but that makes it clear in a stripped down app how to replicate. I've just tried with the recent version calling two separate API namespace that have a different base_urls and could not get SDK to trip. |
Hi,
some of the changes in 2.5 release had nasty side effects in our implementation (main suspect d022f37#diff-2b72dffc27d2b59e684003eedd40ff55294d501dc0b4efdb0a90e4cb60b7febb)
After upgrade strange "XeroRuby::ApiError: Error message: the server returns an error HTTP status code: 404" exceptions started to pop up.
We are able to reproduce them by simply connecting and disconnecting organizations. Downgrade to the 2.4.1 fixes the issue.
Our authorization simplified flow (callback part):
Any ideas what could be the root cause?
Thank you.
The text was updated successfully, but these errors were encountered: