• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

PDF Service Manager not enabling on Azure Container Instance Linux Server

Explorer ,
Sep 17, 2022 Sep 17, 2022

Copy link to clipboard

Copied

I have Azure Container Instance running Coldfusion 2021 on Linux Server.

I am getting Connection verification failed for PDF Service Manager: localhost.
Connect to 127.0.0.1:8993 [/127.0.0.1] failed: Connection refused (Connection refused) http://127.0.0.1:8993/PDFgServlet/verify

 

How to resolve this issue?

 

 

Thanks,
Souvik

Views

320

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 17, 2022 Sep 17, 2022

Copy link to clipboard

Copied

When you installed cf, did you check the option to enable the pdfg service? That was on the page for enabling solr, pdfg, .Net, etc. If you did not, you can get an installer for that from the Adobe cf downloads page.

 

If you HAVE implemented it, is it running? It's a separate process/service from cf.

 

If it's running, is it listening on that port 8993 that you show?

 

Let us know if you need details on any of the above. 


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 17, 2022 Sep 17, 2022

Copy link to clipboard

Copied

Charlie,

I installed this image adobecoldfusion/coldfusion:latest.

When I tried to verify, I got this error.

SouvikSahaChoudhury_0-1663431342871.png

Do I need to do anything else?

 

Thanks,
Souvik

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 17, 2022 Sep 17, 2022

Copy link to clipboard

Copied

Sorry. It wasn't readily clear you were using the Adobe CF container image. So have you followed the details and examples offered by Adobe for how to run the pdf service within the cf container? See https://helpx.adobe.com/coldfusion/using/docker-images-coldfusion.html.

 

Note how it's necessary to run NOT ONLY the CF container, but also you need to run the separate CF "addons" container, and point the CF container at that. (This is just a twist on what I was saying above: how with traditional CF installation, that too has both CF itself and a separate "add on" service.)

 

The doc page I point to above discusses how to setup a docker compose file that has both running, and also shows setting the environment variables in the CF container that point to the addons running in the other container.

 

If you would like a different presentation of a working example, I offer one myself, as part of my "Awesome CF Compose" project on github. You will see there that I offer many different examples of the CF Docker images, including one specifically with the heading, "ColdFusion with Solr and and PDFg (CFHTML2PDF) features enabled".

 

You'll see it's the docker-compose.yml (which may be all you really need), which shows the setup of the two containers, as well as the env vars needed for each, including naming the cf2021 module called htmltopdf which is needed to use the PDF feature. (You may already know about that, as you show using the PDF Service page working in the admin.)

 

Finally, I also show there an example with a cfhtmltopdf call that works, using those containers, in a subfolder called demo-pdfg, within the container's /app, which you may already know is where the CF images look for code to run within the container.

 

Let us know if that gets you going.


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 19, 2022 Sep 19, 2022

Copy link to clipboard

Copied

Charlie,

Thanks for your reply.

I want to build the image with Dockerfile.

Is there any reference for that?

Thanks,
Souvik

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 19, 2022 Sep 19, 2022

Copy link to clipboard

Copied

First good news: yes, the same cf help page I point to above happens to show using the cf image via a dockerfile.

 

That said, the info you need is indeed in the compose files. You'd just want to create one dockerfile for each of the two images, cf and add-ons. 

 

So to that I'm curious, since you didn't connect those dots. Is it that you are deploying via Azure in such a way that you never test locally before deploying?  You only push dockerfiles to Azure?

 

You could help yourself tremendously by having your own docker implementation, where you could get working with things via compose (especially when having containers talk to each other). Even if you can't or don't want to use "production info locally", the point is that you could resolve a lot of problems like your original one  above by doing that.

 

And like cf itself, use of the cf images for development is free, so there's no licensing cost. Just a matter of you setting up a local docker (and compose). I realize you may not care to bother. I'm writing this both if you may be pursuaded, and then also for others who may find this discussion. 🙂

 

All that said, I will consider expanding my github project to cover more than compose. I was building off the far larger and very popular awesome-compose github repo, since I wanted to show far more than a single sample cf setup, and I suspected they'd not welcome that. 

 

Let us know if the docs (and perhaps reconsidering what's in the compose files) may get you going, or not. 


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 19, 2022 Sep 19, 2022

Copy link to clipboard

Copied

Charlie,

Thanks for your reply.

I build and test locally. But I only use Dockerfile, not docker-compose.yml as I build the image by Dockerfile in Azure pipeline. 
Is there any way that I can use Dockerfile only?

 

Thanks,
Souvik

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 20, 2022 Sep 20, 2022

Copy link to clipboard

Copied

Can both images be combined into a single container?

 

Thanks,
Souvik

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 20, 2022 Sep 20, 2022

Copy link to clipboard

Copied

In a word, no. But as is usually the case, there's far more to be said--and for you to consider, to get you to the right solution for you. 

 

First, if you do more study of containerized deployment, you'll find this challenge (wanting to put two services into one container, and why it's frowned upon) is not at all unique to cf but instead a common challenge for folks moving to containers.

 

Folks have often wanted to run a web server and an app server (like cf or tomcat, or even node and more) in a single image/ container. Or maybe they want to run the app server and the db in one. Or all 3.

 

The thing is, containers are NOT lightweight vms, suited to running many things at once: they are designed such that each container serves a single purpose, a single primary process (PID 1, in linux terms).

 

As such, much about container deployment presumes that approach, so that trying to to shoehorn two or more server processes into one image/container is an anti-pattern. You can certainly TRY to force it with the cf and add-ons containers, but nothing from Adobe will show how to do it. 

 

And usually when faced with such a challenge, it's time to perhaps question your own presumptions and choices. 🙂 And even sticking with Azure, you have more choices than just ACI. 

 

But let me note first that there ARE resources showing deployment of Docker Compose into ACI, such as:

 

 

Or if one was ardently uninterested in using compose files, Azure also supports multi-container deployments on ACI via a simple yaml file:

https://learn.microsoft.com/en-us/azure/container-instances/container-instances-multi-container-yaml

 

BUT ACI has its own warts and may not really be the best (or most economical) way to deploy containerized web apps on Azure.

 

Have you looked also at Azure web apps for containers (under Azure app service), which also supports multi-container deployment (whether via compose or not):

 

https://learn.microsoft.com/en-us/azure/app-service/quickstarts multi-container

 

And you mention wanting to use Azure pipelines. Here's a tutorial on using that to run multi-container deployments on that Azure app service:

 

https://learn.microsoft.com/en-us/training/modules/deploy-kubernetes/

 

Another is:

https://techcommunity.microsoft.com/t5/windows-dev-appconsult/automate-the-deployment-of-a-multi-con...

 

Or consider instead the newer Azure container apps, which is out of preview only this year:

 

https://learn.microsoft.com/en-gb/azure/container-apps/overview

 

Or see also:

 

 
Depending on your ultimate use case for containerized cf (dev? testing? prod? short-lived? 24x7), either of these options could be far cheaper to run than ACI. 
 
To be clear, under the covers those both offer an implementation of a very opinionated kubernetes deployment - - without you having to know much about k8s. That's a pro to some, a con to others. But each different implementation (from ACI to those to the others) offers different/generally increasing capabilities. 
 
Then of course there's the option to run full-blown kubernetes in Azure, for those who may need it, as in AKS. 
 
FWIW, the author of that last post has one that offers an overview of several ways to run containers in Azure, in 2022:
 
 
Let us know how you end up going, if at all. 

/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 21, 2022 Sep 21, 2022

Copy link to clipboard

Copied

Charlie,

Thanks for your reply.

 

I only deployed ColdFusion image to a Azure Container Instance. I also added PDF service from another server but still, I am getting Error occurred while generating PDF. Reason: SERVER ERROR.

This is the stacktrace

