Facing Issue While Detaching File from attachment,unable to find solution on it


Traceback (most recent call last):
File “/home/dairy/webapps/gitlab.uat.milmatest.com/frappe-bench/apps/frappe/frappe/app.py”, line 57, in application
response = frappe.handler.handle()
File “/home/dairy/webapps/gitlab.uat.milmatest.com/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/dairy/webapps/gitlab.uat.milmatest.com/frappe-bench/apps/frappe/frappe/handler.py”, line 53, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/dairy/webapps/gitlab.uat.milmatest.com/frappe-bench/apps/frappe/frappe/init.py”, line 935, in call
return fn(*args, **newargs)
File “/home/dairy/webapps/gitlab.uat.milmatest.com/frappe-bench/apps/frappe/frappe/desk/form/utils.py”, line 17, in remove_attach
return frappe.utils.file_manager.remove_file(fid)
File “/home/dairy/webapps/gitlab.uat.milmatest.com/frappe-bench/apps/frappe/frappe/utils/file_manager.py”, line 239, in remove_file
frappe.delete_doc(“File”, fid, ignore_permissions=ignore_permissions)
File “/home/dairy/webapps/gitlab.uat.milmatest.com/frappe-bench/apps/frappe/frappe/init.py”, line 669, in delete_doc
ignore_permissions, flags, ignore_on_trash, ignore_missing)
File “/home/dairy/webapps/gitlab.uat.milmatest.com/frappe-bench/apps/frappe/frappe/model/delete_doc.py”, line 92, in delete_doc
doc.run_method(“after_delete”)
File “/home/dairy/webapps/gitlab.uat.milmatest.com/frappe-bench/apps/frappe/frappe/model/document.py”, line 702, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/dairy/webapps/gitlab.uat.milmatest.com/frappe-bench/apps/frappe/frappe/model/document.py”, line 965, in composer
return composed(self, method, *args, **kwargs)
File “/home/dairy/webapps/gitlab.uat.milmatest.com/frappe-bench/apps/frappe/frappe/model/document.py”, line 948, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/dairy/webapps/gitlab.uat.milmatest.com/frappe-bench/apps/frappe/frappe/model/document.py”, line 696, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/dairy/webapps/gitlab.uat.milmatest.com/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py”, line 217, in after_delete
self.update_parent_folder_size()
File “/home/dairy/webapps/gitlab.uat.milmatest.com/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py”, line 121, in update_parent_folder_size
frappe.get_doc(“File”, self.folder).set_folder_size()
File “/home/dairy/webapps/gitlab.uat.milmatest.com/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py”, line 104, in set_folder_size
self.db_set(‘file_size’, self.file_size)
File “/home/dairy/webapps/gitlab.uat.milmatest.com/frappe-bench/apps/frappe/frappe/model/document.py”, line 898, in db_set
self.modified, self.modified_by, update_modified=update_modified)
File “/home/dairy/webapps/gitlab.uat.milmatest.com/frappe-bench/apps/frappe/frappe/database.py”, line 662, in set_value
values, debug=debug)
File “/home/dairy/webapps/gitlab.uat.milmatest.com/frappe-bench/apps/frappe/frappe/database.py”, line 152, in sql
self._cursor.execute(query, values)
File “/home/dairy/webapps/gitlab.uat.milmatest.com/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 250, in execute
self.errorhandler(self, exc, value)
File “/home/dairy/webapps/gitlab.uat.milmatest.com/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 50, in defaulterrorhandler
raise errorvalue
OperationalError: (1048, “Column ‘file_size’ cannot be null”)

Unable to remove file from attachment and from attachment button on doctype

Solve This Issue
by ALTERING Field file_size (int(11) to int(100)) from tabFile using sql query ALTER TABLE tabFile MODIFY file_size INT(100);
but this is not a right way to change directly into database of frappe,
if any one has another solution please let me know.

Thank you