ApolloX - certificate has expired or is not yet valid

I’ve been trying to create a Next.js ApolloX template.
When I try to debug the container, the first steps are ok, but then I get the following error

Executing task: sshpass -p <password> ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no torizon@192.168.137.68 LOCAL_REGISTRY=192.168.137.1 TAG=arm64 GPU= docker-compose up -d electron2del-debug 

Warning: Permanently added '192.168.137.68' (ED25519) to the list of known hosts.
time="2023-02-26T17:05:25Z" level=warning msg="The \"DOCKER_LOGIN\" variable is not set. Defaulting to a blank string."
 weston Pulling 
 weston Error 
Error response from daemon: Get "https://registry-1.docker.io/v2/": x509: certificate has expired or is not yet valid: current time 2023-02-26T17:05:27Z is before 2023-05-05T00:00:00Z

The time “2023-02-26T17:05:25Z” seems suspicious to me, because today id “2023-06-26”, so four months later than this time.
Where does it come from?

Greetings @vix,

Seems like somehow your Docker’s time got mismatched from the actual system time which causes the certs to be incorrect. This seems like an issue that can happen as seen here: ubuntu - Docker pull error : x509: certificate has expired or is not yet valid - Stack Overflow

Though it’s not clear what exactly causes this “time mismatch” to occur. As for solutions does simply restarting Docker/Docker Desktop fix the issue?

Best Regards,
Jeremias

Hi @jeremias.tx
I work with WSL, and restarting docker (sudo systemctl restart docker both on WSL and on the SoM) doesn’t fix the issue.
I confirm that the time is four months before than the real timestamp.
Today it’s

time="2023-02-27T23:30:08Z"

Do you have any other suggestion?

I work with WSL, and restarting docker (sudo systemctl restart docker both on WSL and on the SoM) doesn’t fix the issue.

You’re on a Windows machine then yes? In that case did you only restart docker in WSL or did you restart Docker Desktop on Windows itself? Every thread I find regarding this time mismatch issue seems to suggest that restarting Docker Desktop should fix the issue, for example this thread: https://github.com/docker/for-win/issues/4526

That said I’m not sure if there’s a way to prevent the issue from happening altogether. You’ve been using Docker on this machine for a while yes? Was it only recently the time got mismatched? Did you do or change something recently that might have caused this?

Best Regards,
Jeremias

I restarted docker in WSL only.
I don’t have it installed in Windows.

It worked until a clouple off days ago, then it stopped.
Today it started working again.
I don’t know why, unfortunately.

I restarted docker in WSL only.
I don’t have it installed in Windows.

Interesting I didn’t know you could do this.

Well I’m glad to hear the issue seemingly fixed itself, though I wonder what even happened in the first place on your system.

Best Regards,
Jeremias