Bug - You do not have enough permissions to access this resource

Hello everyone,
I am facing this bugs since a 9 to 10 days. this message is also occurring at all users accounts i have, even on Administrator account as well,
I don’t know why it problem comes but i have to fix it quickly,
i’ve found this message in request.js and i’ve delete the frappe.msgprint code that this message will stop appearing again and again but it is still spearing.

Note : this message is appearing again and again even user don’t do anything. its not the problem of Role Permission.

Please help.

Untitled-1%20copy

ERPNext: v9.x.x-develop (dfb1646) (develop)
Frappe Framework: v9.x.x-develop (4a336aa) (develop)

‘bench reset-perms’ is one option assuming you have console access, or for hosted case email for eg support@erpnext.com

bench reset-perms
This command will reset all the Role Permissions?
Actually i think this problem is because of i am using bitnami’s ERPNext image,
They’ve installed ERPNext using root user, not frappe.
When i was trying to create doctype after setting up developer mode 1 for files and folders to be created automatically in the back-end, it was giving me error that permission denied for the erpnext/hr/doctype/blah/blah…

Then i gave “Write” permissions manually via FTP,
Then its allowed me to create files automatically for the doctype.

image

I think that this is the reason of this problem.

Yes I believe so, and I am not sure how or whether you can somehow save or restore them?

For file system permission issues you would get a traceback error notice, in your case here that is not the issue.

Traceback (most recent call last):
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/desk/form/save.py", line 22, in savedocs
    doc.save()
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py", line 256, in save
    return self._save(*args, **kwargs)
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py", line 307, in _save
    self.run_post_save_methods()
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py", line 887, in run_post_save_methods
    self.run_method("on_update")
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py", line 755, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py", line 1024, in composer
    return composed(self, method, *args, **kwargs)
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py", line 1007, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py", line 749, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 215, in on_update
    self.export_doc()
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 329, in export_doc
    export_to_files(record_list=[['DocType', self.name]], create_init=True)
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/modules/export_file.py", line 22, in export_to_files
    write_document_file(frappe.get_doc(record[0], record[1]), record_module, create_init=create_init)
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/modules/export_file.py", line 37, in write_document_file
    folder = create_folder(module, doc.doctype, doc.name, create_init)
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/modules/export_file.py", line 64, in create_folder
    frappe.create_folder(folder)
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/__init__.py", line 338, in create_folder
    os.makedirs(path)
  File "/opt/bitnami/python/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/erpnext/erpnext/selling/doctype/new'

Traceback (most recent call last):
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/app.py", line 62, in application
    response = frappe.handler.handle()
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/handler.py", line 22, in handle
    data = execute_cmd(cmd)
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/handler.py", line 53, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/__init__.py", line 939, in call
    return fn(*args, **newargs)
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/desk/form/save.py", line 22, in savedocs
    doc.save()
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py", line 256, in save
    return self._save(*args, **kwargs)
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py", line 307, in _save
    self.run_post_save_methods()
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py", line 887, in run_post_save_methods
    self.run_method("on_update")
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py", line 755, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py", line 1024, in composer
    return composed(self, method, *args, **kwargs)
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py", line 1007, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py", line 749, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 215, in on_update
    self.export_doc()
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 329, in export_doc
    export_to_files(record_list=[['DocType', self.name]], create_init=True)
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/modules/export_file.py", line 22, in export_to_files
    write_document_file(frappe.get_doc(record[0], record[1]), record_module, create_init=create_init)
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/modules/export_file.py", line 37, in write_document_file
    folder = create_folder(module, doc.doctype, doc.name, create_init)
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/modules/export_file.py", line 64, in create_folder
    frappe.create_folder(folder)
  File "/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/__init__.py", line 338, in create_folder
    os.makedirs(path)
  File "/opt/bitnami/python/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/erpnext/erpnext/selling/doctype/new'

Here is the traceback i am getting while creating a new doctype,
but when i check group and public’s WRITE permissions, it will create doctype as well as files and folders of the doctype in the back end.

image

So Bitnami’s gui tool lets you set file permissions on the server

If this is production, I would not create new doctypes?

Yes you seem to have environment problems perhaps Bitnami support of their forum can direct you