# MongoServerError: OplogStartMissing: no oplog entry found for timestamp

- **ID:** `mongodb/oplog-too-small-for-replication`
- **Domain:** mongodb
- **Category:** runtime_error
- **Error Code:** `133`
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

The secondary replica set member fell too far behind and the primary's oplog has already rolled over the required entry.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| mongodb 7.0 | active | — | — |
| mongodb 6.0 | active | — | — |
| mongodb 5.0 | active | — | — |
| mongodb 4.4 | active | — | — |

## Workarounds

1. **Resync the secondary by deleting its data directory and restarting: rm -rf /var/lib/mongodb/* && systemctl restart mongod** (95% success)
   ```
   Resync the secondary by deleting its data directory and restarting: rm -rf /var/lib/mongodb/* && systemctl restart mongod
   ```
2. **Increase the primary's oplog size to prevent future gaps: db.adminCommand({ replSetResizeOplog: 1, size: 40960 }) (set to 40GB)** (80% success)
   ```
   Increase the primary's oplog size to prevent future gaps: db.adminCommand({ replSetResizeOplog: 1, size: 40960 }) (set to 40GB)
   ```

## Dead Ends

- **** — The oplog gap remains; the secondary will still fail to sync. (90% fail)
- **** — Oplog size is set on the primary; secondary can't modify it. (95% fail)
