Error when trying to delete desktop background image that is set from user configuration


I set an image as desktop background. I did it from user configuration. When I try to delete it, I get an error.

This is all the error detail frappe gives:

**App Versions**
"erpnext": "8.8.0",
"frappe": "8.7.0"


**Error Report**
Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 56, in application
    response = frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 21, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 52, in execute_cmd
    return, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 922, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/", line 16, in remove_attach
    return frappe.utils.file_manager.remove_file(fid)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/", line 272, in remove_file
    frappe.delete_doc("File", fid, ignore_permissions=ignore_permissions)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 656, in delete_doc
    ignore_permissions, flags)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 88, in delete_doc
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 666, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 887, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 870, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 660, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/", line 204, in after_delete
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/", line 115, in update_parent_folder_size
    frappe.get_doc("File", self.folder).set_folder_size()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/", line 98, in set_folder_size
    self.db_set('file_size', self.file_size)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 391, in db_set
    self.modified, self.modified_by, update_modified=update_modified)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 664, in set_value
    values, debug=debug)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 154, in sql
    self._cursor.execute(query, values)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/", line 250, in execute
    self.errorhandler(self, exc, value)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/", line 50, in defaulterrorhandler
    raise errorvalue
OperationalError: (1048, "Column 'file_size' cannot be null")

**Request Data**

"type": "POST",
	"args": {
		"fid": "233ffcad1d",
		"dt": "User",
		"dn": "Administrator",
		"cmd": "frappe.desk.form.utils.remove_attach"
"url": "/"

Is that an issue?

Thanks in advanced for your help.

Hi, this seems to be working fine in the test account.

Hi @ArundhatiS

I tested it again and it seems the error is only when login as Administrator user. When I login as another user, it works fine.