Symptom
If EXTERNALHOSTNAME has been set
When you installed FME Flow (formerly FME Server) with Docker, you set the EXTERNALHOSTNAME environment variable to the domain name.
Trying to run a job in FME Flow will result in this error:
If EXTERNALHOSTNAME has not been set
When you installed FME Flow with Docker, you did not set the EXTERNALHOSTNAME environment variable. FME Flow will default to localhost.
Your FME Flow appears to work fine for the most part, and jobs can be run from within the FME Flow web ui. You have encountered an issue using anything that creates a link to click from outside of FME Flow. For example, the Data Download or Streaming service (they generate a url to access the data), webhook urls to run jobs, or FME Flow apps.
To demonstrate, the Data Download url that gets generated will have fmeflowweb:8080 as the host, and this does not let you download the data:
Cause
The FME Flow web container is the container that needs to receive the request from the urls.
This issue arises from the disconnect between the host machine’s network and the Docker internal network.
When EXTERNALHOSTNAME is not set and localhost is used, the service urls default to fmeflowweb which is resolvable by Docker, and jobs will run. When this url is used outside of FME Flow, for example copied into a new browser window, the fmeflowweb hostname cannot be resolved resulting in being unable to access that url.
When EXTERNALHOSTNAME is set, the service urls default to the domain name specified. The host machine, or another on that network, is able to resolve that domain name. As Docker cannot resolve that domain name, the traffic does not reach the FME Flow web container.
Resolution
To fix this issue, you have a couple of options. For each option your IP address should be static, so that any changes to your IP address don’t break the deployment.
Remember to restart your containers if you change your Docker Compose file.
Option 1: Use the host machine’s IP address instead of the hostname
Set the EXTERNALHOSTNAME value to the IP address of the host machine. The urls will use the IP address which both Docker and the host machine will be able to resolve.
Option 2: Access FME Flow using the desired domain name
If you do not want the IP address to be displayed in these urls, there are a few extra steps you can do that will allow you to use the domain or hostname of the host machine.
1. Set the EXTERNALHOSTNAME environment variable to the IP address of the host machine.
2. In the Docker Compose file, add an environment variable to the fmeflowcore service:
SERVICEURL=https://host:port
This will set the service urls to the domain or hostname of the host machine. This environment variable saves doing this manually in the web ui post-install.
Omit this step if you’d like to retain the ability to edit service urls in the FME Flow web interface.
3. Configure extra_hosts for fmeserverweb service. This maps the domain name to the IP address, so that the web container can resolve it.
extra_hosts: - "host:ipaddress"
How to set EXTERNALHOSTNAME
If you are not sure how to set the EXTERNALHOSTNAME environment variable, you have two options:
Option 1:
Add any environment variables at the beginning of your Docker Compose commands:
EXTERNALHOSTNAME=10.213.0.204 docker-compose -f docker-compose-2021.yaml up -d
Option 2:
Create a .env file in the same directory as your Docker Compose files and add any environment variables to it. Docker will automatically use these values.
The Docker documentation has information on .env files.
Comments
0 comments
Please sign in to leave a comment.