Guest account delete

Do you want to delete Guest User ? If yes why ?

Yes, I want to. Simply because I did not create it and it says system user event thought I remove all permissions from it.

It is system generated User and you can’t delete Standard User’s. As they have specific purpose.

What is the specific purpose of it? can some one used it to get into the system?

You can delete Guest account follow below steps:

Customer list>>Guest>>Menu>>Delete

If there is not any transactions are made for guest then you will be able to delete, else you have to delete transactions first then account.

There is no transaction under a guest account. The system just installs and there is no Customer list>>Guest>>Menu>>Delete. What version of the system you are using?

I tried to delete the guest account and after deletion of guest account erpnext website stopped working. Let me explain you why?

Every time when anonymous user visit to erpnext website, frappe consider it as a guest user. If frappe failed to find the guest user it’ll throw the error and then no one can login into the system until you create guest user using frappe backend python api.

Error traceback:

Traceback (most recent call last):
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/app.py", line 59, in application
    init_request(request)
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/app.py", line 121, in init_request
    frappe.local.http_request = frappe.auth.HTTPRequest()
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/auth.py", line 53, in __init__
    frappe.local.login_manager = LoginManager()
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/auth.py", line 120, in __init__
    self.set_user_info()
  File "/home/navdeep/frappe-bench/apps/frappe/frappe/auth.py", line 146, in set_user_info
    self.full_name = " ".join(filter(None, [self.info.first_name,
AttributeError: 'NoneType' object has no attribute 'first_name'
1 Like

It’s not recommend to delete Guest Account.

Guest User name is reserved for Frappe Auth System.

class LoginManager:
        def __init__(self):
                self.user = None
                self.info = None
                self.full_name = None
                self.user_type = None

                if frappe.local.form_dict.get('cmd')=='login' or frappe.local.request.path=="/api/method/login":
                        if self.login()==False: return
                        self.resume = False

                        # run login triggers
                        self.run_trigger('on_session_creation')
                else:
                        try:
                                self.resume = True
                                self.make_session(resume=True)
                                self.set_user_info(resume=True)
                        except AttributeError:
                                self.user = "Guest"
                                self.make_session()
                                self.set_user_info()


self.user = “Guest”

1 Like

Thanks @navdeepghai for your explanation.

1 Like

Thank everyone for the explanation. I just want to ensure the system is 100% secure.

1 Like