OJS 3.0 upgrade fails to move/rename some supplementary files

Hi,

I wrote earlier that I was succesfull in upgrading a site with 45 journals from 2.4.8.1 to 3.0. However, I did encounter a few errors which are causing problems.

There are few hundred of these cases, so I am only giving one example.

After Installer::migrateFiles a got errors like this:

WARNING: Unable to find a match for “8365-21425-1-??.pdf” in “files/journals/37//articles/8365/”. Skipping this file.

And after the upgrade continued a got a corresponding error like this (again a few hunder of these):

PHP Warning: copy(files/journals/37//articles/8365/attachment/8365-1-21425-1-13-20130705.pdf): failed to open stream: Tiedostoa tai hakemistoa ei ole in /var/www/servername.fi/public_html/lib/pkp/classes/file/FileManager.inc.php on line 155
PHP Warning: assert(): Assertion failed in /var/www/servername.fi/public_html/lib/pkp/classes/submission/SubmissionFileDAODelegate.inc.php on line 132

The original file (8365-21425-1-SP.PDF) is there in the original files folder and can be found from files/journals/37//articles/8365/supp/ and is still there when the upgrade is over. So, for some reason the upgrade script can not find the file and that is of course causing a related error later.

What could be the reason that the upgrade script does not find these files?

Edit: Ok, so could it just be the fact that PDF is written in capital letters?
Edit2: I checked around ten other similar cases and in every case the filename extension was in capital letters. There were also cases where the supp folder had also files with the extension written in small letters and these files have been copied correctly.

Now, I could run some scripts and change the extension to small letters but perhaps this should be solved in the upgrade script as well?

I made completely fresh, new installation of OJS 3.0 and
I have also a problem with some supplementary files, I got this warning from our php errors log:

[19-Sep-2016 15:45:39 Europe/Warsaw] FileApiHandler: File /home/acta/ojs/files/journals/1//articles/1/submission/1-7-4-2-2-20160916.eps does not exist or is not readable!
[19-Sep-2016 15:45:39 Europe/Warsaw] ojs2: 500 Internal Server Error

This appeared after I had tried to download one of the supplementary files (pdf and tex files were downloaded correctly).
I checked the folder where these files are stored and the file in question does exist but its actual name is different: 1-7-4-1-2-20160916.eps instead what the log says (see above).

It looks as OJS makes some incorrect naming.
Could you help us with this issue?
Anna

Hi @ania,

The distinction between those two filenames is the revision number, i.e. the file was likely first uploaded and then a new copy was uploaded as a second revision. Can you verify in your OJS 2.x installation whether the file available for download was the first or second revision?

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you very much for your response.

We haven’t started publishing our yournal using OJS yet.
Now we are testing installation of OJS 3.0 (this is not an upgrade of OJS 2.X), before we decide we are ready to use it.
So the files we uploaded exist only for this new installation.
Below I include the Editorial History for two submissions that we were testing:

Editorial History for Submisssion 1:

Date User Event
2016-09-16 Elżbieta Zachorowska-Such The submission’s issue metadata was updated.
Settings
2016-09-16
Elżbieta Zachorowska-Such A file “Zomorrodian.pdf” was uploaded for submission 1 by e_zachorowska-such.
Settings
2016-09-16
Elżbieta Zachorowska-Such A file “Zomorrodian.pdf” was uploaded for submission 1 by e_zachorowska-such.
2016-09-16 Elżbieta Zachorowska-Such An editor decision (Send To Production) for article 1 was recorded by Elżbieta Zachorowska-Such.
Settings
2016-09-16
Anna Skórka A file “eventshape1.pdf” was uploaded for submission 1 by e_zachorowska-such.
2016-09-16 Anna Skórka An editor decision (Send to Copyediting) for article 1 was recorded by Elżbieta Zachorowska-Such.
Settings
2016-09-16
Elżbieta Zachorowska-Such An email has been sent: [APPB] Editor Decision
Settings
2016-09-16
Wojciech Słomiński An email has been sent: [APPB] Able to Review
2016-09-16 Anna Skórka Wojciech Słomiński has accepted the round 1 review for submission 1.
Settings
2016-09-16
Elżbieta Zachorowska-Such An email has been sent: [APPB] Article Review Request
2016-09-16 Anna Skórka Wojciech Słomiński has been assigned to review submission 1 for review round 1.
2016-09-16 Anna Skórka An editor decision (Send to Review) for article 1 was recorded by Elżbieta Zachorowska-Such.
2016-09-16 Anna Skórka Elżbieta Zachorowska-Such was assigned to this submission as a Journal editor.
Settings
2016-09-16
Tadeusz Testowy An email has been sent: [APPB] Submission Acknowledgement
2016-09-16 Tadeusz Testowy Initial submission completed.
Settings
2016-09-16
Tadeusz Testowy Revision “{$name}” (file ID 4-{$revision}) was uploaded.
Settings
2016-09-16
Tadeusz Testowy A file “Zomorrodian.pdf” was uploaded for submission 1 by testeusz.
2016-09-16 Tadeusz Testowy A file “Zomorrodian.pdf” had its last revision removed by testeusz.



Editorial History for Submission 2:

Date User Event
Settings
2016-09-19
Anna Skórka Revision “{$name}” (file ID 22-{$revision}) was uploaded.
2016-09-16 Krystyna Stankiewicz The submission’s issue metadata was updated.
Settings
2016-09-16
Elżbieta Zachorowska-Such An email has been sent: [APPB] Editor Decision
2016-09-16 Krystyna Stankiewicz An editor decision (Send To Production) for article 2 was recorded by Elżbieta Zachorowska-Such.
2016-09-16 Anna Skórka Notification sent to users.
Settings
2016-09-16
Elżbieta Zachorowska-Such An email has been sent: [APPB]
2016-09-16 Anna Skórka Krystyna Stankiewicz was assigned to this submission as a Journal manager.
Settings
2016-09-16
Anna Skórka A file “Florkowski.pdf” was uploaded for submission 2 by acta.
Settings
2016-09-16
Michał Praszałowicz An email has been sent: [APPB] Editor Decision
2016-09-16 Krystyna Stankiewicz An editor decision (Send to Copyediting) for article 2 was recorded by Michał Praszałowicz.
Settings
2016-09-16
Anna Skórka A file “volHeaders.js” was uploaded for submission 2 by testeusz.
Settings
2016-09-16
Krystyna Stankiewicz A file “Florkowski.pdf” was uploaded for submission 2 by acta.
2016-09-16 Krystyna Stankiewicz Elżbieta Zachorowska-Such was assigned to this submission as a Copyeditor.
Settings
2016-09-16
Michał Praszałowicz An email has been sent: [APPB] Editor Decision
2016-09-16 Krystyna Stankiewicz An editor decision (Send to Copyediting) for article 2 was recorded by Michał Praszałowicz.
2016-09-16 Krystyna Stankiewicz Wojciech Słomiński has accepted the round 1 review for submission 2.
Settings
2016-09-16
Wojciech Słomiński An email has been sent: [APPB] Able to Review
2016-09-16 Krystyna Stankiewicz Wojciech Słomiński has been assigned to review submission 2 for review round 1.
Settings
2016-09-16
Michał Praszałowicz An email has been sent: [APPB] Article Review Request
2016-09-16 Krystyna Stankiewicz The round 1 review by Wojciech Słomiński for submission 2 has been cleared.
2016-09-16 Krystyna Stankiewicz Wojciech Słomiński has been assigned to review submission 2 for review round 1.
2016-09-16 Krystyna Stankiewicz An editor decision (Send to Review) for article 2 was recorded by Michał Praszałowicz.
2016-09-16 Krystyna Stankiewicz Initial submission completed.
Settings
2016-09-16
Tadeusz Testowy An email has been sent: [APPB] Submission Acknowledgement
Settings
2016-09-16
Krystyna Stankiewicz A file “Florkowski.tex” was uploaded for submission 2 by testeusz.
Settings
2016-09-16
Krystyna Stankiewicz A file “Florkowski.pdf” was uploaded for submission 2 by testeusz.
2016-09-16 Krystyna Stankiewicz A file “Florkowski.pdf” had its last revision removed by testeusz.
2016-09-16 Krystyna Stankiewicz Revision “{$name}” (file ID 11-{$revision}) was uploaded.
2016-09-16 Krystyna Stankiewicz A file “Florkowski.pdf” was uploaded for submission 2 by testeusz.



And below some of the warnings from our php errors log:

2016-09-19 08:31:40 PHP Notice: Use of undefined constant bool - assumed ‘bool’ in /home/acta/ojs/ojs-3.0.0/lib/pkp/classes/admin/form/PKPSiteSettingsForm.inc.php on line 134
2016-09-19 08:31:40 PHP Notice: Use of undefined constant bool - assumed ‘bool’ in /home/acta/ojs/ojs-3.0.0/lib/pkp/classes/admin/form/PKPSiteSettingsForm.inc.php on line 135
2016-09-19 08:31:40 PHP Notice: Use of undefined constant bool - assumed ‘bool’ in /home/acta/ojs/ojs-3.0.0/lib/pkp/classes/admin/form/PKPSiteSettingsForm.inc.php on line 136
2016-09-19 08:37:41 PHP Warning: end() expects parameter 1 to be array, null given in /home/acta/ojs/ojs-3.0.0/cache/t_compile/c18f74cb7ec86d000ca85f6baec01c420e4e3321^%%61^61E^61E71072%%search.tpl.php

on line 45

2016-09-19 08:37:41 PHP Warning: end() expects parameter 1 to be array, null given in /home/acta/ojs/ojs-3.0.0/cache/t_compile/c18f74cb7ec86d000ca85f6baec01c420e4e3321^%%61^61E^61E71072%%search.tpl.php

on line 53

2016-09-19 09:16:20 PHP Warning: include(): Failed opening ‘/home/acta/ojs/ojs-3.0.0/cache/fc-pluginSettings-1-appb.php’ for inclusion (include_path=’.:/home/acta/ojs/ojs-

3.0.0/classes:/home/acta/ojs/ojs-3.0.0/pages:/home/acta/ojs/ojs-3.0.0/lib/pkp:/home/acta/ojs/ojs-3.0.0/lib/pkp/classes:/home/acta/ojs/ojs-3.0.0/lib/pkp/pages:/home/acta/ojs/ojs-

3.0.0/lib/pkp/lib/adodb:/home/acta/ojs/ojs-3.0.0/lib/pkp/lib/phputf8:/home/acta/ojs/ojs-3.0.0/lib/pkp/lib/pqp/classes:/home/acta/ojs/ojs-3.0.0/lib/pkp/lib/smarty:.:/usr/local/share/pear’) in

/home/acta/ojs/ojs-3.0.0/lib/pkp/classes/cache/FileCache.inc.php on line 46

2016-09-19 09:16:20 PHP Warning: include(/home/acta/ojs/ojs-3.0.0/cache/fc-pluginSettings-1-appb.php): failed to open stream: No such file or directory in /home/acta/ojs/ojs-

3.0.0/lib/pkp/classes/cache/FileCache.inc.php on line 46

2016-09-19 09:18:14 PHP Warning: assert(): Assertion failed in /home/acta/ojs/ojs-3.0.0/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php on line 380
2016-09-19 09:18:14 PHP Warning: assert(): Assertion failed in /home/acta/ojs/ojs-3.0.0/lib/pkp/classes/submission/SubmissionFileDAODelegate.inc.php on line 132

[19-Sep-2016 09:18:20 Europe/Warsaw] FileApiHandler: File /home/acta/ojs/files/journals/1//articles/2/submission/2-7-22-2-2-20160919.ps does not exist or is not readable!
[19-Sep-2016 09:18:20

Europe/Warsaw] ojs2: 500 Internal Server Error

2016-09-19 09:42:59 FileApiHandler: File /home/acta/ojs/files/journals/1//articles/2/submission/2-7-22-2-2-20160919.ps does not exist or is not readable!

[19-Sep-2016 09:42:59 Europe/Warsaw] FileApiHandler: File /home/acta/ojs/files/journals/1//articles/2/submission/2-7-22-2-2-20160919.ps does not exist or is not readable!
[19-Sep-2016 09:42:59

Europe/Warsaw] ojs2: 500 Internal Server Error

2016-09-19 10:33:27 PHP Warning: Invalid argument supplied for foreach() in /home/acta/ojs/ojs-3.0.0/lib/pkp/classes/submission/form/PKPSubmissionSubmitStep1Form.inc.php on line 146
2016-09-19 10:33:27 PHP Warning: Invalid argument supplied for foreach() in /home/acta/ojs/ojs-3.0.0/lib/pkp/classes/submission/form/PKPSubmissionSubmitStep1Form.inc.php on line 36
2016-09-19 10:38:47 PHP Warning: include(): Failed opening ‘/home/acta/ojs/ojs-3.0.0/cache/fc-pluginSettings-1-webfeedblockplugin.php’ for inclusion (include_path=’.:/home/acta/ojs/ojs-

3.0.0/classes:/home/acta/ojs/ojs-3.0.0/pages:/home/acta/ojs/ojs-3.0.0/lib/pkp:/home/acta/ojs/ojs-3.0.0/lib/pkp/classes:/home/acta/ojs/ojs-3.0.0/lib/pkp/pages:/home/acta/ojs/ojs-

3.0.0/lib/pkp/lib/adodb:/home/acta/ojs/ojs-3.0.0/lib/pkp/lib/phputf8:/home/acta/ojs/ojs-3.0.0/lib/pkp/lib/pqp/classes:/home/acta/ojs/ojs-3.0.0/lib/pkp/lib/smarty:.:/usr/local/share/pear’) in

/home/acta/ojs/ojs-3.0.0/lib/pkp/classes/cache/FileCache.inc.php on line 46

2016-09-19 10:38:47 PHP Warning: include(/home/acta/ojs/ojs-3.0.0/cache/fc-pluginSettings-1-webfeedblockplugin.php): failed to open stream: No such file or directory in /home/acta/ojs/ojs-

3.0.0/lib/pkp/classes/cache/FileCache.inc.php on line 46

2016-09-19 15:45:39 FileApiHandler: File /home/acta/ojs/files/journals/1//articles/1/submission/1-7-4-2-2-20160916.eps does not exist or is not readable!
2016-09-19 15:45:39 ojs2: 500 Internal Server Error


Could you please have a look at them, perhaps you can figure out what can cause problems with these files?
In our files directory their actual names are: 1-7-4-1-2-20160916.eps and 2-7-22-1-2-20160919.ps, and as to my knowledge we were not doing round 2 revision.

I hope I made my description clear enough, thank you for help.

Anna

Hi,

This is a separate case from what I described above.

Are cache and files folder both writable and readable? You could make sure they are and then empty cache from the site admin panel.

Follow-up to this issue.

Before another test upgrade I ran this in my files folder:
find . -name '*.*' -exec sh -c ' a=$(echo "$0" | sed -r "s/([^.]*)\$/\L\1/"); [ "$a" != "$0" ] && mv "$0" "$a" ' {} \;

With 45 journals / 50 gigs of files it did not take too long to convert all extensions to lower case.

I still had around 50 errors regarding files not being found, but it seems that these files are actually missing. Our installation is 10 years old, so I guess that is no wonder.