JSOLERP
September 11, 2020, 6:16pm
1
Hello,
We just set up LDAP and when trying to log in, I see it is stuck in “Verifying…” when trying to “log in with LDAP”
We operate in secured/firedwalled environment, so I am used to checking firewall during issues like this. I notice that the ERPNEXT server is trying to contact 192.0.73.2:443 while we try to log in.
any suggestions would be appreciated. Thanks!
UPDATE: SEE BELOW. This appears to be caused by a check to gravatar.com being required in order to let the LDAP user log in.
1 Like
JSOLERP
September 11, 2020, 8:32pm
2
Kept digging… looks like it’s GRAVATAR
So if you don’t allow ERPNEXT server to reach gravatar, you can not log in with LDAP.
Also FYI here:
Is there a defined method for running Frappe in an isolated network without access to the internet? I mean disabling the use of external dependencies like google fonts, gravatar, etc.
To be clear, I do not mean the situation like this . The question there seemed to be more about batching transactions remotely during periods of downtime between client/server. I need to know if Frappe/ERPNext can gracefully run 100% local.
So I think this is “solved” in the sense that we know what is causing it, but not solved because we don’t know how to disable GRAVATAR for LDAP authentication.
for now I resolved problem with this fix:
opened 11:16AM - 11 Feb 20 UTC
<!--
Welcome to ERPNext issue tracker! Before creating an issue, please heed th… e following:
1. This tracker should only be used to report bugs and request features / enhancements to ERPNext
- For questions and general support, checkout the manual https://erpnext.com/docs/user/manual/en or use https://discuss.erpnext.com
- For documentation issues, refer to https://github.com/frappe/erpnext_com
2. Use the search function before creating a new issue. Duplicates will be closed and directed to
the original discussion.
3. When making a bug report, make sure you provide all required information. The easier it is for
maintainers to reproduce, the faster it'll be fixed.
4. If you think you know what the reason for the bug is, share it with us. Maybe put in a PR 😉
-->
## Description of the issue
ERPNext hangs when I save a contact with an email address defined as primary email.
I identified the problem : Gravatar is not available from my server, the has_gravatar() function times out after 2 minutes. Way too long.
## Context information (for bug reports)
**Output of `bench version`**
```
erpnext 12.4.3
frappe 12.2.1
```
## Steps to reproduce the issue
1. Close the access to Gravatar on your firewall
2. Create a new contact
3. Set an email, check "is primary"
4. Save
5. Wait 2 minutes until the page unfreezes
### Observed result
Page is frozen for 2 minutes and the email address is not saved
### Expected result
The contact info should be saved instantly
### Stacktrace / full error message
```
Nothing
```
## Additional information
I corrected this behaviour on my server by adding a 2 seconds timeout in requests.get() call in file
```apps/frappe/frappe/utils/__init__.py```
```
try:
res = requests.get(gravatar_url, timeout=2)
if res.status_code==200:
return gravatar_url
else:
return ''
except requests.exceptions.ConnectionError:
return ''
```
Maybe a system parameter like "enable gravatar" lookup could be useful in closed systems, or simply set an arbitrary (short enough) timeout in ```has_gravatar()```.