Conversion Exception in linux container

Hello,
I’m running (or rather try to run) GroupDocs in docker container. Everythings works fine on my local (windows) machine but inside docker image I’m receiving various exceptions.

For images:

GroupDocs.Conversion.Exceptions.CorruptOrDamagedFileException: Cannot convert. The file is corrupt or damaged.
     at♣♥.☻()
     at GroupDocs.Conversion.Converter.☻()

For pptx

GroupDocs.Conversion.Exceptions.GroupDocsConversionException: The type initializer for 'Gdip' threw an exception.
         at♣♥.☻()
         at GroupDocs.Conversion.Converter.☻()
         at GroupDocs.Conversion.Converter.Convert(SaveDocumentStream document, ConvertOptions convertOptions)

My packages (I’ve tried various versions of SkiaSharp):
<PackageReference Include="GroupDocs.Conversion" Version="22.5.0" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.80.4" />

My docker file contains installation from documentation:

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build

WORKDIR /source

COPY *.csproj .
RUN dotnet restore --verbosity q

COPY . .
RUN dotnet publish  DocumentProcessing.POC.csproj --no-restore --configuration Release -o /app

FROM mcr.microsoft.com/dotnet/aspnet:6.0-jammy AS final

WORKDIR /app

COPY --from=build /app .

# begin install libgdiplus and dependencies
RUN apt-get update \
    && apt-get install -y \
        apt-transport-https \
        dirmngr \
        gnupg \
        ca-certificates

RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
    && echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | tee /etc/apt/sources.list.d/mono-official-stable.list \
	apt update

RUN apt-get update \
    && apt-get install -y --allow-unauthenticated \
        libc6-dev \
		ffmpeg  \
        libgdiplus \
        libx11-dev
# end install libgdiplus and dependencies

# begin ttf-mscorefonts-installer
RUN echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections \
    && apt-get update \
    && apt-get install -y \
        libfontconfig1 \
        xfonts-utils \
		ttf-mscorefonts-installer fontconfig
# end ttf-mscorefonts-installer

ENTRYPOINT ["dotnet", "DocumentProcessing.POC.dll"]

@m.machet

Could you please share the complete application/project along-with source/problematic file(s)? We’d appreciate if you share a screencast/short video explaining the steps to reproduce the issue.

I’ve uploaded sample project. I’ve added test files to project folder as well though almost all files are throwing one of those exceptions.
DocumentProcessing.POC.zip (1.6 MB)

There is only one page (Convert) within project where you can upload files. After upload file should be converted and displayed in grid below. Everything works fine if you run it on windows machine, but when you use docker to build image:

docker build -t doc-proc-img -f Dockerfile . 

and then you run it:

docker run -it --rm -p 5000:80 doc-proc-img

The exception will be thrown few seconds after upload when conversion is starting.

1 Like

@m.machet

Thank you for the details. We are investigating this scenario. Your investigation ticket ID is CONVERSIONNET-5278. We’ll notify you in case of any progress update.

Were you able to reproduce this issue?

@m.machet

Please follow How to Build in Docker. Following these steps, we cannot reproduce the issue.

When I follow those steps I receive a lot of errors like:
#9 7.967 ERROR: The certificate of ‘nchc.dl.sourceforge.net’ is not trusted.
#9 7.967 ERROR: The certificate of ‘nchc.dl.sourceforge.net’ doesn’t have a known issuer.

@m.machet

It seems that your URL is not trusted. Please install the ca-certificates package. However, if issue persists, please share a short video explaining the steps to reproduce the issue.

@m.machet

Please try GroupDocs.Conversion v23.12 and SkiaSharp 2.88.7. Let us know if issue persists.

<PackageReference Include="GroupDocs.Conversion" Version="23.12.0" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.7" />