Forum Bugs

*** Mercury runtime: caught strange segmentation violation ***

StefanD
Hei!

We started to encounter this error out of nowhere, while running Prince in docker.

*** Mercury runtime: caught strange segmentation violation ***


Couple of weeks ago it didn't have any problems, and it currently runs fine in Production, but any new deployment will break it.

Our Dockerfile looks like this:

FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine AS base
RUN mkdir prince
WORKDIR /prince
RUN apk add --no-cache curl
RUN curl https://www.princexml.com/download/prince-12.5.1-alpine3.10-x86_64.tar.gz -o prince.tar.gz
RUN tar -zxvf prince.tar.gz
#Installs in /usr/local by default
WORKDIR /prince/prince-12.5.1-alpine3.10-x86_64
RUN /bin/echo | ./install.sh
#Remove Prince install
WORKDIR /
RUN rm -rf /prince
#Prince dependencies
RUN apk add --no-cache \
  libxml2 \
  pixman \
  tiff \
  giflib \
  libpng \
  lcms2 \
  libjpeg-turbo \
  fontconfig \
  freetype \
  libgomp \
  libcrypto1.1


I understand from the other topics that the issue would be in the mismatch of the versions.
aspnet:6.0-alpine is on Alpine 3.17 while prince-12.5.1-alpine3.10-x86_64.tar.gz is on Alpine 3.10
Unfortunately, aspnet:6.0.x doesn't have an image for < Alpine 3.13, and Prince 12.5.1 doesn't have a package for anything > Alpine 3.10

We can't update the Prince package right now to newer versions (15.1, for example), because we are worried that our PDF templates will suffer changes that we won't have time to fix.
And we can't downgrade the Net version of our solution Either.

Is there a way to fix this issue in this version?
mikeday
This seems like the kind of problem that containerisation was designed to solve rather than create! :D

So it's not possible to run Prince inside a different container? Can you run a container inside another container?
StefanD
Ah, our current code requires Prince to be installed in the same container the application runs in.
We haven't thought about having Prince in another container. I am not sure how it will work. We will give it a try.

But before that, we will try to get our hands on a Alpine3.10 image and install Net6.0 required packages, from scratch, instead of using the available image from Microsoft. I hope it won't become a monstrosity.

I assume there is no way of fixing this issue alone, right?

And thank you!