ENGINE-16004 Exception while closing command context: Error while evaluating expression

Hello Everyone,

I am getting the below error while my GitHub Pipeline tries to build the process application. But build is successful locally in IntelliJ.

ENGINE-16004 Exception while closing command context: Error while evaluating expression: ${plausiueberwachungEskalationService.verschickeEskalationsmails()}. Cause: java.lang.Error: Probable fatal error:No fonts found.

Can someone help me here to resolve this issue.

Hi @MohanReddy and welcome to the forum.
The problem here seems to be something in your underlying service, which you’re calling.
From the exception I would say, you are using some library that needs fonts on the os. Locally that’s no problem, but your build server is probably headless and has no corresponding fonts installed.
Is this exception happening during testing?
If so then maybe it would be better to mock the real functionality in the unit test.

Hi @rohwerj ,

Thanks for the information.

Then in this case GitHub server which is building the application does not have fonts installed?

I am using the GitHub pipeline to build the process application. GitHub pipeline will trigger soon after I push the code into my repository.

Yes there will definitely be no fonts on the github runner, as that is running headless.
As I said mock that call to some library, which needs the fonts, in your unit test (at least that’s still what I think it is, where this code is called).

Hello @rohwerj,

I am calling the code from Junit Testing.
Actually, I have a service task which is using Expression for setting up one of the variables. While Evaluation it will call the One of the Service which will produce the PDF document. While Preparing the PDF document. I am getting the sun Microsoft fonts are not available.

Something directly related to Preparing/Generating PDF document?

For generating PDF documents you probably need fonts.
So I think you have two possible alternatives:

  1. Mock away the creation of the PDF document to just test the process and how the token moves
  2. Move the build of your project to a github runner where fonts are installed

Also look at the library whether you can provide fonts as resources on the classpath and not rely on those installed on the operating system. Might also be an option.

Hello @linforestzhang,

But same functionality has been working from long ago. All of a sudden GitHub pipeline giving me error that it can’t find the fonts. It is because of missing fonts from server, I think.

Hello @rohwerj,

Thanks for the information. I will try possibilities which you have mentioned above.