coldfusion.document.webkit.PDFgErrorHandler$ServiceManagerConversionException: Error occurred while generating PDF. at coldfusion.document.webkit.PDFgErrorHandler.handleConversionError(PDFgErrorHandler.java:190) at coldfusion.document.webkit.HttpPDFRequestHandler.requestPDFGeneration(HttpPDFRequestHandler.java:178) at coldfusion.tagext.htmltopdf.HtmlToPdfTag.processPDFgRequest(HtmlToPdfTag.java:1149) at coldfusion.tagext.htmltopdf.HtmlToPdfTag.handlePDFgConversionRequest(HtmlToPdfTag.java:1299) at coldfusion.tagext.htmltopdf.HtmlToPdfTag.convertToPDF(HtmlToPdfTag.java:1236) at coldfusion.tagext.htmltopdf.HtmlToPdfTag.doEndTag(HtmlToPdfTag.java:1412) at cftestpdf2ecfm1365772212.runPage(/app/wwwroot/devX/repository/wwwroot/testpdf.cfm:17) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:257) at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:749) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:578) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:5201) at cfApplicationFramework2ecfc851807315$funcONREQUEST.runFunction(/app/wwwroot/devX/repository/framework/ApplicationFramework.cfc:159) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:623) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:553) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:516) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:463) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:438) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:310) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:975) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:696) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:503) at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:115) at coldfusion.runtime.AppEventInvoker.onRequest(AppEventInvoker.java:308) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:569) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:43) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:162) at coldfusion.filter.IpFilter.invoke(IpFilter.java:45) at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:30) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:97) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:60) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62) at coldfusion.CfmServlet.service(CfmServlet.java:231) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:311) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:46) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:47) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at coldfusion.inspect.weinre.MobileDeviceDomInspectionFilter.doFilter(MobileDeviceDomInspectionFilter.java:57) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:47) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.rewrite.RewriteValve.invoke(RewriteValve.java:555) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:377) at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:463) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:889) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Thread.java:835)

 

Thanks,
Souvik

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 21, 2022 Sep 21, 2022

Copy link to clipboard

Copied

I tried with 2 Windows servers and sometimes got the same issue, sometimes working.

It's just for testing purposes I was checking.

Thanks,
Souvik

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 21, 2022 Sep 21, 2022

Copy link to clipboard

Copied

OK, so you are now switching gears, right? Instead of trying to get the CF and addons containers both running on Azure, you are saying you are just telling the CF Admin "pdf services" page in your CF container on Azure to point to some OTHER server, right?

 

If so, your next challenge is to find if there's any problem REACHING that server from your CF container on Azure. You could have any number of things blocking that. 

 

I would recommend you go to that CF Admin (in the container), to that PDF Services page, and note the servername and port of the "other" server. Don't trust your memory.

 

First, try to call a url with that info from your browser (outside of the container and Azure, I mean). Don't worry about any filename. If it's responding and accessible to you, you should see a page with a link to "pdgservlet". That's all we want to test, first. (Don't click the link. It will get a 400 bad request. That's to be expected.)

 

But you can't stop there (whether you get that page with the pdfgservlet link or not). We now need to know if CF in the container can reach it.

 

So next, create a test page on that container that does a cfhttp call to that server and port, and dump the result. What do you see. To be clear, if the server was "myserver.com" and the port was 8993, do:

<cfhttp url="http://myserver.com:8993">
<cfdump var="#cfhttp#">

What does it show? If THAT somehow fails to reach the server and return the html with the link to the pdfgservlet, then something is blocking your reaching it. It's NOT then a "problem with the CF Admin" or with the cfhtmltodPDF.

 

If it DOES work, and DOES return that html, then show it to us and we can try to proceed from there.

 

Let me add that if it does NOT work, change the URL you are requesting in the cfhttp to be https://google.com. If that fails also, then you are just running into a limitation in Azure ACI where you can't access ANYthing outside of the container. They could set it up that way, for security sake. If that's the issue, you will need to dig into your ACI setup to solve it. I have no current insight into that.

 

But I just want to say this is getting far afield of the original question. You showed that as being you trying to use localhost:8993, from within the container, which  implied you were expecting the PDF service to be WITHIN that container. I explained how it was not, and how you would need to setup another container. I even elaborated on the means to do that. 

 

But now you seem to be punting on all that and saying, "well, I just want to see if I can get to ANOTHER PDF service from within the container". That's really an entirely different problem. I've tried to answer it here, but I'm clarifying this change of direction for you and anyone trying to follow along.


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 22, 2022 Sep 22, 2022

Copy link to clipboard

Copied

Charlie,

Thanks for your reply.

 

This is the browser output.

SouvikSahaChoudhury_0-1663830009452.png

This is the cfhttp output.

SouvikSahaChoudhury_1-1663830188343.png

I got the same when tried from the Windows machine also.

 

Thanks,
Souvik

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 22, 2022 Sep 22, 2022

Copy link to clipboard

Copied

LATEST

I tried 2 containers also. One for Coldfusion and another for Addon. But I got the same issue.

 

Thanks,
Souvik

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation