Hi,
I have a strange problem and can’t find the correct solution. Even not when reading the source code. Maybe somebody can help me here:
- I’m using the official docker images from GitHub - frappe/frappe_docker: Docker images for production and development setups of the Frappe framework and ERPNext - version 11
- With those I’m setting up a new ERPNext instance.
- As site name I use: site1.local
- In my docker environment I have a reverse proxy in front of all my applications (traefik)
- This reverse-proxy listens to my public URL and overwrites the header “HOST” with “site1.local”.
- So I can access ERPNext trough my public hostname and the reverse proxy forwards the correct header to ERPNext.
So far so got. This setting is working as expected and I see the login-screen. But when I look in the logfiles, I have always the following error message from the socketio container (when performing api/method/frappe.realtimeget_user_info) :
Error: getaddrinfo ENOTFOUND site1.local
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'site1.local',
response: undefined
}
Somehow socketio doesn’t recognize the correct hostname.
The following thins I checked so far:
-
When I check socketio.js, then I find the get_url method which is used for this request. This one uses
socket.request.headers.origin
to determine the url. -
In erpnext_nginx service/container, the origin header is set to $http_host
-
therefore I set the http_host header as well in my reverse proxy but I still don’t get socketio fixed
→ No changes -
change
socket.request.headers.origin
tosocket.request.headers.referer
works as expected
→ But I don’t know, if this is correct?
Somehow I don’t have a clue why socketio doesn’t use the real hostname.
Is there some external configuration possible?
Bets regards,
–thomas