Resolving mysql error Integrity constraint violation: 1062 Duplicate entry '' for key 'uri':
You can check whether the file is being used by another part of the system with the file_usage_list() function:

$file = file_load($fid);
$usage = file_usage_list($file);


If the returned array is empty, you can probably assume that it's an orphaned record, and safe to delete. But take a backup first, as always.