Skip to content

Shared string cache fails on AWS Lambda because it writes to /var/task #895

Closed

Description

@nicolascaorsi

Excel Type

  • XLSX
  • XLSM
  • CSV
  • OTHER

MiniExcel Version

1.41.3

Description

When calling MiniExcel.Query inside an AWS Lambda function (runtime .NET 8), the library attempts to create temporary files under the deployment root (/var/task/<guid>_miniexcelcache_position). That directory is read-only on Lambda, so the call throws IOException: Read-only file system and the .xlsx processing aborts.
This behavior is hardcoded at

var path = $"{Guid.NewGuid().ToString()}_miniexcelcache";

Steps to reproduce

  1. Create a .NET Lambda that reads an XLSX stream and invokes MiniExcel.Query(stream);
  2. Deploy it to AWS (runtime dotnet8) and invoke it with any XLSX containing shared strings;
  3. Observe the execution failing with Read-only file system when the cache is created.

Current behavior

Execution throws System.IO.IOException when opening/creating the shared string cache file under /var/task, preventing the Excel reader from proceeding.

Expected behavior

The library should write its cache to a writable location (e.g., Path.GetTempPath()) or expose configuration to set the cache directory explicitly.

Workaround

Disable the cache using new OpenXmlConfiguration { EnableSharedStringCache = false } (with higher memory usage).

Activity

  1. michelebastione commented on Nov 5, 2025

    @michelebastione
    Collaborator

    Thank you for the very detailed bug report, I'll work on it in the next few days.

  2. added a commit that references this issue on Nov 5, 2025
    f039058
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions