Unable to export or email a view as PDF, Image, HTML - Linux Platform
Issue:
Unexpected error when trying to export/email a view as PDF, Image, HTML
Error trace:
Caused by: javax.servlet.ServletException: com.phantomjs.export.server.ServerNeedKillingException: ServerNeedKillingException:
Exception in phantom export :: Stack Trace java.lang.RuntimeException: Error, PhantomJS could not start CUSTOM_EXPORT_SERVER_PORT=9971
at com.adventnet.zoho.db.exportutil.ZDBExportServlet.doExport(ZDBExportServlet.java:388)
at com.adventnet.zoho.db.exportutil.ZDBExportServlet.serviceExport(ZDBExportServlet.java:306)
... 52 moreAfter 5 failure attempts of export, below error trace will be thrown in serverout.
Caused by: javax.servlet.ServletException: com.phantomjs.export.server.ServerNeedKillingException: ServerNeedKillingException:
Exception in phantom export :: Stack Trace java.lang.RuntimeException: Not enough port available
at com.adventnet.zoho.db.exportutil.ZDBExportServlet.doExport(ZDBExportServlet.java:388)
at com.adventnet.zoho.db.exportutil.ZDBExportServlet.serviceExport(ZDBExportServlet.java:306)
... 52 more
Cause:
PhantomJS server will not start automatically in Ubuntu 22 LTS because of "openssl v3.0"
Note:

Kindly verify the openssl version is 3.0 and above by executing the below command in terminal.
> openssl version
Solution:
Open Terminal and execute "sudo nano /etc/ssl/openssl.cnf"
Comment the following two line in '/etc/ssl/openssl.cnf' file by adding '#' infront of it.

providers = provider_sect
ssl_conf = ssl_sect (If present, comment it)
save the changes (ctrl+o -> enter -> ctrl+x)
Restart the AnalyticsPlus service.
If the issue still persist, open the terminal in "<Analytics>/bin" location and execute the following command in Terminal to start the PhantomJs server.

./../bin/phantom/linux/phantomjs --config=<AnalyticsPlus location>/webapps/ROOT/customExport/config.json --ignore-ssl-errors=false <AnalyticsPlus location>/webapps/ROOT/customExport/ExportLib.js -port 9970 -libpath <AnalyticsPlus location>/webapps/ROOT/customExport/lib/ -modulepath <AnalyticsPlus location>/webapps/ROOT/customExport/modules/
Replace the <AnalyticsPlus location> in the above command with the AnalyticsPlus installation location.
If there is an error when trying to start the PhantomJs server, "error while loading shared libraries: libfontconfig.so.1", execute below command and then try to start the PhantomJS server.


sudo apt-get install libfontconfig
If the issue still persist, verify whether the below property key in Analytics/conf/app.propertis is the same as the AnalyticsPlus installed location.

app.contextPath=/home/local/ZOHOCORP/ManageEngine/AnalyticsPlus/webapps/ROOT
If the location mentioned in the above property key is different, then execute the "sh ServerMigration.sh" command.