Aspose.PDF throwing exception in Docker Container for windows

Getting this exception when using Evaluation Mode license and running in Windows Docker but work fine outside of docker.

Environment Information:
Docker Image Base: dotnet-framework/4.8-sdk-windowsservercore-ltsc2019
OS: Windows
Project: Asp.Net Target=.NET Framwork 4.7.2
Operation: Redering PDF
License: Evaluation Mode

Aspose SDK Version: Aspose.PDF v20.2.0

Question: Is there any limitation with Evaluation Mode while running in Windows Docker Container? Everything works fine outside the docker.

Note: If I set a license then it works fine too, the problem is only when license is not set / running in evaluation mode

 {
   "InnerError":{
      "trace":[
         " at #=zi1LvgbvkRtxlp_zxb0OPQyVVSZ8l.#=zoUp$vS8=(#=z3K6zfq3kEPq7Q7$7PjA62_4A$urm #=zokgkXC$dh0fR)",
         " at #=zJSSzwjiNwoh4o7Go2NoBnME=.#=zL4cbVA0=(#=z3K6zfq3kEPq7Q7$7PjA62_4A$urm #=zokgkXC$dh0
fR)",
         " at #=qlczIX87z9z4ILkua$IQvb09DRubaYPD50nP2WH5BU8o=.#=zZ0Rg$XldKC5A0k$D2_sct18=(Object #=zS_LLokg=)",
         " at #=qlczIX87z9z4ILkua$IQvb09DRubaYPD50nP2WH5BU8o=.#=zf_anGA927ikLyJdB0QrURBWJfOaa(MethodBase #=zS_LLokg=
, Boolean #=zF9KnC$Q=)",
         " at #=qlczIX87z9z4ILkua$IQvb09DRubaYPD50nP2WH5BU8o=.#=zKt3KHYK1G$XL1u8S2fIIDrkOxspqLhr9O5xNnyCblFAL(#=qlczIX87z9z4ILkua$IQvb09DRubaYPD50nP2WH5BU8o= #=zS_LLokg=, #=qn4I72mRO2A6RnW4nnAmo6dTkPq6
IMI3AOl8u2l_8FCU= #=zF9KnC$Q=)",
         " at #=qlczIX87z9z4ILkua$IQvb09DRubaYPD50nP2WH5BU8o=.#=zPtx6Ua$6RJTdL8JA14nneO8x0Vg629Wvu6YllsY=()",
         " at #=qlczIX87z9z4ILkua$IQvb09DRubaYPD50nP2WH5BU8o=.#=zAP80U2BbSEiwoLa8wBc$itQ=(B
oolean #=zS_LLokg=)",
         " at #=qlczIX87z9z4ILkua$IQvb09DRubaYPD50nP2WH5BU8o=.#=zZ0Rg$XldKC5A0k$D2_sct18=(Object #=zS_LLokg=)",
         " at #=qlczIX87z9z4ILkua$IQvb09DRubaYPD50nP2WH5BU8o=.#=z1zVBQrvNnjHOHsiajrAKh98=()",
         " at
#=qlczIX87z9z4ILkua$IQvb09DRubaYPD50nP2WH5BU8o=.#=zUb3z3Y4DpONSJkIPA$$SyFM=(#=qlczIX87z9z4ILkua$IQvb09DRubaYPD50nP2WH5BU8o= #=zS_LLokg=, #=qn4I72mRO2A6RnW4nnAmo6dTkPq6IMI3AOl8u2l_8FCU= #=zF9KnC$Q=)",
         " at #=qlczIX87z9
z4ILkua$IQvb09DRubaYPD50nP2WH5BU8o=.#=zPtx6Ua$6RJTdL8JA14nneO8x0Vg629Wvu6YllsY=()",
         " at #=qlczIX87z9z4ILkua$IQvb09DRubaYPD50nP2WH5BU8o=.#=zAP80U2BbSEiwoLa8wBc$itQ=(Boolean #=zS_LLokg=)",
         " at #=qlczIX87z9z4ILkua$IQv
b09DRubaYPD50nP2WH5BU8o=.#=zZ0Rg$XldKC5A0k$D2_sct18=(Object #=zS_LLokg=)",
         " at #=qlczIX87z9z4ILkua$IQvb09DRubaYPD50nP2WH5BU8o=.#=z1zVBQrvNnjHOHsiajrAKh98=()",
         " at #=qlczIX87z9z4ILkua$IQvb09DRubaYPD50nP2WH5BU8o=.#=z
dvuZe9cqCW9c1HI8wpfgtkrOHGgHBpb7cbxVohH_TZjz(Object #=zS_LLokg=, UInt32 #=zF9KnC$Q=)",
         " at #=qlczIX87z9z4ILkua$IQvb09DRubaYPD50nP2WH5BU8o=.#=zAP80U2BbSEiwoLa8wBc$itQ=(Boolean #=zS_LLokg=)",
         " at #=qlczIX87z9z4ILkua$
IQvb09DRubaYPD50nP2WH5BU8o=.#=zAP80U2BbSEiwoLa8wBc$itQ=(Boolean #=zS_LLokg=)",
         " at #=qlczIX87z9z4ILkua$IQvb09DRubaYPD50nP2WH5BU8o=.#=z6mwrgnFNWtZwSzi$Cr31Cb8h7Hwp()",
         " at #=qlczIX87z9z4ILkua$IQvb09DRubaYPD50nP2WH5B
U8o=.#=zrJrMDF35RxLXy4P9ok8LG0I=(Object[] #=zS_LLokg=, Type[] #=zF9KnC$Q=, Type[] #=zVvdDRyo=, Object[] #=zf_I0C9s=)",
         " at #=qlczIX87z9z4ILkua$IQvb09DRubaYPD50nP2WH5BU8o=.#=zkNaZI_XYMKWMFb642w==(Stream #=zS_LLokg=, S
tring #=zF9KnC$Q=, Object[] #=zVvdDRyo=, Type[] #=zf_I0C9s=, Type[] #=zMNDuFtc=, Object[] #=z_r_xOi8=)",
         " at #=qlczIX87z9z4ILkua$IQvb09DRubaYPD50nP2WH5BU8o=.#=z6ZCKeExkLwi7LZkXKPw$mdU=(Stream #=zS_LLokg=, String #=zF
9KnC$Q=, Object[] #=zVvdDRyo=)",
         " at #=qlczIX87z9z4ILkua$IQvb09DRubaYPD50nP2WH5BU8o=.#=zN1cvYXpRCU2RNi0rsAt98TelMhr2Q_WHlg==(Stream #=zS_LLokg=, String #=zF9KnC$Q=, Object[] #=zVvdDRyo=)",
         " at Aspose.Pdf.Document.#
=zmhYEcYtr55PP(Stream #=zDrP5f$U=, SaveOptions #=zeDggTR053dpK)",
         " at Aspose.Pdf.Document.Save(Stream output)",
         "--- End of stack trace from previous location where exception was thrown ---",
         " at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)",
         " at System.Run
time.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)",
         " at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()",
         "--- End of stack trace from previous location where exception was thrown ---",
         " at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)",
         " at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)",
         " at System.Runtime.CompilerSe
rvices.TaskAwaiter`1.GetResult()",
         "--- End of stack trace from previous lo
cation where exception was thrown ---",
         " at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)",
         " at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task t
ask)",
         " at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()",
         "--- End of stack trace from previous location where exception was thrown ---",
         " at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSucces
s(Task task)",
         " at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)",
         " at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()",
         "--- End of stack trace from previous location where e
xception was thrown ---",
         " at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)",
         " at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)",
         " at S
ystem.Runtime.CompilerServices.TaskAwaiter`1.GetResult()",
         "--- End of stack trace from previous location where exception was thrown ---",
         " at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)",
         " at System.Runtime.CompilerServices.TaskAwa
iter.HandleNonSuccessAndDebuggerNotification(Task task)",
         " at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()","--- End of stack trace from previous location where exception was thrown ---",
         " at System.Runtime.CompilerServi
ces.TaskAwaiter.ThrowForNonSuccess(Task task)",
         " at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)",
         " at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()",
         "--- End of stack trace from previ
ous location where exception was thrown ---",
         " at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)",
         " at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(
Task task)",
         " at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfIActionResultExecutor.<Execute>d__0.MoveNext()",
         "--- End of stack trace from previous location where exception was thrown ---",
         " at Syst
em.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)",
         " at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)",
         " at Microsoft.AspNetCore.Mvc.Internal.Con
trollerActionInvoker.<InvokeActionMethodAsync>d__12.MoveNext()",
         "--- End of stack trace from previous location where exception was thrown ---",
         " at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task)",
         " at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)",
         " at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextActionFilterAsync>d__10.MoveNext
()",
         "--- End of stack trace from previous location where exception was thrown ---",
         " at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)",
         " at Microsoft.AspNetCore.Mv
c.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)",
         " at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeInnerFilterAsync>d__13.MoveNext()",
         "--- E
