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

ColdFusion 2016 Update 17 Docker - Facing Simlink Issue

New Here ,
Jul 29, 2021 Jul 29, 2021

Copy link to clipboard

Copied

We are running CF 2016 update 17 docker image. CF Admin trying to use Simlink feature in Tomcat using file /opt/coldfusion/cfusion/runtime/conf/server.xml

 

CF Admin added <Resources allowLinking="true" to get simlink working,

When we are restarting the container, the file is getting replaced by the default file. 

If i'm trying to mount this file using file-mapping, then CF container isn't strating successfully. showing this:

 

[000] Checking server startup status...

[000] Checking server startup status...

[000] Checking server startup status...

[000] Checking server startup status...

[000] Checking server startup status...

[000] Checking server startup status...

 

Can someone advise how to get arounf with this issue?

Views

816

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 ,
Jul 29, 2021 Jul 29, 2021

Copy link to clipboard

Copied

That's an interesting challenge, and the containers do usually just work, but since you're trying to mess with the server.xml, that can make things brittle.

 

First, as for the error you're getting (when the container has been "restarted" as you say), and it's showing those "checking" messages, have you tried to view the coldfusion-error.log, while the container was running?

 

I suspect there will be an error in there (or perhaps in the coldfusion-out.log, though it may well be empty, which is its own sign of a problem). As you may know, you can view a file within a running container by using the docker EXEC command, as in:

 

docker exec [containerid] cat /opt/coldfusion/cfusion/log/coldfusion-error.log

 

 

