FileApiHandler: File does not exist


#1

Hi,
We recently loaded submissions via the xml import. We noticed that PDF’s can not be downloaded. An error of:
FileApiHandler: File …journals/10//articles/6745//6745–2366-1-0-20180613.pdf does not exist or is not readable!

The real physical file path is actually:
…/journals/10/articles/6745/6745–2366-1–20180613.pdf
(note the missing ‘0’ in the filename):

If it helps this is the URL that gives the 500 error:
./$$$call$$$/api/file/file-api/download-file?fileId=2366&revision=1&submissionId=6745&stageId=5

I built the xml file myself so could I have screwed something up in the file?

Can this be fixed by changing some values in the database?

Thanks.
Jeremy


#2

Hi @jhennig

Hmm… The file names are constructed like this: submissionId-genreId-fileId-revision-fileStage-timestamp.extension.
Thus, it seems your file names are missing something, maybe genreId and fileStage.
Depending on how many files did you imported you could eventually repair them manually, but it is not easy: you would need to enter the correct values in the DB, rename the physical files and move them to the correct subfolder.
Could you post the XML elements submission_file and revision from the XML import, from the example file above?

Here is an example how it could look like:

<submission_file xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" stage="review_attachment" id="31" xsi:schemaLocation="http://pkp.sfu.ca native.xsd">
    <revision number="1" genre="Article Text" filename="filename.pdf" viewable="false" date_uploaded="2018-03-02" date_modified="2018-03-02" filesize="1953519" filetype="application/pdf" uploader="admin">

Best,
Bozana


#3

Thanks here is corresponding XML.

 <submission_file id="368">
     <revision number="1" filetype="application/pdf" filename="vol9no2pierce.pdf">
      <name>vol9no2pierce.pdf</name>
      <href src="...../slwPDF/vol9no2pierce.pdf" mime_type="application/pdf"/>
     </revision>
    </submission_file>
    <article_galley>
     <id>368</id>
     <name>PDF</name>
     <seq>1</seq>
     <submission_file_ref id="368" revision="1"/>
    </article_galley>

#4

Hi @jhennig

If those are galley files, you would need to use stage="proof" as attribute in the submission_file element. Those are probably article full texts, correct? Then you would probably need to use genre="Article Text" (if you are using en_US locale) as attribute in the revision element. Available genre names you will find in your DB table genre_settings, for that specific journal.
For further possible stage values see this function: https://github.com/pkp/pkp-lib/blob/omp-3_1_1-2/plugins/importexport/native/PKPNativeImportExportDeployment.inc.php#L71.

Best,
Bozana


#5

Thanks I’ll give those attributes a try.