Skip to content

bug(python): RuntimeError: lance error: LanceError(IO): External error: Not found (maybe NFS related) #2963

Open

Description

@jmhsieh

LanceDB version

0.25.1

What happened?

RuntimeError: lance error: LanceError(IO): External error: Not found: /path/to/table.lance/data/110011001110101001000000d7bb294ad7af3a6b5a7e37b052.lance
I'll try to find a way to reproduce it consistently. I'm doing concurrent writes on NFS, which I suspect can be the culprit.
Image Image

https://discord.com/channels/1030247538198061086/1030247538667827251/threads/1466389135253176404

Are there known steps to reproduce?

No response

Activity

  1. added
    bug
    on Jan 30, 2026
  2. changed the title [-]bug(python): RuntimeError: lance error: LanceError(IO): External error: Not found[/-] [+]bug(python): RuntimeError: lance error: LanceError(IO): External error: Not found (maybe NFS related)[/+] on Jan 30, 2026
  3. sprytnyk commented on Mar 9, 2026

    @sprytnyk

    I have the same issue and don't use NFS.
    It happens when adding new vectors into tables and try to index them.
    This bug longs from old releases to the latest one and difficult to reproduce because it happens intermittently.

    I have such indices for my table:

    >>> from lancedb import connect_async
    ... db = await connect_async('/lancedb')
    >>> table = await db.open_table('table')
    >>> await table.list_indices()
    [Index(BTree, columns=["pk"], name="pk_idx"),
     Index(Bitmap, columns=["visibility"], name="visibility_idx"),
     Index(IvfPq, columns=["embedding"], name="embedding_idx")]

    During the day run such script to index newly added data:

        for table_name in table_names:
            table = await db.open_table(table_name)
    
            # Clean up files in dirs _versions, _transactions, merge data in data
            # dir, add new vectors into scalar and vector indices.
            logger.warning(f"Optimizing {table_name} table...")
            stats = await table.optimize(cleanup_older_than=timedelta(seconds=0), delete_unverified=True)
            logger.info(stats)
            logger.info(f"Finished optimizing {table_name} table.")

    It works for days until it's not.

    Any ideas on this @wjones127, @changhiskhan?

  4. sprytnyk commented on Mar 10, 2026

    @sprytnyk

    Per docs optimize method docs, optimization covers three operations:

    • Compaction: Merges small files into larger ones
    • Prune: Removes old versions of the dataset
    • Index: Optimizes the indices, adding new data to existing indices

    I had a look at rust code and the order is the same, so potential fix to this problem could be:

    # 1. Compact fragments
    stats_compact = await table.compact_files()
    
    # 2. Index BEFORE cleanup
    stats_index = await table.optimize(cleanup_older_than=None)  # cleanup_older_than=None skips prune
    
    # 3. Now safe to prune
    stats_prune = await table.cleanup_old_versions(
        older_than=timedelta(seconds=0), 
        delete_unverified=True
    )
  5. sprytnyk commented on Apr 27, 2026

    @sprytnyk

    For anyone interested in fixing the problem, this approach works as well:

    stats = await table.optimize(
        cleanup_older_than=timedelta(minutes=15),
        delete_unverified=False
    )

    Why this happens: if anything writes to the table while optimize runs with cleanup_older_than=timedelta(seconds=0) and delete_unverified=True, cleanup deletes files from writes that haven't finished yet. Wrote it up here:
    https://sprytnyk.dev/posts/running-lancedb-in-production/#versioning

  6. lancedb-gatefixer commented on Nov 24, 2026

    @lancedb-gatefixer
    Contributor

    I examined abe829f4a32538d636465ca3c77f1c32a753835b and tested the reported LanceDB 0.25.1 release with separate processes appending data and rebuilding scalar indices on string and integer columns. All three trials (200 appends and 80 index builds each) completed successfully, and all 3,456 rows remained readable in each trial. This used an ordinary filesystem without cleanup, so it does not rule out an NFS-specific failure.

    The cleanup example above disables concurrency protections: delete_unverified=True allows deleting an unfinished writer's files, and zero retention also invalidates older snapshots. Current optimize documentation warns about both. As discussed in #3122, changing the index/prune order cannot protect independent writers.

    Could you provide a minimal runnable writer/indexing example and the full traceback, including any cleanup calls and their parameters? Please include the LanceDB version and filesystem/NFS mount configuration, and whether the failure still occurs without cleanup (or with default maintenance settings).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions