Cant upload attachments in V13


I switched to V13 from 12 by restoring to a clean install but now I can’t upload any attachments. When I go to attach a file the file doesn’t show up and I also don’t get any kind of error displayed. I do however get an error in frappe.log.

It seems that I have some sort of permissions problem related to the private and public files folders. Does anyone have a possible solution to this problem? Could I have caused an issue durring the restore of the files when moving to V13?



2021-09-24 21:07:10,274 ERROR frappe Could not take error snapshot: characters_written
Site: site1.local
Form Dict: {'is_private': '0', 'folder': 'Home/Attachments', 'doctype': 'Customs Invoice',        'docname': 'CINV-2204', 'cmd': 'upload_file'}
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 68, in application
response = frappe.api.handle()
File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 55, in handle
return frappe.handler.handle()
File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 31, in handle
data = execute_cmd(cmd)
File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 67, in    execute_cmd
return, **frappe.form_dict)
File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 1198, in call
return fn(*args, **newargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 182, in     upload_file
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 285,  in save
return self._save(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 307, in _save
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 231, in insert
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 860,    in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 1158,    in composer
return composed(self, method, *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 1141,  in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 854,  in <lambda>
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/", line   56, in before_insert
self.save_file(content=self.content, decode=self.decode)
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/", line 477, in save_file
return self.save_file_on_filesystem()
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/", line 481, in save_file_on_filesystem
fpath = self.write_file()
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/", line 421, in write_file
with open(os.path.join(file_path.encode('utf-8'), self.file_name.encode('utf-8')), 'wb+') as f:
PermissionError: [Errno 13] Permission denied: b'./site1.local/public/files/1233.pdf'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/", line 36, in   make_error_snapshot
snapshot = get_snapshot(exception)
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/", line 127, in  get_snapshot
value = pydoc.text.repr(getattr(evalue, name))
AttributeError: characters_written

It seems that both the public and private folders are owned by root and in the root user group. Do I need to change the folder permissions to the frappe user and group 1000?