Server.xml is missing

Kim yeti April 2, 2019

Hi

 

I've just successfully installed Confluence with docker, but when I try to access it over the web I get this warning message:

Tomcat config is incorrect

The Tomcat server.xml has an incorrect configuration:

scheme should be 'https'
proxyName should be 'foo.bar'
proxyPort should be '443'

Troubleshoot

 

Okay I follow the troubleshoot link - easy I thought ! But the problem is there is no server.xml file and there is no config folder either. Where do I update the info?

 

Thank you.

4 answers

1 vote
MatthewGibney September 9, 2019

I had this problem too, turned our my docker run command wasn't correct. I was not specifying the environment variables correctly.

Here is the run command I used (with URL removed)

docker run --env CATALINA_CONNECTOR_PROXYNAME=YOURCONFLUENCEURL --env CATALINA_CONNECTOR_PROXYPORT=443 --env CATALINA_CONNECTOR_SCHEME=https --env CATALINA_CONNECTOR_SECURE=true -v /data/your-confluence-home:/var/atlassian/application-data/confluence --name="confluence" -d -p 8090:8090 -p 8091:8091 atlassian/confluence-server:latest

Notice that the environment variables are specified each behind a --env flag.

Hopefully this is useful to anyone else struggling as I was. 

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 5, 2019

If there's no server.xml or config directory, then we have to question why you (or something on your system) has deleted them, or why your server refused to let the installer create them, while allowing other parts to be created.

What do you have in <confluence install> and <confluence install>/conf ?

Felix_Küppers May 22, 2019

