Elasticsearch logs an error while downloading GeoIP databases
Your error
"log.level":"ERROR", "message":"exception during geoip databases update"1 more line it can showFix it fast
Most common cause, 1 of 3The node has no outbound HTTPS to Elastic's GeoIP endpoint
Allow outbound HTTPS from the cluster to the hosts Elastic lists.
# allow: geoip.elastic.co
# d24a988e385e0074d717b6bdaea58f0d.r2.cloudflarestorage.com
# *.d24a988e385e0074d717b6bdaea58f0d.r2.cloudflarestorage.com
# or, for an air-gapped cluster:
curl -X PUT "$ELASTICSEARCH_URL/_cluster/settings" -H "Authorization: ApiKey $ELASTIC_API_KEY" -H 'Content-Type: application/json' -d '{"persistent": {"ingest.geoip.downloader.enabled": false}}'Short answer
Elasticsearch logs exception during geoip databases update when its GeoIP downloader cannot finish fetching the GeoLite2 files from geoip.elastic.co. On 8.x and 9.x the usual reasons are blocked outbound HTTPS, a network that only allows an HTTP proxy, which the downloader does not support, or an untrusted certificate on a custom endpoint.
Which cause do you have?
With ELASTICSEARCH_URL and ELASTIC_API_KEY set for your cluster, ask it for downloader statistics, then try the endpoint by hand from the same node. A rising failed_downloads count plus a curl that prints 000 points to the network; a curl that prints 200 while Elasticsearch still fails points to the proxy or certificate cause.
curl -s -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ingest/geoip/stats?pretty"
curl -s -o /dev/null -w "%{http_code}\n" "https://geoip.elastic.co/v1/database?elastic_geoip_service_tos=agree"Then find the line you see in this list and open its fix:
- 1The node has no outbound HTTPS to Elastic's GeoIP endpoint
curl from the node prints 000 (no connection or no DNS answer for geoip.elastic.co), and failed_downloads keeps growing - 2The network only allows traffic through an HTTP proxy
curl works only when you pass the corporate proxy, and the error continues even though proxy settings exist for other tools - 3A custom endpoint uses a certificate the bundled JDK does not trust
The failures began right after pointing ingest.geoip.downloader.endpoint at an internal host signed by a private CA
What does the error look like?
"log.level":"ERROR", "message":"exception during geoip databases update"tags: ["_geoip_expired_database"]
Cause 1 of 3
The node has no outbound HTTPS to Elastic's GeoIP endpoint
You seecurl from the node prints 000 (no connection or no DNS answer for geoip.elastic.co), and failed_downloads keeps growing
Check
This log line follows any download failure. The downloader needs geoip.elastic.co plus the Cloudflare R2 storage hosts that serve the files, and in a strict firewall all of them must be allowed. Downloads only start when a pipeline uses a geoip or ip_location processor, or when eager download is on.
curl -s -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ingest/pipeline?pretty" | grep -n '"geoip"\|"ip_location"'Fix
Allow outbound HTTPS from the cluster to the hosts Elastic lists. If the cluster is offline on purpose, turn the downloader off and copy your own .mmdb files into each node's config/ingest-geoip folder instead. Switching it off also deletes the databases it already downloaded, so put the local files in place first.
# allow: geoip.elastic.co
# d24a988e385e0074d717b6bdaea58f0d.r2.cloudflarestorage.com
# *.d24a988e385e0074d717b6bdaea58f0d.r2.cloudflarestorage.com
# or, for an air-gapped cluster:
curl -X PUT "$ELASTICSEARCH_URL/_cluster/settings" -H "Authorization: ApiKey $ELASTIC_API_KEY" -H 'Content-Type: application/json' -d '{"persistent": {"ingest.geoip.downloader.enabled": false}}'Verify
successful_downloads rises after the next poll, or, with the downloader off, the error stops appearing in the logs.
curl -s -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ingest/geoip/stats?pretty"Confirmed by elastic.co
Cause 2 of 3
The network only allows traffic through an HTTP proxy
You seecurl works only when you pass the corporate proxy, and the error continues even though proxy settings exist for other tools
Check
Elastic states that true HTTP proxy support for GeoIP database downloads is not available in Elasticsearch. Its documented way through such a network is a secure reverse proxy that the downloader calls as if it were the Elastic endpoint.
env | grep -i _proxyFix
Run a secure reverse proxy (or a mirror service) that can reach Elastic, and set its URL as the downloader endpoint in elasticsearch.yml on every node. The setting is static, so each node needs a restart.
# elasticsearch.yml on each node
ingest.geoip.downloader.endpoint: https://geoip-mirror.internal.example.com/v1/databaseVerify
After a rolling restart the stats API reports new successful downloads, and the log line is gone.
curl -s -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ingest/geoip/stats?pretty"Confirmed by elastic.co
Cause 3 of 3
A custom endpoint uses a certificate the bundled JDK does not trust
You seeThe failures began right after pointing ingest.geoip.downloader.endpoint at an internal host signed by a private CA
Check
Elastic notes that the GeoIP downloader validates HTTPS with the JDK's built-in cacerts store. A mirror signed by an internal CA is therefore rejected until that CA sits in the truststore of the JDK the node runs on.
grep -n "ingest.geoip.downloader.endpoint" elasticsearch.ymlFix
On every node, use the keytool that belongs to the JDK running Elasticsearch to import the CA certificate into its cacerts store, then restart the nodes.
keytool -importcert -cacerts -alias geoip-mirror-ca -file internal-ca.pemVerify
The next download from the mirror succeeds and the stats API counts it.
curl -s -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ingest/geoip/stats?pretty"Confirmed by docs.oracle.com
How do I stop it coming back?
- Decide per cluster whether GeoIP data comes from Elastic, a mirror or local files, and write that choice into elasticsearch.yml.
- Add the GeoIP hosts to the firewall change request whenever a pipeline with a geoip processor is introduced.
- Watch failed_downloads from the stats API in monitoring; databases that cannot update for 30 days stop enriching documents.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.