nd of stack trace from previous location where exception was thrown ---",
         " at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)",
         " at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuc
cessAndDebuggerNotification(Task task)",
         " at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeNextExceptionFilterAsync>d__24.MoveNext()"
      ],
      "detail":"Object reference not set to an instance of an object."
   }
}

@slalchandani

There is no such limitation in the API for docker environment. However, please make sure that you have all windows fonts installed in the docker environment. In case the issue still persists, please share the sample code snippet along with the docker file. We will test the scenario in our environment and address it accordingly.

@asad.ali Thanks for the response but it seems to be something else, I can verify the fonts thing too. If I set a license then it works fine , the problem is only when license is not set / running in evaluation mode

@slalchandani

We need to properly investigate the scenario in our environment as evaluation version of the API implements certain restrictions. Would you please share sample PDF, code snippet and your docker file with us. We will log an investigation ticket to determince the cause of the issue you are facing and share the ID with you.

@asad.ali I would work on getting that piece of code and sample PDF but would you be able to give some examples of those restrictions? That will help in a quick assessment at my end. Thanks

@slalchandani

The trial version of the API implements restrictions according to them API will only process 4 elements of any collection which can be both internal and exposed Classes i.e. Pages, Fonts, TextFragments, Annotations, etc. In your particular environment, it is hard to say what is causing the issue due to this restriction. We hope shared information may help you finding the reason at your own. Please feel free to get back to us with requested information so that we can also investigate the reasons behind it.

