please review this thread. there are lot of references and troubleshooting hints.
from my experience the problem could result from (external) storages not connected to the system anymore. try this command to identify the most used storage:
select storage,count(storage) from oc_filecache group by storage;
you can correlate storage id using this query:
select * from oc_storages
if you find unused storages (like disconnected/old) it’s safe to kill referenced storage IDs:
delete from oc_storages where id like ‘smb:%’;
delete from oc_storages where numeric_id like ‘%choose a number%’;
subsequent cron jobs or occ files:scan --all should fix the oc_filecache table