Continous cloud backup; BACKUP PIT RESTORE TIME INVALID error

Hi there. My goal is to successfully use the continuous cloud backup feature, when doing automatic db migrations. (so a script can automatically recover the database, if migrations failed for some reason). The script runs this MongoDB Atlas CLI command, as described here:

atlas backup restore start pointInTime --clusterName ${clusterName} --pointInTimeUTCMillis ${pointInTimeMillis} --targetClusterName ${clusterName} --targetProjectId ${projectIdProduction} --output json

And sometimes if fails with:

Error:<groupId>/clusters/<cluster-name>/backup/restoreJobs POST: HTTP 400 (Error code: "BACKUP_PIT_RESTORE_TIME_INVALID")
Detail: Chosen Point in time timestamp invalid: Given point in time is too far ahead of latest oplog.. 
Reason: Bad Request. Params: [Given point in time is too far ahead of latest oplog.]

What does “Given point in time is too far ahead of latest oplog” means - and how can I mitigate this?

Hi @Alex_Bjorlig,

There is a maximum value stated in the UI for what value the oplog timestamp can be at most. I do not believe this same oplog timestamp is available to be retrieved currently using the public API so you’ll need to get this value from UI at the moment.

For example:

I’ve created the following feedback post and noted this internally with regards to this value being available via the API. You can vote for it if you wish.


1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.