IOError: [Errno 13] Permission denied: u'./erpnext/site_config.json'

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 223, in save
return self._save(*args, **kwargs)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 259, in _save
self._validate()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 395, in _validate
self._save_passwords()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 648, in _save_passwords
set_encrypted_password(self.doctype, self.name, new_password, df.fieldname)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/utils/password.py”, line 25, in set_encrypted_password
{ ‘doctype’: doctype, ‘name’: name, ‘fieldname’: fieldname, ‘pwd’: encrypt(pwd) })
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/utils/password.py”, line 95, in encrypt
cipher_suite = Fernet(encode(get_encryption_key()))
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/utils/password.py”, line 109, in get_encryption_key
update_site_config(‘encryption_key’, encryption_key)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/installer.py”, line 285, in update_site_config
with open(site_config_path, “w”) as f:
IOError: [Errno 13] Permission denied: u’./erpnext/site_config.json’

Traceback (most recent call last):
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/app.py”, line 59, in application
response = frappe.handler.handle()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/handler.py”, line 19, in handle
execute_cmd(cmd)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/handler.py”, line 42, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/init.py”, line 900, 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 223, in save
return self._save(*args, **kwargs)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 259, in _save
self._validate()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/document.py”, line 395, in _validate
self._save_passwords()
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 648, in _save_passwords
set_encrypted_password(self.doctype, self.name, new_password, df.fieldname)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/utils/password.py”, line 25, in set_encrypted_password
{ ‘doctype’: doctype, ‘name’: name, ‘fieldname’: fieldname, ‘pwd’: encrypt(pwd) })
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/utils/password.py”, line 95, in encrypt
cipher_suite = Fernet(encode(get_encryption_key()))
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/utils/password.py”, line 109, in get_encryption_key
update_site_config(‘encryption_key’, encryption_key)
File “/opt/bitnami/apps/erpnext/htdocs/frappe-bench/apps/frappe/frappe/installer.py”, line 285, in update_site_config
with open(site_config_path, “w”) as f:
IOError: [Errno 13] Permission denied: u’./erpnext/site_config.json’

Is it the same issue, you faced couple of days back? And can you please explain when and how you get this error?

Trying to setup PayPal integration

Is there some special permission i need to setup on the in erpnext. Because, as you mention are always getting permission error

hello
i fix my issues by applying permission to the site_config.json file.

Hello, what permissions?

Mute, the typical install creates the user account and group ‘frappe’.

So assuming you have console access, view permissions with this unix command:

frappe@erpnext:~/frappe-bench$ ls -al sites/erpnext.vm/site_config.json
-rw-rw-r-- 1 frappe frappe 369 Oct 13 09:01 sites/erpnext.vm/site_config.json

To give user and group read write permission to frappe, run this:

edit: forgot to include the command(!)

frappe@erpnext:~/frappe-bench$ chmod ug+rw sites/erpnext.vm/site_config.json

frappe@erpnext:~/frappe-bench$ ls -al sites/erpnext.vm/site_config.json
-rw-rw-r-- 1 frappe frappe 369 Oct 13 09:01 sites/erpnext.vm/site_config.json

hope this helps

1 Like