-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Client Error 404 - JWT #251
Comments
Can you check your token file to see if the tokens look corrupted. This is the second time I've seen this reported. How often do you get this error and does it recover? If you roll back to a previous version, does the issue go away? |
Can you post the full error from your logs. Also assuming that are intermittent, can you let me know if there is any specific time period between occurrences. Thanks |
I have spent some time today to ensure all call to the O365 library are async, to try and make sure that no calls to write the token are sync and therefore may get corrupted. Easier said than done, which is why this is beta at this time. It may or may not fix the problem, which may be more to do with your system than the code. That said I'm investigating because this is the second time of reporting, but am conscious that there are at least 3500 other install out there. Please try it and report back if you have any problems - https://github.com/RogerSelwyn/O365-HomeAssistant/releases/tag/v4.8.6b1 |
Not feedback, so closing |
@RogerSelwyn apologies for the delay, I missed your response on this!! Logger: O365.connection Client Error: 401 Client Error: Unauthorized for url: https://graph.microsoft.com/v1.0/me/calendars/AQMkADAwATNiZmYAZC1hNWU0LTRkMjAtMDACLTAwCgBGAAAD4vU1kwUsckqNhwP1OklERAAHAAKZhY2qtl1PpHI4Sk1x59AAAAIBBgAAAAKZhY2qtl1PpHI4Sk1x59AAAAEB-c4AAAA=/calendarView?%24top=999&startDateTime=2024-10-08T22%3A00%3A00%2B00%3A00&endDateTime=2024-10-09T22%3A00%3A00%2B00%3A00&%24select=start%2Clocation%2Ccategories%2CshowAs%2Cbody%2CseriesMasterId%2Cend%2Csubject%2Csensitivity%2CisAllDay%2Cattendees | Error Message: IDX14100: JWT is not well formed, there are no dots (.). The token needs to be in JWS or JWE Compact Serialization Format. (JWS): 'EncodedHeader.EncodedPayload.EncodedSignature'. (JWE): 'EncodedProtectedHeader.EncodedEncryptedKey.EncodedInitializationVector.EncodedCiphertext.EncodedAuthenticationTag'. | Error Code: Not FoundHTTP Error 404. The requested resource is not found. | Error Code:Logger: custom_components.o365.calendar Error getting calendar events - 401 Client Error: Unauthorized for url: https://graph.microsoft.com/v1.0/me/calendars/AQMkADAwATNiZmYAZC1hNWU0LTRkMjAtMDACLTAwCgBGAAAD4vU1kwUsckqNhwP1OklERAAHAAKZhY2qtl1PpHI4Sk1x59AAAAIBBgAAAAKZhY2qtl1PpHI4Sk1x59AAAAEB-c4AAAA=/calendarView?%24top=999&startDateTime=2024-10-08T22%3A00%3A00%2B00%3A00&endDateTime=2024-10-09T22%3A00%3A00%2B00%3A00&%24select=start%2Clocation%2Ccategories%2CshowAs%2Cbody%2CseriesMasterId%2Cend%2Csubject%2Csensitivity%2CisAllDay%2Cattendees | Error Message: IDX14100: JWT is not well formed, there are no dots (.). The token needs to be in JWS or JWE Compact Serialization Format. (JWS): 'EncodedHeader.EncodedPayload.EncodedSignature'. (JWE): 'EncodedProtectedHeader.EncodedEncryptedKey.EncodedInitializationVector.EncodedCiphertext.EncodedAuthenticationTag'. |
the calendars still seem to load and items show up correctly. i've had this for a while (months) also in previous versions. |
The token file should look something like the below, the danger is if it fixes itself you may not see it ever corrupted. {
"token_type": "Bearer",
"scope": [
"Calendars.Read",
"Calendars.ReadWrite",
"Mail.Read",
"Mail.Send",
"Tasks.Read",
"Tasks.ReadWrite",
"User.Read",
"profile",
"openid",
"email"
],
"expires_in": 4390,
"ext_expires_in": 4390,
"access_token": "redacted",
"refresh_token": "redacted",
"expires_at": 1728511155.7669458
} If it has been going on for months, that possibly rules out an issue I was concerned about, in that a change I implemented in 4.8.5 was the issue. That said, I have made further similar changes in 4.8.6 beta 1 prompted by warnings from HA core. |
{ |
this is the token file , seems to look ok |
The implication is that it is the token that is corrupt, the bit that you have x'd out. I think the access token. And the message implies it should have dots '.' in it (mine does). Not sure if the problem is in the file or with when it is sent to MS. |
would deleting the integration and reinstalling it potentially work? |
I very much doubt it |
any suggestions on next steps? or should I leave it. this goes abit above my level of troubleshooting I guess :D |
You can try my latest beta. Other than that I'm at a loss. I'll try to follow it up with the library owner that handles the actual access token ms 365, it isn't my code, but I'll see what he suggests. I maxed out at the moment, so it may take a while. |
no problem, let me try and use the beta and keep an eye on my logs. perhaps its been shorter than I think :) thanks already! |
Hello @RogerSelwyn, I've the same issue.
I've checked my access token. There are no dots inside. I've also checked it with jwt.io and get the following error:
The error does not occur permanently, but only occasionally. It then seems to heal itself, since the synchronization of tasks and calendar (I don't use anything else) generally works. Do you have any suggestions to solve the problem? |
Unfortunately the management of the token is completely outside of my control (apart from me saying where it should be stored). All I can do is report it to the python-o365 library owner. I did see something on a similar issue where they believed it was due to the time changing unreliably on the server and the refresh token being used before the access token had expired. I’ll raise an issue on their GitHub and tag you when I get a chance. I have never seen the problem myself, so very difficult to try and diagnose. |
Reported here - O365/python-o365#1111 |
I too have the same issue. Seeing the response I'm only reporting it in order to follow any updates. |
I am getting the following errors in my log. Assuming as it’s unauthorised it’s not a connectivity error. Any suggestions?
Logger: O365.connection
Source: /usr/local/lib/python3.12/site-packages/O365/connection.py:838
First occurred: 05:08:37 (2 occurrences)
Last logged: 06:08:35
Client Error: 401 Client Error: Unauthorized for url: https://graph.microsoft.com/v1.0/me/calendars/AQMkADAwATNiZmYAZC1hNWU0LTRkMjAtMDACLTAwCgBGAAAD4vU1kwUsckqNhwP1OklERAAHAAKZhY2qtl1PpHI4Sk1x59AAAAIBBgAAAAKZhY2qtl1PpHI4Sk1x59AAAAEB-c8AAAA=/calendarView?%24top=999&startDateTime=2024-09-26T22%3A00%3A00%2B00%3A00&endDateTime=2024-09-27T22%3A00%3A00%2B00%3A00&%24select=seriesMasterId%2CshowAs%2Cstart%2Cbody%2Csubject%2Ccategories%2Cend%2CisAllDay%2Clocation%2Cattendees%2Csensitivity | Error Message: IDX14100: JWT is not well formed, there are no dots (.). The token needs to be in JWS or JWE Compact Serialization Format. (JWS): 'EncodedHeader.EncodedPayload.EncodedSignature'. (JWE): 'EncodedProtectedHeader.EncodedEncryptedKey.EncodedInitializationVector.EncodedCiphertext.EncodedAuthenticationTag'. | Error Code:
Client Error: 401 Client Error: Unauthorized for url: https://graph.microsoft.com/v1.0/me/calendars/AQMkADAwATNiZmYAZC1hNWU0LTRkMjAtMDACLTAwCgBGAAAD4vU1kwUsckqNhwP1OklERAAHAAKZhY2qtl1PpHI4Sk1x59AAAAIBBgAAAAKZhY2qtl1PpHI4Sk1x59AAAAEB-dEAAAA=/calendarView?%24top=999&startDateTime=2024-09-26T22%3A00%3A00%2B00%3A00&endDateTime=2024-09-27T22%3A00%3A00%2B00%3A00&%24select=seriesMasterId%2CshowAs%2Cstart%2Cbody%2Csubject%2Ccategories%2Cend%2CisAllDay%2Clocation%2Cattendees%2Csensitivity | Error Message: IDX14100: JWT is not well formed, there are no dots (.). The token needs to be in JWS or JWE Compact Serialization Format. (JWS): 'EncodedHeader.EncodedPayload.EncodedSignature'. (JWE): 'EncodedProtectedHeader.EncodedEncryptedKey.EncodedInitializationVector.EncodedCiphertext.EncodedAuthenticationTag'. | Error Code:
The text was updated successfully, but these errors were encountered: