Your database appears to be damaged, since this step is deleting stale attachment thumbnails but there is no record that any existing attachments are using disk/db space.
Run the following MySQL queries manually to repair the data:
Code:
INSERT INTO datastore (title, `data`)
VALUES ('vw_attach_usage', 0)
ON DUPLICATE KEY UPDATE `data` = 0;
UPDATE datastore
SET `data` = `data` + (SELECT SUM(filesize) AS `data` FROM vw_attachmentfile LIMIT 1)
WHERE title = 'vw_attach_usage'
LIMIT 1;
UPDATE datastore
SET `data` = `data` + (SELECT SUM(filesize) AS `data` FROM vw_attachmentthumb LIMIT 1)
WHERE title = 'vw_attach_usage'
LIMIT 1;