Informix Error -376
-376 Log file already exists.
The transaction log file you specify in the WITH LOG IN clause must not already exist. The database server must start a log file fresh; it has no means of appending log data to an old log file. An existing log file contains recovery information that may be crucial, so it will not simply empty an existing file. To make a full backup, lock the database, copy all of the database directory to a backup medium, erase the log file (it is no longer needed), and use the START DATABASE statement. To make a partial backup, lock the database, copy the log file to a backup medium and store it with the full backup, erase or rename the log file, and use the START DATABASE statement.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-376 covers the same underlying condition as -318: the transaction log file named in a WITH LOG IN clause already exists, and the server won't overwrite or append to it since an existing
log file may hold critical recovery information.
- A prior logging setup attempt left a log file behind at the same path, and a repeat attempt reuses the same filename.
- Re-running a
START DATABASE ... WITH LOG INsetup script without cleaning up the log file from a previous run. - A partial-archive workflow reusing the same log filename instead of moving the prior log file to backup storage first.
Solutions / Resolution
- Never reuse an existing log filename directly — the server intentionally won't overwrite or append to one.
- Follow the documented backup procedure, per the official guidance: lock the database, copy
its directory to backup media, erase the existing log file, then issue
START DATABASE ... WITH LOG INwith a filename that's now available (or a genuinely new one). - Check for and clean up leftover log files from a prior failed or aborted setup attempt before retrying with the same name.
Examples
Following the lock-backup-erase-restart sequence
1. LOCK the database.
2. Copy the database directory to backup media.
3. Erase the existing log file.
4. START DATABASE ... WITH LOG IN '<filename>' — now valid,
since the file no longer exists.
Retrying with a fresh filename instead
START DATABASE sales WITH LOG IN '/informix/logs/sales.log';
-- -376: sales.log already exists
START DATABASE sales WITH LOG IN '/informix/logs/sales_new.log';
Diagnostic Checks
- Check whether the target log filename already exists on disk before issuing
START DATABASE ... WITH LOG IN. - Confirm the backup procedure was actually followed (lock, copy, erase) rather than attempting to bypass it.
Related Errors / Related Topics
- -318 — "File with the same name as specified log file already exists." The essentially identical underlying condition — see its addendum for the same resolution guidance.
- -375 — "Cannot create log file for transaction." A related but distinct log-file creation failure, at the infrastructure level (disk space, permissions) rather than a naming conflict.
Same resolution as -318: back up, remove/rename the existing log file, and only then retry
START DATABASE ... WITH LOG IN.