Closed the-bass closed 9 months ago
Hi @the-bass can I just double check -- you were previously using v7.8.2 of the SDK and you are now using 7.18.0 (the latest version)? ~Did you start experiencing the issues after you updated to the latest version?~ That's quite a few versions in between, but they've all been minor releases, so there shouldn't be any breaking changes.
Can you also let me know how you're instantiating the Client
object? (i.e. which params you're passing into the Vonage::Client.new
method invocation? -- I don't need the actual values, just would be useful to know which params you're setting on the Client
object).
Edit: sorry, just noticed that you said updating to the latest version fixed the issue. Difficult to tell at this stage what the root cause was, but it could be due to issue with JWT token parsing, for which I released a bug fix in the Ruby JWT library (which is a dependency of the Ruby SDK).
Hi @superchilled!
you were previously using v7.8.2 of the SDK and you are now using 7.18.0 (the latest version)?
That's correct.
Can you also let me know how you're instantiating the Client object?
I do
Vonage::Client.new(
api_key: apiKey,
api_secret: apiSecret,
application_id: applicationId,
private_key: File.read(privateKeyPath),
)
Thanks for your response!
Hi @the-bass. So, the Client
instantiation looks fine. Calling a method on the Voice
object will create a JWT using the application_id
and private_key
, so the api_key
and api_secret
aren't technically required in this case (although setting them in the Client
shouldn't affect anything).
I'm not 100% sure what the issue is tbh. As far as I know there haven't been any changes to the Voice API or to the API Gateway. I'll do a few tests and see if I can replicate the issue.
Quick question: did you regenerate your private key at any point, or are you using the same one both before and after the issue occurred?
Quick question: did you regenerate your private key at any point, or are you using the same one both before and after the issue occurred?
@superchilled One of the first things I tried with the Vonage app I am using for development was creating a new private key, but that hadn't any effect. After updating the gem, it started working again for both, the development app as well as the production app, where the private key is still the same it has always been.
@the-bass I've carried out some tests of the Vonage::Voice#create
method, using a few different versions of the Gem (including 7.8.2
), but have been unable to replicate the issue that you experienced. In all cases, I was able to interact with the Voice API successfully and didn't receive an AuthenticationError
.
Based on my tests, I don't think there is an issue with the Vonage RubyGem or that the issue was caused by a change in the API. TBH, I'm not really sure what the cause of the issue could have been, given that you are using the same credentials as previously in production, and the only thing that's changed is the Gem version and its dependencies.
I don't usually like to close issues with "works on my machine", but given that updating the Gem has 'resolved' things at your end, are you happy for me to close this issue?
As a side-note, in the v7.16.0 release, I added some functionality to the exception handling to provide access to the actual HTTP response in the exception object (this is documented in the README here). Hopefully the issue doesn't re-occur, but if anything similar happens in the future this should hopefully make it a bit easier to debug.
@superchilled I completely understand and appreciate that you've taken the time to look into it. Good to know about the additional information in the exception as well. I'll take a look at that should I ever run into this problem again. Thank you!
I am using this gem for a few months by now in production and until November 1 everything has been working great. But then I suddenly started getting
when trying to start a call using
vonage.voice.create
.I immediately confirmed that the api secret is still valid and also updated the private key for my Vonage application, but that didn't help. Only after updating the
vonage
gem it started working again.Do you know what happened? Did Vonage change the API on November 1 and I missed the announcement?
Here's a complete list of the version changes: