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

CompactToken validation failed with reason code: 80049228 #3

Open
denven opened this issue Jan 9, 2023 · 2 comments
Open

CompactToken validation failed with reason code: 80049228 #3

denven opened this issue Jan 9, 2023 · 2 comments
Assignees
Labels
bug Something isn't working resolved

Comments

@denven
Copy link
Owner

denven commented Jan 9, 2023

Bug details:

  • Errors existed continuously for many lines and then recovered
create_upload_session /tmp/sd/record/2023Y01M04D05H/08M00S60.mp4, Error: CompactToken validation failed with reason code: 80049228.
upload_small_file /tmp/sd/record/2023Y01M07D00H/52M00S60.jpg, Error: CompactToken validation failed with reason code: 80049228.
  • Result in no file can be uploaded before error disappeared
@denven
Copy link
Owner Author

denven commented Jan 9, 2023

Cause: I have multiple processes using the access token to request data from OneDrive, one subshell(child process) renews the token every 30 minutes. However, once it executes and renews the token the parent or other processes cannot take the new token from a global (env) variable in shell scripts. Then the parent process still uses the abandoned token to request and it will get such error.

Solution:

  • when finding the API access returns this error with code InvalidAuthenticationToken, renew the token immediately and send the API request once more.
  • I finally canceled the child process for token renewal since it is not convenient to pass the renewed token back to its parent process. Instead, I refresh the token in parent since it uses the token quite frequently, and share the renewed token via a file for other processes which don't use it very often.

For this situation, from my understanding, the token is invalid not because its lifetime is explicitly expired, it is because we renew or get a new one during its lifetime at another contex (function/process etc. which is not able to share the access token to where it uses) but we don't use the renewed one to request. I guess only one valid access token is allowed to the same refresh token. Then the previous live token is abandoned and becomes stale and invalid, the new token replaces its availability.

It's is a little different from code 80049217 which is due to the access token has passed its lifetime from the time aspect, although both share the same literal reason code InvalidAuthenticationToken.

@denven denven self-assigned this Jan 9, 2023
@denven
Copy link
Owner Author

denven commented Jan 9, 2023

Resolved

@denven denven added the enhancement New feature or request label Jan 9, 2023
@denven denven added bug Something isn't working resolved and removed enhancement New feature or request labels Jan 27, 2023
@denven denven changed the title Found continuous error in log file: CompactToken validation failed with reason code: 80049228 CompactToken validation failed with reason code: 80049228 Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved
Projects
None yet
Development

No branches or pull requests

1 participant