Can't overrite ATL_PROXY_PORT, ATL_TOMCAT_SCHEME or ATL_TOMCAT_SECURE

Eric Reyes November 3, 2020

I have Jira running in a docker stack and is working well. I have a reverse proxy running on the same network, Nginx & let's encrypt, but I can't change the proxy server variables in Jira.

 I am having issues with Tomcat reporting incorrect proxy name, port, and scheme. The official docker image reports using the environment variables listed above however it does not change the corresponding proxy variables in the server.xml

I'm trying to connect Confluence to Jira, and I'm assuming that it's failing due to this problem.

How can I get the environment variables to register correctly?

 

 

2 answers

0 votes
Eric Reyes November 4, 2020

Ultimately the Problem I'm trying to resolve is this

Screenshot 2020-11-04 120052.pngThis occurs when I try to connect confluence to jira to manage my users. When checking the application integration status from Jira's end I see this. 

Screenshot 2020-11-04 120615.png

0 votes
Ansar Rezaei
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 3, 2020

Hi Eric

You should work with another file located in /opt/atlassian/etc/server.xml.j2 instead of the default server.xml file

You can pass the parameters to your container in this way also:

docker run -v jiraVolume-8.5.9:/var/atlassian/application-data/jira -e ATL_TOMCAT_CONTEXTPATH=jira -e ATL_PROXY_PORT=443 -e ATL_TOMCAT_SECURE=true -e ATL_TOMCAT_SCHEME=https JVM_MAXIMUM_MEMORY=2048m --name="jira859" -d -p 8080:8080 --network atlassian atlassian/jira-software:8.5.9
Eric Reyes November 3, 2020

Could you provide me with how this environment variable works? I had the rest of the ALT environment variables, but adding this seems to have broken the installation

ATL_TOMCAT_CONTEXTPATH=jira
Ansar Rezaei
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 3, 2020

You can remove it. It is a context path in my installation and it should not be broken as far as I know.

If you run multiple Atlassian products on the same server, it's better to use a context path. 

for example on my mac, I have both Jira and Confluence, so I can open them via these links:

http://mymac:8080/jira

http://mymac:8090/confluence

Eric Reyes November 3, 2020

ahh. I also have jira and confluence both setup on an in-house server, however the reverse proxy has them on different subdomains. :

https://jira.myserver.com

https://confluence.myserver.com

Would I need a context path in this case?

I am able to access the instances, however, I get reported proxy errors

My current environment variables are as follows:

ATL_PROXY_NAME=jira.myserver.com

ATL_PROXY_PORT=443

ATL_TOMCAT_SCHEME=https

ATL_TOMCAT_SECURE=true

Ansar Rezaei
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 3, 2020

If you open both of them in one browser, if you work with one of them, the other one signed out because of the cookie problems and you have to enter your credential continuously :-)). See this KB for more information: https://confluence.atlassian.com/confkb/logging-into-another-atlassian-application-logs-me-out-of-confluence-268043930.html

Could you give more information about your case like screenshots or messages you see in your browser console (Right-click anywhere and Open Inspect Element)

Eric Reyes November 3, 2020

My goal is to integrate confluence and jira, while having jira handle the user management. That should allow me to have the same account on both. However, during the connection process Confluence throws a system error. Inspecting the problem on Jira's side yields a network error specifying:

oauth_problem=consumer_key_unknown  

My assumption is that this is caused due to an incorrect reverse proxy configuration.

 Screenshot 2020-11-03 172500.pngThis is why I'm trying to configure the Proxy environment variables, but I think I'm missing something. 

Here is my console log information

Screenshot 2020-11-03 172927.png 

Ansar Rezaei
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 4, 2020

Add separate connectors for HTTP access between Jira and confluence.

For example, use 8082 for HTTP access Jira and 8092 for HTTP access in confluence.

When you create application links between these two apps, use localhost:8090 and localhost:8080 as Application URL and use https address as a display URL. These two containers should be on the same network and see each other. As you see in my command, I create a network, and its name is atlassian.

Could you share your command for running Jira and Confluence containers?

Eric Reyes November 4, 2020

My reverse proxy is on the same docker network as both jira and confluence so the exposed ports on my host do not affect access over my domain. They only allow access over my local network.

I am using unraid as my server OS.

Here are my docker commands

Jira 

docker run -d --name='jira' --net='swag' -e TZ="America/Los_Angeles" -e HOST_OS="Unraid" -e 'ATL_PROXY_NAME'='https://jira.myserver.com' -e 'ATL_PROXY_PORT '='443' -e 'ATL_TOMCAT_SCHEME '='https' -e 'ATL_TOMCAT_SECURE '='true' -e 'ATL_TOMCAT_PORT'='8080' -p '8008:8008/tcp' -v '/mnt/user/appdata/jira/':'/var/atlassian/application-data/jira':'rw' 'atlassian/jira-software'

confluence

docker run -d --name='confluence' --net='swag' -e TZ="America/Los_Angeles" -e HOST_OS="Unraid" -e 'ATL_PROXY_NAME '='jira.myserver.com' -e 'ATL_PROXY_PORT '='443' -e 'ATL_TOMCAT_PORT '='8090' -e 'ATL_TOMCAT_SCHEME '='https' -e 'ATL_TOMCAT_SECURE'='true' -v '/mnt/user/appdata/confluence':'/var/atlassian/application-data/confluence':'rw' 'atlassian/confluence-server'

This is the error I'm trying to addressScreenshot 2020-11-04 111734.png

Ansar Rezaei
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 4, 2020

Why you put parameters inside single quotes?
Try this and let me know if it didn't work:

docker run -d --name="jira" --net=swag -e TZ=America/Los_Angeles -e HOST_OS=Unraid -e ATL_PROXY_NAME=https://jira.myserver.com -e ATL_PROXY_PORT=443 -e ATL_TOMCAT_SCHEME=https -e ATL_TOMCAT_SECURE=true -e ATL_TOMCAT_PORT=8080 -p 8008:8008/tcp -v /mnt/user/appdata/jira/:/var/atlassian/application-data/jira:rw atlassian/jira-software
Eric Reyes November 4, 2020

It works the same. I'm just building the docker commands using the Unraid GUI, but the compiled version is what I showed you. 

Ansar Rezaei
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 4, 2020

The picture you upload above shows that ATL parameters didn't match config correctly. Let's try one more scenario.

I'll assume that you have the command-line access to the container and specified a volume for /opt/atlassian directory.

Atlassian uses the Jinja2 templating library to translate config from environment variables into server.xml values.

This file (/opt/atlassian/etc/server.xml.j2) is a template that the container uses to make the actual server.xml file. So if you change the parameters inside this file, these values have been set in the next container startup, and you don't need these parameters passed inside the docker run command.

If you don't have this access inside your PAAS provider, you can make the image locally, push it to your docker hub account, and then use it inside Unraid.

Eric Reyes November 4, 2020

I found it!!! 

I noticed when I was looking through the server.xml.j2 file that the environment variables are lowercase*. This conflicts with the documentation specifying to use uppercase environment variables. 

I change all my atl* environment variables to lowercase and all is well now :). I'm not sure if this is a special case for Unraid users or if the documentation needs to be adjusted.

Thanks for your support Ansar! 

Ansar Rezaei
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 5, 2020

I'm so glad that your issue has been solved. Feel free if you think I can help you more and hit one of my answers as Accepted :-))

Suggest an answer

Log in or Sign up to answer