-
Notifications
You must be signed in to change notification settings - Fork 65
error: server returned status 400: {"error":"jwt has expired"} #669
Comments
The clock on your computer is probably set incorrectly. yotta uses signed JSON Web Tokens to authenticate requests against the registry, these have an expiration time set to reduce the possibility of replay attacks. I notice that even though you sent this bug shortly after 14:00 GMT, your clock reports: "14:29:36 GMT" as the current time, so this seems to support that explanation. |
Spot on James! :)
My machine's clock was off by 4-5 minutes. |
👍 |
It's worth mentioning that @geky ran into this issue too. He figured it out, but since this seems to be recurring maybe it makes sense to add a warning? Probably something like:
|
Good point, I will leave this open to track the need for a more friendly error message. |
I get the same even though machine clock fine |
FYI: I'm going through 'blinky' after initial install of Docker on Mac OS X 10.11.3. I got the above error multiple times in a row until I created the 'blinky' (empty) header folder. After that, I was properly shown 'You need to log in to do this.' & have been able to continue. |
Thanks for reporting that. Are you using the yotta docker image that we provide, or your own? @thegecko could there be an issue with clock synchronisation when the docker image first boots up? |
I followed the instructions at:
|
I've not come across this before, but that doesn't mean it isn't a problem :)
@alteredworlds, I'd be interested to know if adding this to the yotta.sh file resolves your issue. |
With regards to further diagnosis of this issue, I'm afraid I can no longer replicate it. The error occurred only on first access to the yotta registry (when not yet logged in). I was able to get past the error, apparently via some side effect of manually creating the header folder, but correlation != causation... :) |
I got the same issue but I use yotta in win7, and i checked the system time is synced with the internet time setting, is anyone know how to fix this issue in win7 system? P.S. this issue cause the yotta can not login account, install library, device target, etc... |
If you're getting this error it means your clock isn't synchronised correctly. Most likely this might be because it's set to the wrong time-zone. Note that it needs to be correct within a few minutes – choosing the option to automatically set the time is the best way to do that. |
Hi @autopulated , I think the clock is synchronised currectly, and the time zone is setup the right setting but still no work, so, may it could be another reason to cause the issue appears in my system. |
That's odd – please could you check that the output of running: python -c "import datetime; print(datetime.datetime.utcnow())" in a terminal window matches the time displayed, for example, here: http://time.is/UTC If python's notion of time isn't what your system clock is showing, that could also cause this problem |
Hi @autopulated , it looks like delayed about 3~4 minutes, Thanks. |
Thanks for the update – just to clarify, is the time shown by python 3-4 minutes off the time shown by your system clock, or is the time shown by your system clock 3-4 minutes off the http://time.is/UTC time? |
it's the system clock 3-4 minutes off the http://time.is/UTC time. |
ah ok – that'd be enough to invalidate the JSON web tokens used for authentication. I think the ideal solution to this problem would be for the yotta client to get the time used for token expiration from the registry. The authentication scheme is designed to work in the clear (even though requests are always made over https), so getting the time securely needs some careful thought. |
I think sometimes it could get some confused in old PC, some PC system time can not be synchronized with UTC time setting, and they just change the time by manual modification (like the case of me). Still thank you for your help, @autopulated ! |
…ts exceptions that propagate to main, and print only summary information (the full backtrace may hide useful error message); addresses ARMmbed#669
Got this issue already for some time. I'm sure that I'm doing something wrong but still, I can't use yotta with my Linux box (
Linux mbedci 3.13.0-62-generic #102-Ubuntu SMP Tue Aug 11 14:29:36 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
).Description
When I try to build
mbed-drivers
on my Linux machine I goterror: server returned status 400: {"error":"jwt has expired"}
error from yotta.Example
The text was updated successfully, but these errors were encountered: