Issue with DeltaFileNotFoundException After Vacuum and Missing Data Changes in Delta Log

minhhung0507
Valued Contributor

Dear Databricks experts,

I encountered the following error in Databricks:

`com.databricks.sql.transaction.tahoe.DeltaFileNotFoundException: [DELTA_EMPTY_DIRECTORY] No file found in the directory: gs://cimb-prod-lakehouse/bronze-layer/losdb/pl_message/_delta_log.`

This issue occurred after running a **Vacuum** operation. Despite continuous data ingestion, I noticed that there were no changes reflected in the Delta log (`_delta_log`). This raises a few questions:

1. Why does the **Vacuum** operation delete essential files, such as those required for `_delta_log`, leading to this error?
2. How can data ingestion continue without updates being recorded in the Delta log?
3. Is there a way to ensure that necessary files are retained during Vacuum to avoid such issues?

Currently, I have managed to fix the issue by identifying the last valid version after the Vacuum process and reading from that version. Since I am using readChangeFeed. I can read from the latest version if a new issue arises. However, I would like to better understand the root cause and how to prevent this problem in the future.

Thank you for your guidance!

minhhung0507_2-1736940030237.png

 

 

 

Regards,
Hung Nguyen