ERPNext Conference 2019* ERPNext.com Blog

Getting this error while creating new Doc type


#1

Traceback (most recent call last):
15:57:50 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 60, in application
15:57:50 web.1 | response = frappe.api.handle()
15:57:50 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/api.py”, line 55, in handle
15:57:50 web.1 | return frappe.handler.handle()
15:57:50 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 21, in handle
15:57:50 web.1 | data = execute_cmd(cmd)
15:57:50 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 56, in execute_cmd
15:57:50 web.1 | return frappe.call(method, **frappe.form_dict)
15:57:50 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1036, in call
15:57:50 web.1 | return fn(*args, **newargs)
15:57:50 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
15:57:50 web.1 | doc.save()
15:57:50 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 271, in save
15:57:50 web.1 | return self._save(*args, **kwargs)
15:57:50 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 294, in _save
15:57:50 web.1 | self.insert()
15:57:50 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 258, in insert
15:57:50 web.1 | self.run_post_save_methods()
15:57:50 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 917, in run_post_save_methods
15:57:50 web.1 | self.run_method(“on_update”)
15:57:50 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 786, in run_method
15:57:50 web.1 | out = Document.hook(fn)(self, *args, **kwargs)
15:57:50 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1055, in composer
15:57:50 web.1 | return composed(self, method, *args, **kwargs)
15:57:50 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1038, in runner
15:57:50 web.1 | add_to_return_value(self, fn(self, *args, **kwargs))
15:57:50 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 780, in
15:57:50 web.1 | fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
15:57:50 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 274, in on_update
15:57:50 web.1 | self.export_doc()
15:57:50 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 494, in export_doc
15:57:50 web.1 | export_to_files(record_list=[[‘DocType’, self.name]], create_init=True)
15:57:50 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/export_file.py”, line 22, in export_to_files
15:57:50 web.1 | write_document_file(frappe.get_doc(record[0], record[1]), record_module, create_init=create_init)
15:57:50 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/export_file.py”, line 38, in write_document_file
15:57:50 web.1 | folder = create_folder(module, doc.doctype, doc.name, create_init)
15:57:50 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/export_file.py”, line 65, in create_folder
15:57:50 web.1 | frappe.create_folder(folder)
15:57:50 web.1 | File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 375, in create_folder
15:57:50 web.1 | os.makedirs(path)
15:57:50 web.1 | File “/home/frappe/frappe-bench/env/lib/python3.6/os.py”, line 220, in makedirs
15:57:50 web.1 | mkdir(name, mode)
15:57:50 web.1 | PermissionError: [Errno 13] Permission denied: ‘/home/frappe/frappe-bench/apps/strawberi/strawberi/strawberi/doctype/df’


#2

First go to the app folder then run below command this will resolve the issue

sudo chown frappe -R *