The error you find may or may not help.  I have more thoughts below, which may explain what you see, but there are more questions than answers....

  • when you say you are running a cf2016 u17 image, do you mean the ones obtained from the bintray site before it closed? or might you mean some image you created otherwise yourself? (I am assuming you don't mean a commandbox CF docker image.) It will be important to know we are talking about those official Adobe CF images or not.
  • when you refer twice to "cf admin", it sounds like you may mean to be referring to a person (whoever set up your use of this docker image), rather than THE cf admin (the web ui for configuring cf). Can you confirm that?
  • when you say that this person added a Resources element to allowlinking, do you mean you added that as new element within the Host element, outside of the commented-out Resources tags that are already in that file?
  • And do you mean they modified the image, perhaps copying in the file, using a dockerfile? 
  • I ask because when you start that official CF image (of 2016 update 17), I can confirm that the mere start of the container adds to the server.xml a set of 3 resources lines within a new context (compared to looking at the file in the image, BEFORE creating a container). These are the lines that are added by the startup of the container (adding virtual directories for CFIDE, cf_scripts, and WEB-INF):
    • <Context path="" docBase="/app" WorkDir="/opt/coldfusion/cfusion/runtime/conf/Catalina/localhost/tmp">
         <Resources>
            <PreResources base="/opt/coldfusion/cfusion/wwwroot/CFIDE" className="org.apache.catalina.webresources.DirResourceSet" webAppMount="/CFIDE"/>
            <PreResources base="/opt/coldfusion/cfusion/wwwroot/cf_scripts" className="org.apache.catalina.webresources.DirResourceSet" webAppMount="/cf_scripts"/>
            <PreResources base="/opt/coldfusion/cfusion/wwwroot/WEB-INF" className="org.apache.catalina.webresources.DirResourceSet" webAppMount="/WEB-INF"/>
         </Resources>
      </Context>
  • But notice there's no allowlinking added by that, so again I am trying to make sure you mean that YOU are modifying that file before the image starts. Or in fact are you modifying it AFTER it starts? If you may be modifying it BEFORE it starts, does your version of the file have those important lines?
  • When you say "we are restarting the container, the file is getting replaced by the default file.", you mean that you are doing something to look inside the container (like a docker exec, perhaps), and you are looking at the contents of the server.xml file, and it no longer has this modification you added? You could do that with the cat above, against /opt/coldfusion/cfusion/runtime/conf/server.xml
  • Again, if you added your modifications BEFORE the container started, then note that the container startup IS modifying these lines above once you find it running. Confirm if your mods are there WHEN it is running.
  • And when you say you are restarting the container, you do mean you are literally doing a docker restart on the container? (Or the equivalent in docker compose or kubernetes?) I just want to be sure we're all on the same page about what "restart" you do mean. And are you comparing the file before and after that restart? (Again, you can use that docker exec to cat the file to see it.)
  • Finally, when you say you've tried to mount this file as a mapping, I assume again you do mean the server.xml specifically, and that you are trying to do this as a solution/alternative for the problem you are observing, right? And you mean that when you do the mount, you find that the container now won't even start (let alone restart)? 
  • About the mount, how are you doing it? On the Docker run? In a compose file? Show us the volume mount specification. Perhaps we may observe something
  • And have you tried to view the server.xml (as mounted) once the container is running, even while getting the error you reported? What does the file's contents show? Maybe you will find it's not what a server.xml should look like, for some reason.
  • (I wondered if the problem may be that your mapping was read-only, and as the container would want to write to the file--to add those several lines as I've shown above--it might fail because it can't. But I tried that, and while it did fail to start, it did not show the error you show.)

 

Again, what you see in the coldfusion-error.log (or coldfusion-out.log) in the running container may confirm what I am suspecting above. Let us know what you find. Sorry for the brain dump, but again there can be enough challenges solving ANY problem within a container, but it's all the more challenging when you may be trying to fiddle with something as fundamental as the server.xml (for Tomcat or CF).


/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
New Here ,
Jul 30, 2021 Jul 30, 2021

Copy link to clipboard

Copied

Hi, thanks for responding to my issue ... Let me try to explain questions

 

1. I downloaded tar file of docker image downloaded from CF official download page. It wasn't from bittray site but from alternet location provided by adobe.  https://helpx.adobe.com/coldfusion/using/docker-images-coldfusion.html

 

2. Yes, i intentionally mentione it, as i'm not CF Admin, and having limited knowledge of CF administration. I'm assisting one of my co-worker to move CF from standalone server to docker-based deployment in Kubernetes. We got it running in Kubernetes, but facing issue with some of application which requires Simlink. CF Admin is try to get it working via putting allowLinking="true" in server.xml but having issues. the file is getting back to it's original state everytime POD restarts. So, we tried mounting it externally, means saved copy of file in a kubernetes PVC, and try mounting it at /opt/coldfusion/cfusion/runtime/conf/server.xml via it's Deployment Config. So that everytime POD restarts it gets modified file. But like i have explained it in issue description, CF is unable to start.

 

3. I also tried created new Dockerimage with file modified file copied to it, and it shows me same issue. I used this for Dockerfile:

 

[root@cf]# more Dockerfile
FROM coldfusion:2016.0.17
COPY server.xml /opt/coldfusion/cfusion/runtime/conf/server.xml
[root@cf]#

 

4. [[But notice there's no allowlinking added by that, so again I am trying to make sure you mean that YOU are modifying that file before the image starts. Or in fact are you modifying it AFTER it starts? If you may be modifying it BEFORE it starts, does your version of the file have those important lines?]] that's the great idea, and i'm looking for if there's same way to add allowlining option after CF starts. Please advise if this can be done via some means. So far, we are putting it during container start, means before CF starts.

 

5. Since mounting file extenally doesn't work, so if we copy file to replace existing /opt/coldfusion/cfusion/runtime/conf/server.xml file, and restart CF, without restarting container, then it seems works. But as soon as i restart container, the file i manually copied is gone and i'm back to original version of it without simlink, as explained above.

6. [[And when you say you are restarting the container, you do mean you are literally doing a docker restart on the container? (Or the equivalent in docker compose or kubernetes?) I just want to be sure we're all on the same page about what "restart" you do mean. And are you comparing the file before and after that restart? (Again, you can use that docker exec to cat the file to see it.)]] We are running it within Kubernetes. Openshift platform.

7. [[Finally, when you say you've tried to mount this file as a mapping, I assume again you do mean the server.xml specifically, and that you are trying to do this as a solution/alternative for the problem you are observing, right? And you mean that when you do the mount, you find that the container now won't even start (let alone restart)? ]]

container is getting started, but CF unable to comeup successful. Here's log msg i'm getting:

 

section of Deployment Config

`````````````

terminationMessagePolicy: File
volumeMounts:
- mountPath: /opt/coldfusion/cfusion/runtime/conf/server.xml
name: volume-2d83n
subPath: cf-test/server.xml

dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
serviceAccount: useroot
serviceAccountName: useroot
terminationGracePeriodSeconds: 30
volumes:
- name: volume-2d83n
persistentVolumeClaim:
claimName: configfilevol

```````````````````````````````````````````````

``````````````````````````````````````````````

[root@cf]# oc get pod
NAME READY STATUS RESTARTS AGE
coldfusion-d1-15-qvwzf 1/1 Running 1 54d
coldfusion-p-18-wc9zp 1/1 Running 0 1d
coldfusion-q-63-f4rxc 1/1 Running 0 18h
coldfusion-qt-14-8mhqr 1/1 Running 0 1m                             <<< ------this one see it's running
httpd-coldfusion-temp-1-build 0/1 Completed 0 41d
httpd-coldfusion-temp-2-57m2z 1/1 Running 0 1d
jenkins-cf-15-tgnmr 1/1 Running 1 54d
[root@cf]#

`````````````````````````````````````````````````````````````

 

Logs:

`````````````````````````````````

[root@uswix622 cf]# oc logs coldfusion-qt-14-8mhqr
Updating webroot to /app
Configuring virtual directories
Skipping password updation
Skipping language updation
Updating serial key..
Previous Serial Key: Not Provided
Starting ColdFusion
Starting ColdFusion 2016 server ...
The ColdFusion 2016 server is starting up and will be available shortly.
======================================================================
ColdFusion 2016 server has been started.
ColdFusion 2016 will write logs to /opt/coldfusion/cfusion/bin/../logs/coldfusion-out.log
======================================================================
[000] Checking server startup status...
[000] Checking server startup status...
[000] Checking server startup status...
[000] Checking server startup status...
[000] Checking server startup status...
[000] Checking server startup status...
[000] Checking server startup status...
[000] Checking server startup status...
[000] Checking server startup status...
[000] Checking server startup status...
[000] Checking server startup status...
[000] Checking server startup status...
[000] Checking server startup status...
[000] Checking server startup status...
[000] Checking server startup status...
[000] Checking server startup status...
[000] Checking server startup status...
[000] Checking server startup status...
[000] Checking server startup status...
[000] Checking server startup status...
[000] Checking server startup status...
[000] Checking server startup status...
[root@uswix622 cf]#

``````````````````````````````````````````````````

[root@uswix622 cf]# oc rsh coldfusion-qt-14-8mhqr
root@coldfusion-qt-14-8mhqr:/opt# ls /opt/coldfusion/cfusion/logs/
coldfusion-error.log coldfusion-out.log snapshots websocket.log
root@coldfusion-qt-14-8mhqr:/opt# ls /opt/coldfusion/cfusion/logs/coldfusion-error.log
/opt/coldfusion/cfusion/logs/coldfusion-error.log
root@coldfusion-qt-14-8mhqr:/opt# more /opt/coldfusion/cfusion/logs/coldfusion-error.log
May 05, 2021 9:25:32 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows using OpenSSL was not found on the java.library.path: [/opt/coldfusion/cfusion/bin/../lib:/opt/coldfusion/cfusion/bin/../lib/_linux64:/o
pt/coldfusion/cfusion/bin/../lib::/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
May 05, 2021 9:25:32 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8500"]
May 05, 2021 9:25:32 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
May 05, 2021 9:25:32 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-127.0.0.1-8016"]
May 05, 2021 9:25:32 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
May 05, 2021 9:25:33 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service [Catalina]
May 05, 2021 9:25:33 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.5.61
Jul 30, 2021 9:07:57 AM org.apache.tomcat.util.digester.Digester endElement
SEVERE: End event threw exception
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tomcat.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:420)
at org.apache.tomcat.util.digester.SetNextRule.end(SetNextRule.java:145)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1018)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2967)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1512)
at com.adobe.coldfusion.launcher.Launcher.run(Launcher.java:742)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.adobe.coldfusion.bootstrap.Bootstrap.init(Bootstrap.java:100)
at com.adobe.coldfusion.bootstrap.Bootstrap.main(Bootstrap.java:185)
Caused by: java.lang.IllegalArgumentException: addChild: Child name '' is not unique
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:730)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
... 25 more

Jul 30, 2021 9:07:57 AM com.adobe.coldfusion.launcher.Launcher run
WARNING: Catalina.start using /opt/coldfusion/cfusion/runtime/conf/server.xml
org.xml.sax.SAXParseException; systemId: file:///opt/coldfusion/cfusion/runtime/conf/server.xml; lineNumber: 477; columnNumber: 10; Error at (477, 10) : addChild: Child name '' is not uni
que
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:1948)
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:1980)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1021)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2967)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1512)
at com.adobe.coldfusion.launcher.Launcher.run(Launcher.java:742)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.adobe.coldfusion.bootstrap.Bootstrap.init(Bootstrap.java:100)
at com.adobe.coldfusion.bootstrap.Bootstrap.main(Bootstrap.java:185)
Caused by: java.lang.IllegalArgumentException: addChild: Child name '' is not unique
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:730)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tomcat.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:420)
at org.apache.tomcat.util.digester.SetNextRule.end(SetNextRule.java:145)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1018)
... 18 more

root@coldfusion-qt-14-8mhqr:/opt#

``````````````````````````````````````````

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 ,
Jul 30, 2021 Jul 30, 2021

Copy link to clipboard

Copied

The error you now show (from the coldfusion-error.log) is basically down to the reported "Child name '' is not unique". And that's going to be about what's in the server.xml that you are copying into the image (or mounting as a volume).

 

I had proposed you look at that (either before the image runs or AS the image runs). I suspect you will find that you have a line showing <Context path="", and recall I said that the ORIGINAL one (within the image, before you may run the image) has that COMMENTED OUT. But I said also that then once you DO run a container that line IS put into the file, with 3 preresources lines (and the context around it, as I showed above).

 

The way things work (with the Adobe CF docker images) is that the startup of the container actually MODIFIES the file DURING the startup. You can see the processing in the /opt/startup/start-coldfusion.sh file.

 

So bottom line, it would seem that whatever server.xml you are trying to use (whether copied in or volume-mounted) already has an uncommented context path="", and the startup script is NOT expecting that and is adding its own.

 

So back to your original dilemma, in that you are trying to modify the server.xml to put in your own allowlinking, you should INSTEAD edit this /opt/startup/start-coldfusion.sh file so that you have IT do that for you, and then you copy THAT into the image.

 

Let us know if I've got you on the right track, and if so, how it goes.


/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
Community Expert ,
Oct 11, 2023 Oct 11, 2023

Copy link to clipboard

Copied

LATEST

As an update a couple years on, I just happened to notice that someone else raised this same problem on SO back then as well. And they offered a solution that may interest some (and they acknowledged there that they used some of the info shared above). Even if Parashar may have moved on from the problem, it's here:

 

https://stackoverflow.com/a/68687637/90802


/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
Resources
Documentation