Same here, followed the standard procedure of installing the confluence docker image, the whole wiki is installed and connection to db setup and works but the conf folder and server.xml file is missing :(

This is the structure after installation:

2019-05-22 13:54:54.png

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 22, 2019

That's the home directory.  Try looking in the installation directory.

Like # people like this
Felix_Küppers May 22, 2019

Many thanks @Nic Brough -Adaptavist- . this solves it for me, I was looking for this file in the wrong path.

For others, the server.xml in the container lies in:

/opt/atlassian/confluence/conf/server.xml

Like Justin Storfinger likes this
cmorgan-be August 16, 2019

How should this file be preserved across container creation? The data files are preserved as they are in a volume but as /opt/atlassian/confluence/conf is not inside of a volume each time the container is recreated the configuration is lost.

Note that the bitbucket-server configuration file IS inside of the application data folder so it is properly preserved across image upgrades and container creation if you've correctly added a volume for that directory.

Like Matt Cavanagh likes this
Matt Cavanagh September 2, 2019

I too am hitting the issue where the tomcat configuration is being overriden on run time. I suspect this warning is a result of this happening:

confluence | 02-Sep-2019 18:38:33.469 WARNING [main] org.apache.catalina.startup.SetAllPropertiesRule.begin [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'proxyPort' to '' did not find a matching property.

After that line is emitted, my config is malformed and changed from what I supply via a docker volume.

akraynev_omp September 2, 2019

Updated to 6.15.9, double-checked properties and still see this warning. Any guesses how to debug?

0 votes
skh397 May 22, 2020

I have already updated server.xml and added env. variable, but I still got error message

 

Tomcat config is incorrect

The Tomcat server.xml has an incorrect configuration:

....

 

env. variable

CONFLUENCE_PROXY_SCHEME - https

CONFLUENCE_PROXY_NAME - subdomain.domain.com

 

server.xml

==============================

<Connector connectionTimeout="20000"
redirectPort="8443"
maxThreads="48"
minSpareThreads="10"
enableLookups="false"
acceptCount="10"
debug="0"
URIEncoding="UTF-8"
protocol="org.apache.coyote.http11.Http11NioProtocol"
scheme="https"
secure="true"
proxyName="subdomain.domain.com"
proxyPort="443"/>

==============================

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 23, 2020

That section looks ok, your error is somewhere else in the file.

skh397 May 24, 2020

Many thanks @Nic Brough -Adaptavist- 

I updated my server.xml by following steps, am I correct?

1. Download server.xml template file from container "/opt/atlassian/etc/server.xml.j2"

2. Update my mentioned section into server.xml.j2 and upload into container

3.  Restart container

4. As checked /opt/atlassian/confluence/conf/server.xml, my updated section exists

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 24, 2020

Looks ok.  The problem is that your file contains an error.

skh397 May 24, 2020

Seems no error in server.xml, because of I downloaded the original file and just updated the values:

scheme="https"
secure="true"
proxyName="subdomain.domain.com"
proxyPort="443"

 

By the way, I just downloaded log files in Confluence administration > Troubleshooting and support tools > Create support zip. I found the above setting have not apply into Confluence_support_2020-05-25-02-19-09\tomcat-config\server.xml

Do I need to update server.xml in tomcat too? this file seems different with /opt/atlassian/confluence/conf/server.xml in Confluence

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 25, 2020

So your new file copied from the original, no longer has the error in it that is causing "the tomcat configuration is incorrect". 

I'm now lost on what you're asking about or what you're doing because you now seem to have a valid file and hence should have a working system.

skh397 May 25, 2020

Yes, I have a working system, but keep popup the error message "Tomcat config is incorrect....."

Error Msg.PNG

Then, I try to fix this problem by update the server.xml template file and restart container, and confirmed /opt/atlassian/confluence/conf/server.xml have been updated, but the above message still keep to popup

server_xml2.PNG

 

After that, I downloaded log file in Confluence administration > Troubleshooting and support tools > Create support zip.

In the downloaded zip file, I found server.xml in "Confluence_support_2020-05-25-07-57-02\tomcat-config", which is no scheme / proxyName / proxyPort exists

server_xml.PNG

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 25, 2020

Right, so this is screaming that you are looking at the wrong server.xml file.

Could you

  • Log into Confluence as an admin and go to Admin -> General Configuration -> System information
  • Find the line that says "catalina.home" and note the value is a directory
  • Log into the server and go to the directory
  • Descend into "conf" under that
  • The server.xml file in here is the one that Confluence is reading (unless you've configured something really unusual).  Forget copies or templates, just look at this file.
skh397 May 25, 2020

As checked in Admin -> General Configuration -> System information

Confluence_Server_Info.PNG

After the following step, same error popup

1. Download server.xml file by command:

"docker cp 516deeb60341:/opt/atlassian/confluence/conf/server.xml server.xml"

2. Edit the values for elements secure / scheme / proxyName / proxyPort in Connector section

3. Upload updated server.xml into server by command:

"docker cp server.xml 516deeb60341:/opt/atlassian/confluence/conf/server.xml"

4. Restart container by command: "docker restart 516deeb60341"

 

Below content is my server.xml downloaded from /opt/atlassian/confluence/conf/server.xml (proxyName marksed here)

=====================

<?xml version="1.0" encoding="utf-8"?>

<Server port="8000"
shutdown="SHUTDOWN">

<Listener className="org.apache.catalina.startup.VersionLoggerListener"/>
<Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="on"/>
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>

<Service name="Catalina">

<Connector port="8090"
maxThreads="100"
minSpareThreads="10"
connectionTimeout="20000"
enableLookups="false"
protocol="HTTP/1.1"
redirectPort="8443"
acceptCount="10"
secure="true"
scheme="https"
proxyName="subdomain.domain.com"
proxyPort="443"

relaxedPathChars="[]|"
relaxedQueryChars="[]|{}^\`&quot;&lt;&gt;"
bindOnInit="false"
maxHttpHeaderSize="8192"
useBodyEncodingForURI="true"
disableUploadTimeout="true" />

<Engine name="Standalone"
defaultHost="localhost"
debug="0">
<Host name="localhost"
debug="0"
appBase="webapps"
unpackWARs="true"
autoDeploy="false"
startStopThreads="4">
<Context path=""
docBase="../confluence"
debug="0"
reloadable="false"
useHttpOnly="true">
<!-- Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties -->
<Manager pathname=""/>
<Valve className="org.apache.catalina.valves.StuckThreadDetectionValve"
threshold="60"/>

</Context>

<Context path="${confluence.context.path}/synchrony-proxy"
docBase="../synchrony-proxy"
debug="0"
reloadable="false"
useHttpOnly="true">
<Valve className="org.apache.catalina.valves.StuckThreadDetectionValve"
threshold="60"/>
</Context>

</Host>
</Engine>

</Service>

</Server>

=====================

skh397 May 26, 2020

Problem fixed by add server.xml into config map in Openshift

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 26, 2020

So you reverted to a copy of a working file and configured the right one to be deployed?  Is that what you mean?

skh397 May 26, 2020

I created the config file in Openshift by the content of server.xml, and mount it to "opt/atlassian/confluence/conf/server.xml" with read/write permission 

0 votes
Daniel Stoeber October 30, 2019

Had the same Issue with Container: teamatldocker/confluence:latest

I changed the following ENV with portainer to:

CONFLUENCE_PROXY_SCHEME - https

CONFLUENCE_PROXY_NAME - <My URL>

 

Issue solved. :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events