Converting a multi-tab XLSX to HTML causes DirectoryInfo exception

We have groupdocs conversion for java deployed in a docker container running in kubernetes. Anytime we try to convert a spreadsheet with more than one tab, it blows up with the below exception. This occurs everytime and with every version of the library that we’ve tried, starting with v23.2 to v25.9.

We are guessing it’s a permission issue becuase the same error does not occur when running locally on windows or in a unit test in VSCode. Problem is we have no idea which directory is causing this error or how to fix it.

Any idea which directory it would be trying to write to and which configuration we need to adjust and/or permission.

com.groupdocs.conversion.internal.c.a.pd.internal.ms.System.IO.l1p: DirectoryInfo was not created

                at com.groupdocs.conversion.internal.c.a.pd.internal.ms.System.IO.lt.lI(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.internal.c.a.pd.ADocument.lI(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.internal.c.a.pd.ADocument.save(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.internal.c.a.pd.Document.save(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.savers.pdf.PdfToWebSaver.saveDocument(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.savers.pdf.PdfToWebSaver.save(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.savers.Saver.save(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.documents.k.save(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.helpers.b.b(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.converting.operations.ToWebConversionOperation.execute(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.pipeline.f$1$1.a(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.converting.operations.ToPdfConversionOperation.execute(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.converting.operations.ConvertToPdfIfRequiredFromSpreadsheetOperation.execute(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.pipeline.f$1$1.a(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.converting.operations.RemoveCommentsOperation.execute(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.pipeline.f$1$1.a(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.converting.operations.PagesLimitOperation.execute(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.pipeline.f$1$1.a(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.converting.operations.ApplySpreadsheetLoadOptionsOperation.execute(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.pipeline.f$1$1.a(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.pipeline.e.execute(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.pipeline.h.a(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.pipeline.h.a(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.b.convert(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.Converter.convert(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

                at com.groupdocs.conversion.Converter.convert(Unknown Source) ~[groupdocs-conversion-25.9.jar:25.9]

@johnnyfunkypants

  • Is the Docker container running with a non-root user? If so, which user UID/GID is being used?
  • Are you explicitly setting the TempDirectory in GroupDocs via ConversionConfig.setTempDirectory()? If not, have you checked if the default temp path (e.g. /tmp) is writable in the container?
  • Does the Kubernetes pod have any security policies (e.g. readOnlyRootFilesystem, securityContext) that restrict writing to local directories?
  • Have you verified that /tmp (or the directory being used) exists and has write permissions inside the container at runtime?

Hello @johnnyfunkypants ,

Thank you for contacting us and for the detailed description of your issue.

In addition to the questions raised by our AI Agent, we would like to recommend that you verify whether there are any write restrictions on the /tmp directory and, if so, grant write access to it.

Alternatively, you may specify a custom temporary directory by using ConverterSettings.setTempFolder().

If this does not help resolve the issue, please share your spreadsheet file with us so that we can perform further investigation.

  • Yes, running as non-root. UID=1001
  • Yes, temp directory is set to /groupdocs/temp - yes, the path is writable
  • No, there are no secuirty policies in place that would restrict writing to local directories. I also tried toggling readOnlyRootFilesystem explicitly and neither true/false works
  • Yes, the temp path exists and has write permissions

I’ve also tried using /tmp as the temp path and it still fails.

Can you confirm in the code that it is indeed the temp path that it is trying to write to when this exception occurs?

I could share you a file, but every spreadsheet with multiple tabs fails, it’s very easy to reproduce.

@johnnyfunkypants ,

Just in case, please share the file and the code sample you are using for the conversion.

Based on the stack trace, it appears that the issue is most likely caused by one of our third-party libraries, and at the moment it is not clear which directory it is attempting to write the file to. By default, this should be the /tmp directory.

Therefore, we will need to perform additional investigation using your specific use case.

I’ve simplified our code, but it basically does the below with given file and desired extension. Note, when we convert the same file to PDF, it works fine. But when we try to convert to HTML, it blows up with the above exception.

I also attached the same file I’ve been using.
MultiTabTest.zip (9.0 KB)

    public byte[] convert(MultipartFile file, String extension) {
        ConvertOptions<?> convertOptions = FileType.fromExtension(extension).getConvertOptions();
        ConverterSettings settings = new ConverterSettings();
        settings.setTempFolder("/tmp");

        Supplier<InputStream> documentInputStreamSupplier = () -> {
            try {
                return file.getInputStream();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        };
        String detectedExtension = MediaUtils.detectExtension(documentInputStreamSupplier, file.getOriginalFilename());
        LoadOptions loadOptions = FileType.fromExtension(detectedExtension).getLoadOptions();

        try (Converter converter = new Converter(
                documentInputStreamSupplier,
                () -> loadOptions,
                () -> settings)) {
            final ByteArrayOutputStream output = new ByteArrayOutputStream();
            converter.convert(() -> output, convertOptions);
            return output.toByteArray();
        }
    }

Hello @johnnyfunkypants ,

As I understand it, you are encountering this issue only when converting from .xlsx to .html, or does it occur for any input document format when converting to .html?

Have you tried setting WebConvertOptions.setEmbedFontResources(true)?

In this case, no separate resources folder should be created, and this may temporarily resolve the issue while we continue our investigation.

That is correct, it’s only a problem when converting to HTML (so far anyway).

Looks like setEmbedFontResources was introduced in v25.12 (we’ve only tested up to v25.9), I’ll try updating to that version and see if it helps.

Setting WebConvertOptions.setEmbedFontResources(true) did not make a difference, same error.

@johnnyfunkypants ,

In that case, I will carry out additional investigation using your file and get back to you with the results as soon as possible.