Permission denied in production mode

Hi all,

I have a problem with editing on the JSON file of any doctype or web form, when The mode is Production, here the message:

IOError: [Errno 13] Permission denied: u’/home/frappe/frappe-bench/apps/erpnext/erpnext/schools/web_form/student_applicant/student_applicant.json’

any explanation plz?

Can u share the full trace?

@JoEz

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 231, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 281, in _save
self.run_post_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 790, in run_post_save_methods
self.run_method(“on_update”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 667, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 890, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 873, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 661, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/doctype/web_form/web_form.py”, line 92, in on_update
path = export_module_json(self, self.is_standard, self.module)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 24, in export_module_json
export_to_files(record_list=[[doc.doctype, doc.name]], record_module=module)
File “/home/frappe/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 “/home/frappe/frappe-bench/apps/frappe/frappe/modules/export_file.py”, line 43, in write_document_file
with open(os.path.join(folder, fname +".json"),‘w+’) as txtfile:
IOError: [Errno 13] Permission denied: u’/home/frappe/frappe-bench/apps/erpnext/erpnext/schools/web_form/student_applicant/student_applicant.json’

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 56, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 19, in handle
execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 42, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 904, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 231, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 281, in _save
self.run_post_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 790, in run_post_save_methods
self.run_method(“on_update”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 667, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 890, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 873, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 661, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/doctype/web_form/web_form.py”, line 92, in on_update
path = export_module_json(self, self.is_standard, self.module)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 24, in export_module_json
export_to_files(record_list=[[doc.doctype, doc.name]], record_module=module)
File “/home/frappe/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 “/home/frappe/frappe-bench/apps/frappe/frappe/modules/export_file.py”, line 43, in write_document_file
with open(os.path.join(folder, fname +".json"),‘w+’) as txtfile:
IOError: [Errno 13] Permission denied: u’/home/frappe/frappe-bench/apps/erpnext/erpnext/schools/web_form/student_applicant/student_applicant.json’

Are u in developer mode?

I am In production mode and I active developer mode

Can u check file permission ?

@JoEz

I checked it, and when I add “administrator” in the role table, the same message appeared

This message appear just when my site is in production mode on a server

That’s weird …did u try a bench update?

No i did not, also i can not update now, but these problem appeared in every site that i created in any server ,just in production mode

Better to open an issue on github

1 Like

OK
Thank u @JoEz

Here the issue # on github https://github.com/frappe/erpnext/issues/8155