It looks like you have already seen the thread here:
Pointing to pkp/pkp#3783 consider supp files without file id in the migration by bozana · Pull Request #2009 · pkp/ojs · GitHub
I also found this error to arise when a supplementary file entry exists in OJS but there is no corresponding submission file. Specifically:
SELECT a.context_id, sf.* FROM article_supplementary_files sf, submissions a WHERE a.submission_id = sf.article_id AND sf.file_id <> 0 AND sf.show_reviewers = 1 AND sf.remote_url IS NULL and sf.file_id not in (select f.file_id from submission_files f);
This presents in the user interface as a supplementary file with no file information:
I’m testing a patch adding the and sf.file_id in (select f.file_id from submission_files f)
to:
* @return boolean True indicates success.
*/
function provideSupplementaryFilesForReview() {
$submissionFileDao = DAORegistry::getDAO('SubmissionFileDAO');
$reviewRoundDao = DAORegistry::getDAO('ReviewRoundDAO');
$reviewAssignmentDao = DAORegistry::getDAO('ReviewAssignmentDAO');
$reviewFilesDao = DAORegistry::getDAO('ReviewFilesDAO');
import('lib.pkp.classes.file.SubmissionFileManager');
// Get supp files with show_reviewers = 1
// We cannot support/consider remote supp files
$suppFilesResult = $submissionFileDao->retrieve('SELECT a.context_id, sf.* FROM article_supplementary_files sf, submissions a WHERE a.submission_id = sf.article_id AND sf.file_id <> 0 AND sf.show_reviewers = 1 AND sf.remote_url IS NULL');
while (!$suppFilesResult->EOF) {
$suppFilesRow = $suppFilesResult->getRowAssoc(false);
$suppFilesResult->MoveNext();
$reviewRounds = $reviewRoundDao->getBySubmissionId($suppFilesRow['article_id'], WORKFLOW_STAGE_ID_EXTERNAL_REVIEW);
// If a review round exists
// copy the supp file to the submissin review stage, add it to each existing review round, and as a review round file
if ($reviewRounds->getCount() != 0) {
$submissionFileManager = new SubmissionFileManager($suppFilesRow['context_id'], $suppFilesRow['article_id']);
// Retrieve the supp file last revision number, although they probably only have revision 1.
$revisionNumber = $submissionFileDao->getLatestRevisionNumber($suppFilesRow['file_id']);