A file is “backed up without a lock” or “returned an error when opened”
This page is intended for administrators who find a file in a backup report flagged as backed up without a lock, or as impossible to open. It explains what these two lines mean, whether the file has actually been backed up, and how to prevent them from recurring.
Symptom
The backup report contains one of these lines:
The file "…" was backed up without a lock and may contain inconsistent data.
The file "…" requested by the server generated an error on opening (E…).
The first is a warning. The second is an error: that file was not backed up during this backup.
Cause
"Backed up without a lock"
To read a file, the agent first opens it in a way that prevents other programs from writing to it during the read. If another program has already opened the file in a way that forbids this, Windows refuses with error 32 (file in use by another process).
In this case, the agent retries, reading the file without applying a lock. The file is then backed up. However, if the program holding it open writes to it during the read, the copy may mix data from before and after the write. That is what the warning indicates.
This situation mainly occurs when the file is not read within a VSS (Volume Shadow Copy Service) snapshot:
- VSS is disabled for this profile;
- the file is located on a network share or a NAS (Network Attached Storage), where VSS does not apply.
"Error on opening"
The agent could not open the file, even without a lock. The code in brackets is the Windows error code, preceded by the letter E. The most common ones are:
| Code | Meaning |
|---|---|
E2 | The file no longer exists. It was deleted between the scan and the read. |
E3 | The path no longer exists. |
E5 | Access denied. |
E32 | The file is in use by another process, and the lock-free read also failed or is disabled. |
Codes E9991 and E9992 indicate that Windows reported a failure without an error code. Code E9993 indicates another error encountered during opening, unrelated to a Windows code.
For a file located on a network share, when the error may stem from the connection to the share (codes E5, E53, E58, E1265, E1312, E1326, E1327), the agent first attempts to reconnect to the share, then to reopen the file. The error is only reported after this attempt. For the other codes, including E2, E3 and E32, no reconnection takes place.
A OneDrive file marked as "available online only" does not generate a per-file error: the report contains a single information line covering all such files. See the page about OneDrive online-only files.
Checks
- Check whether the file is on a local disk or on a network share. The path begins with
\\for a share. - For a local file, check that VSS is active for this profile. In the agent, the
Disable open file backup (VSS)checkbox, underAdditional settings..., must be unticked. In the web interface, theDisable VSScheckbox must be unticked. - For an
E5, check the permissions on the file. The agent runs as a Windows service, under that service's account, not under the account of the logged-in user. - For an
E2or anE3, check whether the file is a temporary file, created and then deleted by an application during the backup. - Check whether the same line recurs with every backup, or only appeared once.
Resolution
Open files on a local disk
Leave VSS active. Files are then read from a frozen snapshot, and the "without a lock" warning no longer occurs for these files. If VSS fails on this machine, see the page about VSS errors.
Open files on a network share
VSS does not apply to shares. To obtain a consistent copy:
- schedule the backup for a time when the files are not in use;
- or stop the application holding them open before the backup, using the
@Serviceor@Programdirectives described in the page "Stopping a service or running a script before the backup".
Refusing lock-free reads
If you prefer an explicit error over a potentially inconsistent copy, you can disable lock-free reading. Enter AllowDisableShareDenyWriteOnE32=0 in the Advanced agent options field of the backup settings. A locked file then generates error E32 and is not backed up.
Temporary files
If the errors concern temporary files or caches that do not need to be backed up, exclude them using an exclusion rule. See the page about exclusion rules.
If the problem persists
A file in error is not lost for all that: the previously backed-up version remains restorable, and the file will be attempted again at the next backup.
If the same file remains in error with every backup, contact BeBackup support. Attach the backup report and the agent service log, bbAgent-service.log.
BeBackup is backup built for IT service providers
Backup and restore of workstations, servers, virtual machines and Microsoft 365, encrypted at source with a key we do not hold, on the hosting of your choice.