portainer: [WORKAROUND] Login: "Your session has expired" because of invalid Docker system time
Description
Getting the error “Your session has expired” on login. Problem is that an endpoint cannot be found:

Steps to reproduce the issue:
docker run -d -p 9000:9000 --name portainer portainer/portainer- open docker and setup password
- login the first time
Technical details:
- Portainer version: 1.11.0
- Portainer Docker image tag (latest/arm/windows…): 1.11.0
- Target Docker version (the host/cluster you manage): docker for windows, 1.12.5
- Platform (windows/linux): windows
- Browser: chrome, edge
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 3
- Comments: 30 (11 by maintainers)
Hi guys, I got this error when using docker for windows and finally fixed it by going to hyper-v-management --> virtual machines --> right click MobyLinuxVM --> settings --> integration services and enabling the time sync checkbox in the services list. I hope this helps some of you.
then system time wrong,you need sync ntp time
As @Glowbal said, this could be caused by your multiple replica Portainer setup. Try again with a single replica.
alright, I found the solution now… and the reason. solution: restart docker for windows reason: I use hibernation and the timedrift is actually the time the machine was sleeping. VM doesn’t get this information and therefore the big difference.
the code solution would be to calculate the expiration in a different way.
The date in the portainer container should be the same as your host machine. If you use a vm, like with Docker for mac or Windows, its the same as the system time returned by
docker info.@SeriousM I’ve pushed some changes on a specific tag on Dockerhub, could you try it?