GeoIP not works

  • Used Zammad version: 5.4.0
  • Used Zammad installation type: docker-compose
  • Operating system: ubuntu
  • Browser + version: safari latest

Screenshot 2023-06-17 at 14.58.55
logs

zammad-websocket_1      | E, [2023-06-16T12:38:55.699460#1-5380] ERROR -- : cannot interpret as address: 194.44.***.***, 172.18.0.1 (Resolv::ResolvError)
zammad-websocket_1      | lib/sessions/event/chat_session_init.rb:39:in `run'
zammad-websocket_1      | lib/sessions/event.rb:17:in `run'
zammad-websocket_1      | lib/websocket_server.rb:102:in `onmessage'
zammad-websocket_1      | lib/websocket_server.rb:27:in `block (3 levels) in run'
zammad-websocket_1      | lib/websocket_server.rb:12:in `run'

How to get GeoIP working ?

Have you enabled “Geo IP Service”?
https://admin-docs.zammad.org/en/latest/settings/system/services.html

Is your Zammad host able to reach the internet?
If your Zammad host needs a proxy to reach the internet, is it configured?
https://admin-docs.zammad.org/en/latest/settings/system/network.html

Have you enabled “Geo IP Service”?

Geo IP Service - enabled by default.

Is your Zammad host able to reach the internet?

Server doesn’t have any restriction for accessing internet and doesn’t require proxy.

The issue is this part: 194.44.***.***, 172.18.0.1
Our GeoIP service allows one IP addresses only but you’re providing your local proxy along due to a misconfiguration on your end.

There was no custom changes from my side.
I provided only trusted proxy env
RAILS_TRUSTED_PROXIES=[‘127.0.0.1’, ‘::1’, ‘172.18.0.1’]
In session page Zammad users now have correct IP and resolved geo location.
But this env didn’t fix GeoIP in tickets.
Perhaps, this is a bug of Zammad that it tries to resolve it without extracting first member of x-forwarded-for header and use it value as is?

Of course not. Already existing information are not re-evaluated and thus are not “fixed”.

It is not because Zammad expects exactly one IP which you didn’t provide before.

Of course not. Already existing information are not re-evaluated and thus are not “fixed”.

I was talking about new tickets and new sessions after I set RAILS_TRUSTED_PROXIES env.
I don’t expect old tickets to be fixed.

It is not because Zammad expects exactly one IP which you didn’t provide before.

I am not interfering in this process. Below is my nginx reverse proxy config. What happens to data after nginx is a mystery to me. How exactly do you expect me to provide IPs to zammad?

location / {
    proxy_pass http://127.0.0.1:8080/;
    proxy_http_version 1.1;
    proxy_cache_bypass                 $http_upgrade;
    proxy_set_header Upgrade           $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host              $host;
    proxy_set_header X-Real-IP         $remote_addr;
    proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Host  $host;
    proxy_set_header X-Forwarded-Port  $server_port;
 proxy_set_header X-Forwarded-Proto https;
}

That configuration does not come from your Zammad based vHost but from a different proxy, correct?
Because that would explain two instead of one (that’s how proxies work).

If you don’t want to use the nginx of your compose or just use it because it’s there but actually use a different proxy, you could hook to the containers ports directly if that helps. This may need manual tinkering and changes (which should only affect your compose file).

This topic was automatically closed 360 days after the last reply. New replies are no longer allowed.