Hi there - I’ve been running into issues with background agents today. It is failing during environment setup - and I’ve narrowed it down to the system clock being off by several+ hours on the container – and that causing apt-get commands to fail.
Has anyone ran into this before and/or have any suggested work arounds?
Steps to Reproduce
Configure your project to use a custom Dockerfile (via .cursor/environment.json)
Use a stripped down Dockerfile like:
FROM ubuntu:24.04
RUN date
RUN apt-get update -y
Expected Behavior
Date should return an up to date timestamp (instead its 12+ hours behind)
Apt-get update should work (not have package list release file “is not valid yet” errors)
Dockerfile is able to continue with install packages with apt-get thereafter
Current Cursor Version (Menu → About Cursor → Copy)
I’m primarily debugging this on the Web UI for Agents
Additional Information
I’ve been in the process of enabling out Background Agent setup for our projects for the first time - so I can’t speak to whether this is a recent regression or something that has been ongoing.
Additionally I tried different approaches to syncing time - but none of the services or utilities to do this come preinstalled on the minimal container env - and there isn’t permissions to set date time in the container.
On Discord - I was offered a workaround by a community member. Posting it here in case no proper resolution is provided - and if anyone else runs into this problem:
I’ve been running into this same issue with a devcontainer config that previously worked fine. I’ve messed around with the workaround above, but I eventually gave up on background agents for the moment. It would be nice if the clock skew could be fixed.
+1 on this. Also having the same issue when downloading the base image:
Error: Environment failed to start
Details:
Build failed with exit code: 1
Allocating resources for this agent...
⣻
building with "default" instance using docker driver
[Build] load build definition from Dockerfile
transferring dockerfile: 939B done
DONE 0.0s
[Build] load metadata for mcr.microsoft.com/dotnet/sdk:8.0
ERROR: failed to do request: Head "https://mcr.microsoft.com/v2/dotnet/sdk/manifests/8.0": tls: failed to verify certificate: x509: certificate has expired or is not yet valid: current time 2025-08-16T12:01:04Z is before 2025-08-23T17:41:17Z
[Build] Status: ------
[Build] Status: > [internal] load metadata for mcr.microsoft.com/dotnet/sdk:8.0:
[Build] Status: Dockerfile:1
[Build] Status: --------------------
[Build] Status: 1 | >>> FROM mcr.microsoft.com/dotnet/sdk:8.0
[Build] Status: 2 |
[Build] Status: 3 | # Fix issue with Cursor's apt-get update later in the setup process
[Build] Status: ERROR: failed to build: failed to solve: mcr.microsoft.com/dotnet/sdk:8.0: failed to resolve source metadata for mcr.microsoft.com/dotnet/sdk:8.0: failed to do request: Head "https://mcr.microsoft.com/v2/dotnet/sdk/manifests/8.0": tls: failed to verify certificate: x509: certificate has expired or is not yet valid: current time 2025-08-16T12:01:04Z is before 2025-08-23T17:41:17Z
In this example for Microsoft Artifact Registry . In this case there’s no workaround(?) due to the SSL being renewed on the August 23, 2025 so all background agents having a clock before this will fail.