-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
[oauth] Error fetching access token. Invalid oauth code? Please generate a new one. #3447
Comments
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/oh4-0-0-snapshot-and-m1-google-tts-exception/145046/15 |
I have this reproduced in a unit test now, I'll start working on a fix. |
I believe this is a regression from the Java 17 upgrade, because JDK internals are now strongly encapsulated. |
Please note, the call stack reported in the forum post is not the same as in the PR description:
|
I got a 2nd error after re-installing the addon. |
No, this issue now has everything needed, just wanted to mention for difference for completeness, since it's relevant for the fix. |
After re-installing I only get:
Will reboot and report back EDIT: No change after restart |
@Mark-VG - can you try this: bundle:uninstall org.openhab.core.auth.oauth2client and then drop this JAR in you addons directory: org.openhab.core.auth.oauth2client-4.0.0-SNAPSHOT.jar |
@jlaur Thank you. Tried the new JAR and get the same authn error (no exception though):
|
@Mark-VG - do you still have TRACE logging enabled for |
@jlaur Yes, I do:
Tried again too:
|
@Mark-VG - I have uploaded a new version with an additional fix that should be targeting the exception from the stack trace in the description. The JAR can be downloaded using the same link as previously. Can you try that one too? I have been struggling with unit tests (so far unsuccessfully) so haven't had time to set up Google TTS yet for manual testing. |
@jlaur Thank you. Tried the new one and get:
I noticed that I did not get the log:
This only happened if I tried to use the same code again? The authorization still failed though - the setting are not saved and the Google TTS is still not available. |
@mhilbush - if you are still using the Google TTS, perhaps you could assist? I saw you did openhab/openhab-addons#13042, so you probably know your way around this? @Mark-VG - can you check the file /var/lib/openhab/jsondb/StorageHandler.For.OAuthClientService.json and see if it contains anything that seems related? |
Sorry, I've actually never used Google TTS (I use VoiceRSS). But I do have a Nest doorbell, and that binding had the same problem. So I ended up fixing it in both bindings. |
@mhilbush - is Nest doorbell working for you with 4.0? If no, is it working in combination with this: org.openhab.core.auth.oauth2client-4.0.0-SNAPSHOT.jar? |
It's working fine for me. I'm on build 3357 without that jar. Is there something you want me to check? It's in another house, but I have a VPN connection to that location. |
@mhilbush - if it's working, I think there's nothing more I can ask you to check. 🙂 Thanks! |
Hi
The file was recreated and no error generated, however Google TTS is still offline. The redacted new file is as follows: I did notice that |
Thanks. I notice also some duplication between two different namespaces:
And the newest one is for the stt namespace: "org.openhab.voice.googlestt.LastUsed": {
"class": "java.lang.String",
"value": "\"2023-03-15T07:32:06.379005900Z\""
}, This is the next thing to check. |
Sorry, did not pick up TTS vs STT. |
@Mark-VG - I assume it's TTS you are still having issues with. |
Yes, I actually don't use STT at all. |
Saw an article suggestion to delete the backup file sfro JSON as well, which I have now tried. This time the |
@Mark-VG - in the meantime I'll add some more logging in the Google TTS add-on to try to better pinpoint the problem. |
@Mark-VG - with trace logging enabled for |
@jlaur https://community.openhab.org/t/oh3-google-tts-error-grant-type-authorization-code/112549/44 The generated JSON is as follows (Redacted). StorageHandler.For.OAuthClientService.json.txt
Gives:
Also
Hence the use of the number |
This should be "Google Cloud Text-to-Speech". The bundle you mentioned is STT, not TTS. This is probably also why you can't restart it. Can you check if you have TTS correctly installed? In the logs above not a single log line is from this add-on, so something is missing. |
I am so sorry!When trying to test I uninstalled Google TTS and "reinstalled". Turns out I installed STT instead. Really a rookie move! I can confirm now that your fixed I retested with the M1 version and the error occurs - so your fix is definitely the solution. I also do not see the exceptions anymore. Can you confirm that once your fixes are merged I would have to:
Again, thank you so much for taking the time to look at this and help me |
Thanks for the feedback, I'm glad that it finally worked out, and to have confirmation that the fix is working. 🙂
I will have a look in the evening (CET) and try to get my test system reverted to the bundled version. Then will let you know which steps are needed. The fix has now been merged, so it will be included with the next snapshot. |
I'm not 100% sure, but it seems that after removing the JAR from the addons directory, you can simply |
Yes, I just restarted openHAB and it changed from WAITING. Thanks for all the help |
I am running on a Windows 10 PC:
Operating system: Windows 10/10.0 (amd64)
Java Runtime: Azul Systems, Inc. 17.0.6 (Zulu17.40+19-CA)
Since upgrading from 3.4.2 to 4.0.0-SNAPSHOT and now 4.0.0.M1 I am getting errors trying to authenticate for Google TTS:
Error fetching access token. Invalid oauth code? Please generate a new one.
When logged using TRACE logging:
I get:
I have retested with 3.4.2 (Java 11) and with a CLEAN 4.0.0-SNAPSHOT (only Google TTS installed) and both work fine.
Any assistance would be appreciated.
The text was updated successfully, but these errors were encountered: