[Bug]: Error: Invalid Input Error: No magic bytes found at end of file 'lakefs://test-repo/main/lakes.parquet' after merge in tutorial
What happened?
What actually happened, including error codes if applies.
See conversation on slack. AWS setup: EC2, S3, Postgres on RDS freebie. After merge of lakes-denmark and main branches, lakes.parquet in main branch cannot be read. Followed tutorial to the T. lakes-denmark branch works as intended.
Expected behavior
Lakes.parquet was to be queriable after merge in tutorial.
lakeFS version
1.2.0
How lakeFS is installed
AWS EC2, RDS, S3
Affected clients
Web UI
Relevant log output
Error: Invalid Input Error: No magic bytes found at end of file 'lakefs://test-repo/main/lakes.parquet'
Contact details
Also this conversation on Slack might refer to the same issue.
A user report is that 1.2.0 does not display this issue but 1.3.0 does.
After delete the service worker running in the chrome application I cloud not reproduce the bug. I'll keep trying to reproduce it for couple of more days - and return to planned in case I fail.
Failed to reproduce - moving back to Planned
How to reproduce
-
Start from the sample repository, and in the lakeFS UI open the
lakefs.parquetfile to reach the DuckDB console. -
Create a table from the parquet file:
CREATE OR REPLACE TABLE lakes AS SELECT * FROM READ_PARQUET('lakefs://example-repo/main/lakes.parquet'); -
Now make a change to the table:
DELETE FROM lakes WHERE Country != 'Denmark'; -
Copy the table back to the parquet file:
COPY lakes TO 'lakefs://example-repo/main/lakes.parquet'; -
Now commit the changes. and query the table:
SELECT * FROM READ_PARQUET('lakefs://example-repo/main/lakes.parquet') LIMIT 100; -
You can now use the following lakectl command to revert the last commit to the one before:
lakectl branch revert lakefs://example-repo/main $(./lakectl log lakefs://example-repo/main --amount 1 | grep "ID:" | sed s'/ID:[[:space:]]*//') -yRun this command and execute the query (5) again. Repeat this until the bug is reproduced.
What is happening here
You will see that DuckDB first sends a HEAD request to get the file metadata. It then sends a GET requests for a range within the file, but the browser returns it from the "disk cache".
HEAD request:
GET request:
DuckDB Wasm discord response - suggest to use cache break while requesting the s3 resources to bypass the browser's cache. Need to validate this solution - understand if it solves also the internal cache that duckdb manages.