Perfectly valid? tokens sometimes become invalid
clockworksoul opened this issue · comments
This happens within a few minutes after bootstrapping an instance.
The current time is: 11:56am EST.
$ gort bundle install bundle.yml
Error: Unauthorized
The text of the token is:
{
"Token":"<redacted>",
"User":"admin",
"ValidFrom":"2021-11-19T16:53:09.4766392Z",
"ValidUntil":"2021-11-19T17:03:09.4766392Z"
}
Indicates the token should have a lifetime of ten minutes, and should still be valid.
However, the database has:
valid_from: "2021-11-19 16:53:14.863744+00"
valid_to: "2021-11-19 16:53:24.863744+00"
So, ten SECONDS instead of ten minutes.
To fix
- Make the token file and database agree
- Make client try to refresh an invalid token
Workaround
Deleting the token and trying again causes the token to be refreshed, and everything works fine.