KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Error: Log file cannot be integrated into database
PRODUCT: 4D | VERSION: 20 | PLATFORM: Mac & Win
Published On: December 18, 2024

When encountering this issue, expand on the error details to see if it matches up with the template below:


    Log file cannot be integrated into database [DB_NAME]
    The database journal integration failed at entry# XXX (operation id YYY).
    Cannot save record ZZZ in table [TABLE_NAME] of database [DB_NAME]
    The replication database is not valid
    Cannot get extra property
    Wrong data segment in database [DB_NAME]
    Cannot open data file of database [DB_NAME]
    Cannot read data segment of database [DB_NAME]
    Cache Flushing did not complete

This error message deals with the data synchronization file .4DSyncData and indicates there was an integrity issue that prevented the log integration, rather than a corrupted data or log file. The .4DSyncData file is created when one or more tables have the replication property enabled. Checking the MSC with the data file will reveal that data comes out clean.

In this event, the first step would be to restore your last backup and then reintegrate the current log file to the restored backup database.

Otherwise, delete the .4DSyncData and .4DSyncHeader files. They will regenerate on the next database startup. Then, reintegrate the current log file. When doing this option, make sure that your data stays synchronized by setting the replication mode to -1 with the SQL command REPLICATE and FOR REMOTE STAMP clause. The -1 values means that all records, including those that existed before replication was enabled, of the table are recovered. You can find more information on the command in the documentation below:

https://doc.4d.com/4Dv20R6/4D/20-R6/Replication-via-SQL.300-7183944.en.html
https://doc.4d.com/4Dv20/4D/20/REPLICATE.300-6342149.en.html