Not Permitted. Log in to access this page. When user has already logined.

Hi, I just encountered this problem a few days ago.

Our company is using ERPNext on Gcloud VMinstance with the info below:

erpnext 15.29.2
frappe 15.33.3
hrms 16.0.0-dev
payments 0.0.1
print_designer 1.x.x-develop

When the user logs in with the company network, everything works fine. However, when they use the other networks, they are stuck with this problem even when they logged in from the start or logged in with the company network and then switched to another network. Same account, same resource, same permission. Happened to all users, including the administrator account, with no ip restriction in place.

1 thing I check is that the user info (sid, csrf_token, etc) is sent in the header for both cases, but with an outside network, no response returns only 403 for permission denied.

Sounds like VPC Firewall rules only allow ingress from your company network

1 Like

Hi,

Thank you for taking the time to look into my problem. Below are the VPC rules we are using now, and there are no changes from before the problem occurred.

  1. Confirm its not a connectivity issue - your users can ping/curl the erpnext site (and raw ip address) from external networks.Paste your curl 403 error here
  2. Also confirm IP whitelist and fal2ban are not triggered (sudo systemctl status fail2ban)
  3. Check nginx configuration. Potential problems could show up in logs at /var/log/nginx/access.log
  4. Try this temporarily - bench --site your-site set-config ignore_csrf True - you might get to the root problem

Best of luck