geonode-project icon indicating copy to clipboard operation
geonode-project copied to clipboard

Celery is unable to contact geoserver_public_location

Open drumbsd opened this issue 4 years ago • 1 comments

Problem:

On some specific server configuration, celery is unable to connect to GEOSERVER_PUBLIC_LOCATION.

Details:

If the /etc/hosts on server where the project is built, have the GEOSERVER_PUBLIC_LOCATION configured as 127.0.0.1 like in this specific situation:

127.0.0.1 foo.bar.com 

Celery is unable to connect to foo.bar.com from inside the docker because it resolves the name with 127.0.0.1 that is unavailable inside docker.

Solutions:

We add extra_hosts environment like this:

extra_hosts:
      - "foo.bar.com:$public_ip_address"

With this directive celery is able to connect to the GEOSERVER_PUBLIC_LOCATION

Possible other solutions:

Since , in this case, celery is running inside docker-compose enviroment, maybe it could try to reach geoserver using $GEOSERVER_LOCATION instead of $GEOSERVER_PUBLIC_LOCATION. Using $GEOSERVER_LOCATION celery will resolve the geoserver fqdn using value that is provided by internal docker-compose dns. But I don't know if there's a specific reasons why it needs to connect to geoserver using the $GEOSERVER_PUBLIC_LOCATION, so maybe is not applicable.

drumbsd avatar Aug 09 '21 09:08 drumbsd

This is also problematic in case there is a network firewall with an anti-spoofing mechanism. Communication between GeoNode components should always happen using internal hostnames.

frafra avatar Jan 17 '22 08:01 frafra