apache/iceberg · error · NotFoundException
Location does not exist
Error message
Location does not exist: %s
What it means
When opening a range read on ADLS Gen2, an underlying BlobStorageException with BLOB_NOT_FOUND error code is converted into Iceberg's NotFoundException with the location in the message. This signals the file at the requested location does not exist in the storage account.
Solutions
- Verify the full ADLS location (account/container/path) exists and is spelled correctly.
- Re-plan the scan: the file was likely deleted by concurrent maintenance; refresh table metadata and retry.
- Check container name and filesystem existence in the storage account.
- Confirm credentials allow listing/reading so the real error is not masked (permissions usually yield a different code, but verify).
Defensive patterns
Strategy: try-catch
Try / catch
try { readData(); } catch (NotFoundException e) { log.warn("File {} was deleted concurrently, re-planning scan", e.getMessage()); refreshTableMetadata(); retryRead(); } Prevention
- Avoid running compaction/expiration concurrently with active reads, or use snapshot expiration retention windows.
- Validate table location paths and container names in configuration.
- Use retry with re-planning for long-running read jobs against actively maintained tables.
When it happens
Trigger: ADLSInputStream.openRange encounters a PathNotFound/BlobNotFound error from the Azure SDK when reading the file; e.g. the file was deleted between planning and reading, or the path is wrong.
Common situations: Concurrent table compaction/expiry deleting the data file before a task reads it; mistyped storage path in table location; missing container; reading an orphaned file path.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- Failed to create output stream for location:
- Location already exists
- Failed to close the VendedAdlsCredentialProvider
- Failed to delete file
- Failed to delete path
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/f1d3bb0246e6fa41.
Report an issue: GitHub.
Appendix: source
Thrown at azure/src/main/java/org/apache/iceberg/azure/adlsv2/ADLSInputStream.java:241
if (stream != null) {
stream.close();
}
}
@SuppressWarnings({"checkstyle:NoFinalizer", "Finalize", "deprecation"})
@Override
protected void finalize() throws Throwable {
super.finalize();
if (!closed) {
close(); // releasing resources is more important than printing the warning
String trace = Joiner.on("\n\t").join(Arrays.copyOfRange(createStack, 1, createStack.length));
LOG.warn("Unclosed input stream created by:\n\t{}", trace);
}
}
private static void throwNotFoundIfNotPresent(Throwable throwable, String location) {
if (isFileNotFoundException(throwable)) {
throw new NotFoundException(throwable, "Location does not exist: %s", location);
}
}
private static boolean isFileNotFoundException(Throwable exception) {
if (exception instanceof BlobStorageException blobStorageException) {
return BlobErrorCode.BLOB_NOT_FOUND.equals(blobStorageException.getErrorCode());
}
if (exception instanceof DataLakeStorageException dataLakeStorageException) {
return "PathNotFound".equals(dataLakeStorageException.getErrorCode());
}
return false;
}
}
View on GitHub (pinned to 86d9c8fc54)