@asad.ali

I tried several things at my end to figure out the cause but couldn’t find it. I am attaching the sample piece of project that will reproduce the same issue. AsposeSampleProject.zip (410.9 KB). This package contains the .net project and docker file.

How to execute:

  1. Navigate To “AsposeSampleProject” folder
  2. Build a docker container, RUN command ‘docker build -t aspose -f Dockerfile .’
  3. Start Docker container, RUN command ‘docker run -it --rm aspose’
  4. This will start docker container and brings you inside C:\app directory
  5. Run the project, RUN command ‘dotnet run --project AsposePDFSampleProject\AsposePDFSample\AsposePDFSample.csproj’

@slalchandani

We have logged an investigation ticket as PDFNET-48692 against your case in our issue management system. We will further analyze it in details and inform you as soon as it is resolved. Please be patient and spare us some time. Meanwhile, would you please also try using Aspose.PDF for .NET 20.8 and let us know if issue still occurs with it.

@asad.ali Any updates on this? We still have that issue. It’s the same for newer version too

@slalchandani

We are afraid that earlier logged ticket could not get investigated yet due to other issues logged prior to it. We will surely investigate and close this ticket on first come first serve basis and update you within this forum thread as soon as we have some news in this regard. Please give us some time.

We are sorry for the inconvenience.

A post was split to a new topic: Aspose.CAD throwing exception in Docker Container for windows