Error on upgrading from 2.4.8_1 to 3.1.1


#3

After the fix for 4287, these records of missing files will be skipped in the upgrade process. If you recommend deleting the records, should we output that as warnings within the upgrade process so that users can delete the record (or re-add the missing files)?


#4

Thanks for your responds
I ran this query, but the result is empty!!

What should I do?

Regards
Amir


#5

Hi @ctgraham,

Yes, I think it would be best if the DB would be clean, so that we do not encounter similar problems in the future…

Thanks!!!
(Somehow this haven’t crossed my mind :-\ )

Best,
Bozana


#6

Hi @Amir_Darejeh

Hmmm…
Could you maybe also try this SQL:

SELECT a.journal_id, sf.* FROM article_supplementary_files sf, articles a WHERE a.article_id = sf.article_id AND sf.file_id <> 0 AND sf.remote_url IS NULL and sf.file_id not in (select f.file_id from article_files f)

Thanks!
Bozana


#7

Thanks
But the result still is empty!

What should I do?

Regards
Amir


#8

Hi @Amir_Darejeh

Hmmm… Maybe then to first fix those missing files reported in the function/section [code: Installer Installer::migrateFiles] (for example WARNING: Unable to find a match for “613-3898-1-LE.docx” in “/var/www/vhosts/abc.xyz/ojs3.abc.xyz/files/journals/1//articles/613/”. Skipping this file.). You have to do that in your OJS 2 installation. When all are fixed i.e. either removed or uploaded correctly, then make a new full backup of your OJS 2 installation again – keep all full backups, between all steps you do!!! – and start a new update on that new clean backup. Then report what messages you see…

EDIT: maybe also to be sure: check if all your articles have a section_id in your DB table articles and if all those section IDs exist in the DB table sections:

SELECT a.article_id FROM articles a WHERE a.section_id IS NULL or a.section_id  = ''
SELECT a.article_id FROM articles a LEFT JOIN sections s ON (a.section_id = s.section_id) WHERE s.section_id IS NULL

Best,
Bozana


#9

Hi Bozana
I ran those queries and got just one result, so what should I do with this?

Regards
Amir


#10

Hi @Amir_Darejeh

Which SQL returned one result?

Best,
Bozana


#11

Hi
Both that you mentioned!

Regards
Amir


#12

Hi @Amir_Darejeh,

For the first SQL: You would then need to enter the correct section ID for that article that has section_id = NULL in the DB table articles.
For the second SQL: You would need to investigate why that section ID does not exist and change it to an existing section ID.

Best,
Bozana


#13

Hi again
I tried and tried many times and each time I got new messages, but in my some final tries each time I got same messages!

s/file/FileManager.inc.php on line 159
                                  PHP Warning:  assert(): Assertion failed i                                                            n /var/www/vhosts/gmj.ir/httpdocs/lib/pkp/classes/submission/PKPSubmissionFileDA                                                            O.inc.php on line 374
                 PHP Warning:  copy(/var/www/vhosts/gmj.ir/httpdocs/files/jo                                                            urnals/1//articles/1216/attachment/1216-1-6740-1-13-20180505.docx): failed to op                                                            en stream: No such file or directory in /var/www/vhosts/gmj.ir/httpdocs/lib/pkp/                                                            classes/file/FileManager.inc.php on line 159
                                        PHP Warning:  assert(): Assertion fa                                                            iled in /var/www/vhosts/gmj.ir/httpdocs/lib/pkp/classes/submission/PKPSubmission                                                            FileDAO.inc.php on line 374
                        PHP Warning:  assert(): Assertion failed in /var/www                                                            /vhosts/gmj.ir/httpdocs/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php                                                             on line 374
       PHP Warning:  assert(): Assertion failed in /var/www/vhosts/gmj.ir/ht                                                            tpdocs/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php on line 374
                                                                      PHP Wa                                                            rning:  assert(): Assertion failed in /var/www/vhosts/gmj.ir/httpdocs/lib/pkp/cl                                                            asses/submission/PKPSubmissionFileDAO.inc.php on line 374
                                                     PHP Warning:  assert():                                                             Assertion failed in /var/www/vhosts/gmj.ir/httpdocs/lib/pkp/classes/submission/                                                            PKPSubmissionFileDAO.inc.php on line 374
                                                   PHP Warning:  copy(/var/w                                                            ww/vhosts/gmj.ir/httpdocs/files/journals/1//articles/1446/attachment/1446-1-8383                                                            -1-13-20181217.jpg): failed to open stream: No such file or directory in /var/ww                                                            w/vhosts/gmj.ir/httpdocs/lib/pkp/classes/file/FileManager.inc.php on line 159
                                                                         PHP                                                             Warning:  assert(): Assertion failed in /var/www/vhosts/gmj.ir/httpdocs/lib/pkp                                                            /classes/submission/PKPSubmissionFileDAO.inc.php on line 374
                                                        PHP Warning:  copy(/                                                            var/www/vhosts/gmj.ir/httpdocs/files/journals/1//articles/1446/attachment/1446-1                                                            -8384-1-13-20181217.jpg): failed to open stream: No such file or directory in /v                                                            ar/www/vhosts/gmj.ir/httpdocs/lib/pkp/classes/file/FileManager.inc.php on line 1                                                            59
  PHP Warning:  assert(): Assertion failed in /var/www/vhosts/gmj.ir/httpdocs/li                                                            b/pkp/classes/submission/PKPSubmissionFileDAO.inc.php on line 374
                                                             PHP Warning:  a                                                            ssert(): Assertion failed in /var/www/vhosts/gmj.ir/httpdocs/lib/pkp/classes/sub                                                            mission/PKPSubmissionFileDAO.inc.php on line 374
                                            PHP Warning:  assert(): Assertio                                                            n failed in /var/www/vhosts/gmj.ir/httpdocs/lib/pkp/classes/submission/PKPSubmis                                                            sionFileDAO.inc.php on line 374
                           PHP Warning:  assert(): Assertion failed in /var/                                                            www/vhosts/gmj.ir/httpdocs/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.p                                                            hp on line 374
          PHP Warning:  assert(): Assertion failed in /var/www/vhosts/gmj.ir                                                            /httpdocs/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php on line 374
                                                                         PHP                                                             Warning:  assert(): Assertion failed in /var/www/vhosts/gmj.ir/httpdocs/lib/pkp                                                            /classes/submission/PKPSubmissionFileDAO.inc.php on line 374
                                                        PHP Warning:  assert                                                            (): Assertion failed in /var/www/vhosts/gmj.ir/httpdocs/lib/pkp/classes/submissi                                                            on/PKPSubmissionFileDAO.inc.php on line 374
                                       PHP Warning:  assert(): Assertion fai                                                            led in /var/www/vhosts/gmj.ir/httpdocs/lib/pkp/classes/submission/PKPSubmissionF                                                            ileDAO.inc.php on line 374
                      PHP Warning:  assert(): Assertion failed in /var/www/v                                                            hosts/gmj.ir/httpdocs/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php on                                                             line 374
     PHP Warning:  assert(): Assertion failed in /var/www/vhosts/gmj.ir/http                                                            docs/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php on line 374
                                                                    PHP Warn                                                            ing:  copy(/var/www/vhosts/gmj.ir/httpdocs/files/journals/1//articles/1467/attac                                                            hment/1467-1-8454-1-13-20181225.docx): failed to open stream: No such file or di                                                            rectory in /var/www/vhosts/gmj.ir/httpdocs/lib/pkp/classes/file/FileManager.inc.                                                            php on line 159
           PHP Warning:  assert(): Assertion failed in /var/www/vhosts/gmj.i                                                            r/httpdocs/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php on line 374
                                                                          PH                                                            P Warning:  copy(/var/www/vhosts/gmj.ir/httpdocs/files/journals/1//articles/1467                                                            /attachment/1467-1-8455-1-13-20181225.jpeg): failed to open stream: No such file                                                             or directory in /var/www/vhosts/gmj.ir/httpdocs/lib/pkp/classes/file/FileManage                                                            r.inc.php on line 159
                 PHP Warning:  assert(): Assertion failed in /var/www/vhosts                                                            /gmj.ir/httpdocs/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php on line                                                             374
PHP Warning:  copy(/var/www/vhosts/gmj.ir/httpdocs/files/journals/1//article                                                            s/1468/attachment/1468-1-8459-1-13-20181225.docx): failed to open stream: No suc                                                            h file or directory in /var/www/vhosts/gmj.ir/httpdocs/lib/pkp/classes/file/File                                                            Manager.inc.php on line 159
                       PHP Warning:  assert(): Assertion failed in /var/www/                                                            vhosts/gmj.ir/httpdocs/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php o                                                            n line 374
      PHP Warning:  assert(): Assertion failed in /var/www/vhosts/gmj.ir/htt                                                            pdocs/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php on line 374
                                                                     PHP War                                                            ning:  copy(/var/www/vhosts/gmj.ir/httpdocs/files/journals/1//articles/1474/atta                                                            chment/1474-1-8511-1-13-20190101.docx): failed to open stream: No such file or d                                                            irectory in /var/www/vhosts/gmj.ir/httpdocs/lib/pkp/classes/file/FileManager.inc                                                            .php on line 159
            PHP Warning:  assert(): Assertion failed in /var/www/vhosts/gmj.                                                            ir/httpdocs/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php on line 374
                                                                           P                                                            HP Warning:  copy(/var/www/vhosts/gmj.ir/httpdocs/files/journals/1//articles/147                                                            4/attachment/1474-1-8512-1-13-20190101.docx): failed to open stream: No such fil                                                            e or directory in /var/www/vhosts/gmj.ir/httpdocs/lib/pkp/classes/file/FileManag                                                            er.inc.php on line 159
                  PHP Warning:  assert(): Assertion failed in /var/www/vhost                                                            s/gmj.ir/httpdocs/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php on lin                                                            e 374
 [code: Installer Installer::provideSupplementaryFilesForReview]
                                                                [code: Insta                                                            ller Installer::setFileUploader]
                            [code: Installer Installer::setFileName]
                                                                    [data: d                                                            bscripts/xml/upgrade/3.0.0_postupdate.xml]
                                      [data: dbscripts/xml/upgrade/3.0.0_pub                                                            Id_settings.xml]
            [data: dbscripts/xml/upgrade/3.0.0_postupgrade_galley_files.xml]
                                                                           [                                                            data: dbscripts/xml/upgrade/3.0.0_postupgrade_metrics.xml]
                                                      [data: dbscripts/xml/u                                                            pgrade/3.0.0_issue_settings.xml]
                            [data: dbscripts/xml/upgrade/3.0.0_submission_se                                                            ttings.xml]
       [data: dbscripts/xml/upgrade/3.0.0_review_method.xml]
                                                            [data: dbscripts                                                            /xml/upgrade/3.0.0_edit_decisions.xml]
                                  [code: Installer Installer::convertComment                                                            sToEditor]
      [note: docs/release-notes/README-3.0]
                                           [note: docs/release-notes/README-                                                            3.0.1]
  [data: dbscripts/xml/upgrade/3.0.2_update.xml]
                                                [note: docs/release-notes/RE                                                            ADME-3.0.2]
       [code: Installer Installer::moveReviewerFiles]
                                                     <h1>There are no readab                                                            le files in this directory tree. Are safe mode or open_basedir active?</h1>ojs2:                                                             There are no readable files in this directory tree. Are safe mode or open_based                                                            ir active?

In each try, I got list of many missing files(files mentioned above are only some of them) and after fixing them, I replaced DB with old version and then ran upgrade command again, and I got list of new missing files again and upgrade process be terminated by this sentence:

There are no readable files in this directory tree. Are safe mode or open_basedir active?ojs2: There are no readable files in this directory tree. Are safe mode or open_basedir active?

Please help me

Regards
Amir


#14

Hi @Amir_Darejeh

Hmmm… Where exactly (in which installation) and how did you fix the missing files?
You should correctly fix them in your 2.4.8 installation, then make a full backup again, and copy it (DB and files folder) on a test environment where you try the upgrade. Have you done it so?

Best,
Bozana


#15

Hi
I did exactly things that you said in my previous attempts!
I’d upgrade many OJS 2.4.8 to OJS 3.x but in this case I’m so confused!

What should I do ?

Regards
Amir


#16

Hi @Amir_Darejeh

I cannot see correctly the error messages in your last post, but:

PHP Warning:  assert(): Assertion failed i                                                            n /var/www/vhosts/gmj.ir/httpdocs/lib/pkp/classes/submission/PKPSubmissionFileDA                                                            O.inc.php on line 374
                 PHP Warning:  copy(/var/www/vhosts/gmj.ir/httpdocs/files/jo     

Those messages seems to have problems with those files – the files are either not there or cannot be copied (e.g. because of the permissions in your files folder). Thus, could you double check all those files in your OJS 2.4.8 installation and that they are there and that you can download/access them via GUI?
Also, please double check that your permissions on the files folder before the upgrade are correct.
It seems like some files cannot be correctly migrated during the upgrade process…
And finally, you could try to debug, to see what is going on, e.g. to print out the variable $sourceFile and $targetFilePath before this line: https://github.com/pkp/pkp-lib/blob/ojs-3_1_1-4/classes/submission/SubmissionFileDAODelegate.inc.php#L105.

Best,
Bozana


#17

Hi @bozana
I think the error reasons come from “//” in this line:

PHP Warning: copy(/var/www/vhosts/gmj.ir/httpdocs/files/journals/1//article s/1468/attachment/1468-1-8459-1-13-20181225.docx): failed to open stream: No such file or directory in /var/www/vhosts/gmj.ir/httpdocs/lib/pkp/classes/file/File Manager.inc.php on line 159

Where can I find codes that generate these lines? and how can I fix it?

Regards
Amir


#18

Hi
Anybody there ?

@bozana


#19

Hi @Amir_Darejeh

Do you have the file /var/www/vhosts/gmj.ir/httpdocs/files/journals/1/articles/1468/attachment/1468-1-8459-1-13-20181225.docx (either in your files folder of your OJS 2 installation or of your upgraded installation)?

I think the path is constructed here: https://github.com/pkp/pkp-lib/blob/ojs-3_1_1-4/classes/file/BaseSubmissionFileManager.inc.php#L52.

Somehow I do not think “//” are the problem – else, the other users would already have encountered the same problem…

Best,
Bozana


#20

Hi
Thanks for your answer
No, in my current version 2.4.8_3 These files are not exist in the path!
What should I do ?

Regards
Amir


#21

I have the same problem!


#22

Hi @Amir_Darejeh,

And do you have them in the upgraded installation?
It would be maybe best to start a new clean upgrade via CLI and report the first warnings/errors that you see. – Somehow I do not know any more where in the upgrade process you have the problems – it seems that you have problems because some files are missing or so…

@draak, it is the same for you – you would need to provide more detailed information – to start the clean upgrade via CLI and report the first warnings/errors that you see…

Best,
Bozana