BUG after upgrade 3.0.2 to 3.1.0.1 (menu bar is missing)

Hi!

After upgrade from 3.0.2 to 3.1.0.1, the navigation menu is missing:

3.0.2:
Captura%20de%20tela%20de%202018-03-28%2010-39-29

3.1.0.1:
Captura%20de%20tela%20de%202018-03-28%2010-32-53

3.0.2:
Captura%20de%20tela%20de%202018-03-28%2010-39-02

3.1.0.1:
Captura%20de%20tela%20de%202018-03-28%2010-33-52

I noticed that the tables:
navigation_menu_item_assignments,
navigation_menu_item_assignment_settings,
navigation_menu_items,
navigation_menu_item_settings,
navigation_menus
were added after version 3.0.2, and all of them are empty in the database (I’ve tryed to upgrad just to 3.1.0.0 and get the same error)

Output from upgrade command:

[homolog] > sed -i -- 's/installed = On/installed = Off/g' {baseURL}/shared/config.inc.php 
[homolog] > php {baseURL}/tools/upgrade.php upgrade
[homolog] < [pre-install]
[homolog] < [load: upgrade.xml]
[homolog] < [version: 3.1.0.1]
[homolog] < [data: dbscripts/xml/upgrade/3.1.0_preupdate_review_assignments.xml (skipped)]
[homolog] < [data: dbscripts/xml/upgrade/3.1.0_preupdate_notes.xml (skipped)]
[homolog] < [data: dbscripts/xml/upgrade/3.1.0_preupdate_payments.xml (skipped)]
[homolog] < [schema: lib/pkp/xml/schema/common.xml]
[homolog] < [schema: lib/pkp/xml/schema/log.xml]
[homolog] < [schema: lib/pkp/xml/schema/announcements.xml]
[homolog] < [schema: lib/pkp/xml/schema/scheduledTasks.xml]
[homolog] < [schema: lib/pkp/xml/schema/temporaryFiles.xml]
[homolog] < [schema: lib/pkp/xml/schema/metadata.xml]
[homolog] < [schema: lib/pkp/xml/schema/reviews.xml]
[homolog] < [schema: lib/pkp/xml/schema/reviewForms.xml]
[homolog] < [schema: lib/pkp/xml/schema/controlledVocab.xml]
[homolog] < [schema: lib/pkp/xml/schema/submissions.xml]
[homolog] < [schema: lib/pkp/xml/schema/submissionFiles.xml]
[homolog] < [schema: lib/pkp/xml/schema/notes.xml]
[homolog] < [schema: lib/pkp/xml/schema/views.xml]
[homolog] < [schema: lib/pkp/xml/schema/genres.xml]
[homolog] < [schema: lib/pkp/xml/schema/tombstone.xml]
[homolog] < [schema: lib/pkp/xml/schema/rolesAndUserGroups.xml]
[homolog] < [schema: lib/pkp/xml/schema/metrics.xml]
[homolog] < [schema: lib/pkp/xml/schema/views.xml]
[homolog] < [schema: lib/pkp/xml/schema/libraryFiles.xml]
[homolog] < [schema: lib/pkp/xml/schema/navigationMenus.xml]
[homolog] < [schema: dbscripts/xml/ojs_schema.xml]
[homolog] < [data: dbscripts/xml/indexes.xml]
[homolog] < [code: Installer Installer::installEmailTemplate]
[homolog] < [data: dbscripts/xml/upgrade/3.1.0_update_a.xml]
[homolog] < [code: Installer Installer::fixGenreIdInFileNames]

Many of this errors, but the files really were not there:
(I assume that at some point they were deleted, but they still have some kind of reference in the database)

[homolog] < PHP Warning:  rename(files/journals/20//articles/1705//submission/final/1705-1-15394-1-6-20151201.docx,files/journals/20//articles/1705//submission/final/1705-193-15394-1-6-20151201.docx): Arquivo ou diretório não encontrado in {baseURL}/classes/install/Upgrade.inc.php on line 2490
[homolog] < Unable to move "files/journals/20//articles/1705//submission/final/1705-1-15394-1-6-20151201.docx" to "files/journals/20//articles/1705//submission/final/1705-193-15394-1-6-20151201.docx".

Continuing the output:

[homolog] < [code: Installer Installer::repairKeywordsAndSubjects]
[homolog] < [code: Installer Installer::enabledSitePlugins]
[homolog] < [code: Installer Installer::moveCSSFiles]
[homolog] < PHP Notice:  unserialize(): Error at offset 1011 of 1040 bytes in /srv/www/periodicos/releases/8/lib/pkp/classes/db/DAO.inc.php on line 352
[homolog] < [code: Installer Installer::repairSuppFilesFilestage]

More file not fount in repairSuppFilesFilestage:

[homolog] < PHP Warning:  rename(files/journals/4//articles/31//submission/31-36-77-1-2-20091030.doc,files/journals/4//articles/31//submission/proof/31-36-77-1-10-20091030.doc): Arquivo ou diretório não encontrado in {baseURL}/classes/install/Upgrade.inc.php on line 2586
[homolog] < Unable to move "files/journals/4//articles/31//submission/31-36-77-1-2-20091030.doc" to "files/journals/4//articles/31//submission/proof/31-36-77-1-10-20091030.doc".

Continuing the output:

[homolog] < [code: Installer Installer::moveReviewerFiles]
[homolog] < <h1>There are no readable files in this directory tree. Are safe mode or open_basedir active?</h1>
[homolog] < ojs2: There are no readable files in this directory tree. Are safe mode or open_basedir active?
[homolog] > sed -i -- 's/installed = Off/installed = On/g' /srv/www/periodicos/shared/config.inc.php 
database updated

As you can see [homolog] < [schema: lib/pkp/xml/schema/navigationMenus.xml] didn’t show any errors.

The upgrade was done direct from git with tag ojs-3_1_0-1

Hi @rafaelmansilha,

It looks like the upgrade didn’t complete successfully, so I suspect some parts of the upgrade related to the navigation menu didn’t finish.

Noting that one unserialize warning, did you accidentally change your character set configuration in config.inc.php while preparing for the upgrade?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I did’t have change the configuration:

client_charset = utf-8
connection_charset = utf-8
database_charset = utf8

Same as the last upgrade. I’ve looked into the tables details, and the old tables are utf8_general_ci, but navigation_menus, that is new, has Table collation utf8mb4_unicode_ci.

We are using mariaDB 10.2.9

Could it be database_charset configuration on config.inc.php?

Regards,
Rafael Mansilha

Hi @rafaelmansilha,

Double-check your settings. connection_charset should be utf8, not utf-8.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I’ve changed connection_charset to uft8 and after trying to upgrade all tables are utf8_general_ci.

Another odd thing I noticed is that in my database has 148 tables, while in a clean version for testing the ojs has 114 tables.

Anyway, during the upgrade process, we still get the serialization error:

[homolog] < [code: Installer Installer::moveCSSFiles]
[homolog] < PHP Notice:  unserialize(): Error at offset 1011 of 1040 bytes in /srv/www/periodicos/releases/9/lib/pkp/classes/db/DAO.inc.php on line 352

I’ve been looking how to fix it on stackoverflow, could this be a fix? If so, can you present to me the columns and tables that are serialized so I can apply this procedure to correct them? (now we are with version 3.0.2.0 of OJS)

Thank you very much for your attention.
Regards,
Rafael Mansilha

Hi @rafaelmansilha,

The unserialize notices generally happen when PHP gets a string of a different length than it expects when trying to rebuild an object from its string representation. OJS doesn’t use this method of storage for many things, but occasionally for data about images etc.

PHP’s serialization format looks e.g. like this:

s:16:"this is a string";

…where s says it’s a string (as opposed to a number, object, etc), the 16 is the string length, and the "this is a string" is the string value.

Unfortunately if you have an encoding problem the expected length (16) may not agree with the actual length.

I’d suggest double-checking to see whether the content getting passed into unserialize actually looks right or whether you have to do some further transcoding; if it turns out that the data looks good but your old configuration resulted in the wrong expected string lengths, you might be able to find some ideas for correcting the lengths here.

Note that ignoring the warnings will cause certain settings (generally related to image and CSS uploads like cover images) to disappear.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

That was the link is basic the same solution I’ve comment before. We are gonna try this to fix it whit this, but first I’ve to map all the collums and tables that uses serialized data. We are gonna post the results here lather.

If by chance you have the list of all the columns and tables that use serialized data, it would be of great help.

Regards,
Rafael Mansilha.

Hi @rafaelmansilha,

I would suggest looking through your database dump for the tell-tale string ;s: as I don’t think it’ll appear anywhere else but in the case of serialized data containing a string, and OTOH all of our serialized data should include at least one string.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Thanks @asmecher,

This will help a lot!

Hi @asmecher,

I have tried to solve this problem today, but the solution of those links does not seem to solve the problem, I am totally noobie in serialization, maybe you can see what the problem is in unserialization. I got a result in which when trying unserialize it returned null, aplied the funcion but it seens to be the exacly same thing:

while($row = $result->fetch_assoc()) {
        $badData = $row[$sqlTable['field']];
        $data = preg_replace_callback(
            '/s:([0-9]+):\"(.*?)\";/',
//            '/(?<=^|\{|;)s:(\d+):\"(.*?)\";(?=[asbdiO]\:\d|N;|\}|$)/s',
            function ($matches) { return "s:".strlen($matches[2]).':"'.$matches[2].'";';     },
            $badData
        );
        if (@unserialize($badData) === false){
            echo  $badData. PHP_EOL.$data. PHP_EOL. PHP_EOL;
        }
    }

}
result:

csrf|a:2:{s:9:"timestamp";i:1522778262;s:5:"token";s:32:"4e931f9ddfd9ea1ee6dffbb482db01c0";}
csrf|a:2:{s:9:"timestamp";i:1522778262;s:5:"token";s:32:"4e931f9ddfd9ea1ee6dffbb482db01c0";}

Can you see what could be causing the problem on unserialization? I’ve counted the chars and it seens to mache.

Regards,
Rafael Mansilha.

Hi @rafaelmansilha,

I doubt there’s anything wrong with the serialized data in the sessions table in the first place. It generally doesn’t include any non-ASCII data.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Note that the result is only outputed if: if (@unserialize($badData) === false). So there is something wrong with the serialized data in the sessions table

I only get false on @unserialize data from journal_settings, plugin_settings and sessions. But the sizes seems to be right to me. I don’t get the error.

Hi @asmecher,

I’ve managed to fix the unserialize problem with journal_settings and plugin_settings. I beliave that there is a bad formation with the data from sessions table

if I remove csrf| from

csrf|a:2:{s:9:"timestamp";i:1522778262;s:5:"token";s:32:"4e931f9ddfd9ea1ee6dffbb482db01c0";}

The @unserialize works.

Do you know how can I fix that?

Hi @rafaelmansilha,

You should be able to delete all entries from the sessions table, and it’ll get re-populated as needed. The only side-effect is that all users who are currently logged in will need to log in again. When you do that, is the new data also causing unserialize problems?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Sorry for the long time without giving a comeback, I had to take care of another project to be updated and only get back to that question now.

I’ve managed to fix all unserialize problems on the database the upgrade does not return a unserialize(): Error anymore

Code update:
➤ Executing task deploy:update_code
[localhost] > git rev-parse --abbrev-ref HEAD
[localhost] < master
[homolog] > if hash command 2>/dev/null; then echo 'true'; fi
[homolog] < true
[homolog] > command -v 'git'
[homolog] < /usr/bin/git
[homolog] > /usr/bin/git version
[homolog] < git version 2.1.4
[homolog] > if [ -h [ojs_dir]/release ]; then echo 'true'; fi
[homolog] < true
[homolog] > readlink [ojs_dir]/release
[homolog] < [ojs_dir]/releases/11
[homolog] > /usr/bin/git clone -b ojs-3_1_0-1 --depth 1 --recursive -q https://github.com/pkp/ojs.git [ojs_dir]/releases/11 2>&1
Note: checking out '088548629d2efc26e12b0b174d16415c0d3f0288'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

Submodule 'docs/manual' (https://github.com/pkp/ojs-user-guide) registered for path 'docs/manual'
Submodule 'lib/pkp' (https://github.com/pkp/pkp-lib.git) registered for path 'lib/pkp'
Submodule 'lib/ui-library' (https://github.com/pkp/ui-library) registered for path 'lib/ui-library'
Submodule 'plugins/blocks/makeSubmission' (https://github.com/pkp/makeSubmission.git) registered for path 'plugins/blocks/makeSubmission'
Submodule 'plugins/generic/citationStyleLanguage' (https://github.com/pkp/citationStyleLanguage.git) registered for path 'plugins/generic/citationStyleLanguage'
Submodule 'plugins/generic/customBlockManager' (https://github.com/pkp/customBlockManager.git) registered for path 'plugins/generic/customBlockManager'
Submodule 'plugins/generic/googleAnalytics' (https://github.com/pkp/googleAnalytics.git) registered for path 'plugins/generic/googleAnalytics'
Submodule 'plugins/generic/lensGalley' (https://github.com/asmecher/lensGalley) registered for path 'plugins/generic/lensGalley'
Submodule 'plugins/generic/orcidProfile' (https://github.com/pkp/orcidProfile.git) registered for path 'plugins/generic/orcidProfile'
Submodule 'plugins/generic/pdfJsViewer' (https://github.com/pkp/pdfJsViewer.git) registered for path 'plugins/generic/pdfJsViewer'
Submodule 'plugins/generic/staticPages' (https://github.com/pkp/staticPages.git) registered for path 'plugins/generic/staticPages'
Submodule 'plugins/generic/tinymce' (https://github.com/pkp/tinymce.git) registered for path 'plugins/generic/tinymce'
Submodule 'plugins/generic/translator' (https://github.com/pkp/translator.git) registered for path 'plugins/generic/translator'
Submodule 'plugins/reports/counter/classes/COUNTER' (https://github.com/ulsdevteam/COUNTER.git) registered for path 'plugins/reports/counter/classes/COUNTER'
Submodule 'plugins/reports/reviewReport' (https://github.com/pkp/reviewReport) registered for path 'plugins/reports/reviewReport'
Cloning into 'docs/manual'...
remote: Counting objects: 591, done.
remote: Total 591 (delta 0), reused 0 (delta 0), pack-reused 591
Receiving objects: 100% (591/591), 168.14 KiB | 268.00 KiB/s, done.
Resolving deltas: 100% (329/329), done.
Checking connectivity... done.
Submodule path 'docs/manual': checked out '0b3b8b4fc90805e94bcc085f2b5fcd71198a2516'
Cloning into 'lib/pkp'...
remote: Counting objects: 152925, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 152925 (delta 2), reused 4 (delta 2), pack-reused 152913
Receiving objects: 100% (152925/152925), 64.16 MiB | 1.51 MiB/s, done.
Resolving deltas: 100% (100049/100049), done.
Checking connectivity... done.
Submodule path 'lib/pkp': checked out '8fbedc94d8266ff76f2e1e030cb240e0f43209da'
Submodule 'js/lib/jquery/plugins/spectrum' (https://github.com/bgrins/spectrum.git) registered for path 'js/lib/jquery/plugins/spectrum'
Submodule 'js/lib/pnotify' (https://github.com/sciactive/pnotify.git) registered for path 'js/lib/pnotify'
Submodule 'lib/swordappv2' (https://github.com/swordapp/swordappv2-php-library.git) registered for path 'lib/swordappv2'
Cloning into 'js/lib/jquery/plugins/spectrum'...
remote: Counting objects: 2878, done.
remote: Total 2878 (delta 0), reused 0 (delta 0), pack-reused 2878
Receiving objects: 100% (2878/2878), 1.72 MiB | 483.00 KiB/s, done.
Resolving deltas: 100% (1704/1704), done.
Checking connectivity... done.
Submodule path 'lib/pkp/js/lib/jquery/plugins/spectrum': checked out '74ccb0e48f43a069b45c8b6cdf981a59ded3e271'
Cloning into 'js/lib/pnotify'...
remote: Counting objects: 6089, done.
remote: Total 6089 (delta 0), reused 0 (delta 0), pack-reused 6089
Receiving objects: 100% (6089/6089), 18.16 MiB | 1.18 MiB/s, done.
Resolving deltas: 100% (2196/2196), done.
Checking connectivity... done.
Submodule path 'lib/pkp/js/lib/pnotify': checked out 'bb727c99f50f8c9819ad5e7446729a957cd1e54c'
Cloning into 'lib/swordappv2'...
remote: Counting objects: 606, done.
remote: Total 606 (delta 0), reused 0 (delta 0), pack-reused 606
Receiving objects: 100% (606/606), 2.27 MiB | 1.36 MiB/s, done.
Resolving deltas: 100% (357/357), done.
Checking connectivity... done.
Submodule path 'lib/pkp/lib/swordappv2': checked out 'c9b7b4c2a5bcd24459cd39c795b4d98f39ce0439'
Cloning into 'lib/ui-library'...
remote: Counting objects: 1775, done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 1775 (delta 3), reused 5 (delta 0), pack-reused 1762
Receiving objects: 100% (1775/1775), 1.08 MiB | 285.00 KiB/s, done.
Resolving deltas: 100% (1058/1058), done.
Checking connectivity... done.
Submodule path 'lib/ui-library': checked out '85c5e7ec9906a554d636a12bcc0bcb1cefb81fa6'
Cloning into 'plugins/blocks/makeSubmission'...
remote: Counting objects: 201, done.
remote: Total 201 (delta 0), reused 0 (delta 0), pack-reused 200
Receiving objects: 100% (201/201), 31.39 KiB | 0 bytes/s, done.
Resolving deltas: 100% (89/89), done.
Checking connectivity... done.
Submodule path 'plugins/blocks/makeSubmission': checked out 'a793007e1c3a0b714e790a848deedbc385872c71'
Cloning into 'plugins/generic/citationStyleLanguage'...
remote: Counting objects: 406, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 406 (delta 5), reused 8 (delta 3), pack-reused 394
Receiving objects: 100% (406/406), 137.14 KiB | 0 bytes/s, done.
Resolving deltas: 100% (208/208), done.
Checking connectivity... done.
Submodule path 'plugins/generic/citationStyleLanguage': checked out 'cfa5622af8dd4b96dfe67756202b0ae4ae4c387a'
Cloning into 'plugins/generic/customBlockManager'...
remote: Counting objects: 705, done.
remote: Total 705 (delta 0), reused 0 (delta 0), pack-reused 705
Receiving objects: 100% (705/705), 108.98 KiB | 0 bytes/s, done.
Resolving deltas: 100% (370/370), done.
Checking connectivity... done.
Submodule path 'plugins/generic/customBlockManager': checked out 'aa9956efa0bfa51ffb436710e31f332c221aebfd'
Cloning into 'plugins/generic/googleAnalytics'...
remote: Counting objects: 300, done.
remote: Total 300 (delta 0), reused 0 (delta 0), pack-reused 300
Receiving objects: 100% (300/300), 68.48 KiB | 0 bytes/s, done.
Resolving deltas: 100% (140/140), done.
Checking connectivity... done.
Submodule path 'plugins/generic/googleAnalytics': checked out '09b9729b4c4e2d2eff1629081c0135cbc97dd993'
Cloning into 'plugins/generic/lensGalley'...
remote: Counting objects: 383, done.
remote: Total 383 (delta 0), reused 0 (delta 0), pack-reused 383
Receiving objects: 100% (383/383), 502.74 KiB | 309.00 KiB/s, done.
Resolving deltas: 100% (169/169), done.
Checking connectivity... done.
Submodule path 'plugins/generic/lensGalley': checked out '7a32cbc8a64d431949728a833c5a5a4fa11fb535'
Cloning into 'plugins/generic/orcidProfile'...
remote: Counting objects: 717, done.
remote: Total 717 (delta 0), reused 0 (delta 0), pack-reused 716
Receiving objects: 100% (717/717), 132.08 KiB | 0 bytes/s, done.
Resolving deltas: 100% (391/391), done.
Checking connectivity... done.
Submodule path 'plugins/generic/orcidProfile': checked out '5c77caf705eb703405e1f21dcba40bdd9640ebd9'
Cloning into 'plugins/generic/pdfJsViewer'...
remote: Counting objects: 1381, done.
remote: Total 1381 (delta 0), reused 0 (delta 0), pack-reused 1381
Receiving objects: 100% (1381/1381), 3.18 MiB | 1.42 MiB/s, done.
Resolving deltas: 100% (484/484), done.
Checking connectivity... done.
Submodule path 'plugins/generic/pdfJsViewer': checked out '72719cc67eb5af591493179f324a8c82ab31bf25'
Cloning into 'plugins/generic/staticPages'...
remote: Counting objects: 999, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 999 (delta 1), reused 7 (delta 1), pack-reused 990
Receiving objects: 100% (999/999), 177.92 KiB | 0 bytes/s, done.
Resolving deltas: 100% (501/501), done.
Checking connectivity... done.
Submodule path 'plugins/generic/staticPages': checked out '7b72e88a569620e33929319d84ad83faf316e756'
Cloning into 'plugins/generic/tinymce'...
remote: Counting objects: 722, done.
remote: Total 722 (delta 0), reused 0 (delta 0), pack-reused 722
Receiving objects: 100% (722/722), 195.75 KiB | 197.00 KiB/s, done.
Resolving deltas: 100% (306/306), done.
Checking connectivity... done.
Submodule path 'plugins/generic/tinymce': checked out '92e944c5aebf5570baa56588c30352df3c46f9ef'
Cloning into 'plugins/generic/translator'...
remote: Counting objects: 606, done.
remote: Total 606 (delta 0), reused 0 (delta 0), pack-reused 606
Receiving objects: 100% (606/606), 145.45 KiB | 0 bytes/s, done.
Resolving deltas: 100% (330/330), done.
Checking connectivity... done.
Submodule path 'plugins/generic/translator': checked out '3c365434b53c11f6a1ba915b6fcac318205ff368'
Cloning into 'plugins/reports/counter/classes/COUNTER'...
remote: Counting objects: 17, done.
remote: Total 17 (delta 0), reused 0 (delta 0), pack-reused 17
Unpacking objects: 100% (17/17), done.
Checking connectivity... done.
Submodule path 'plugins/reports/counter/classes/COUNTER': checked out 'b906f11dc647705c2d22445e79fa2c36ac01b717'
Cloning into 'plugins/reports/reviewReport'...
remote: Counting objects: 260, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 260 (delta 0), reused 2 (delta 0), pack-reused 255
Receiving objects: 100% (260/260), 45.19 KiB | 0 bytes/s, done.
Resolving deltas: 100% (125/125), done.
Checking connectivity... done.
Submodule path 'plugins/reports/reviewReport': checked out '766332c86df4b96834cf0f7e5294ea56b00c7e49'
Connection to pitangueira.uft.edu.br closed.
• done on [homolog]
✔ Ok [91s 582ms]

I’ve removed the composer update part, because the post was tooo long for here. But there were no errors

Database update:

➤ Executing task deploy:atualizar_banco
[homolog] > sed -i -- 's/installed = On/installed = Off/g' [ojs_dir]/shared/config.inc.php 
[homolog] > php [ojs_dir]/releases/11/tools/upgrade.php upgrade
[homolog] < [pre-install]
[homolog] < [load: upgrade.xml]
[homolog] < [version: 3.1.0.1]
[homolog] < [data: dbscripts/xml/upgrade/3.1.0_preupdate_review_assignments.xml]
[homolog] < [data: dbscripts/xml/upgrade/3.1.0_preupdate_notes.xml (skipped)]
[homolog] < [data: dbscripts/xml/upgrade/3.1.0_preupdate_payments.xml]
[homolog] < [schema: lib/pkp/xml/schema/common.xml]
[homolog] < [schema: lib/pkp/xml/schema/log.xml]
[homolog] < [schema: lib/pkp/xml/schema/announcements.xml]
[homolog] < [schema: lib/pkp/xml/schema/scheduledTasks.xml]
[homolog] < [schema: lib/pkp/xml/schema/temporaryFiles.xml]
[homolog] < [schema: lib/pkp/xml/schema/metadata.xml]
[homolog] < [schema: lib/pkp/xml/schema/reviews.xml]
[homolog] < [schema: lib/pkp/xml/schema/reviewForms.xml]
[homolog] < [schema: lib/pkp/xml/schema/controlledVocab.xml]
[homolog] < [schema: lib/pkp/xml/schema/submissions.xml]
[homolog] < [schema: lib/pkp/xml/schema/submissionFiles.xml]
[homolog] < [schema: lib/pkp/xml/schema/notes.xml]
[homolog] < [schema: lib/pkp/xml/schema/views.xml]
[homolog] < [schema: lib/pkp/xml/schema/genres.xml]
[homolog] < [schema: lib/pkp/xml/schema/tombstone.xml]
[homolog] < [schema: lib/pkp/xml/schema/rolesAndUserGroups.xml]
[homolog] < [schema: lib/pkp/xml/schema/metrics.xml]
[homolog] < [schema: lib/pkp/xml/schema/views.xml]
[homolog] < [schema: lib/pkp/xml/schema/libraryFiles.xml]
[homolog] < [schema: lib/pkp/xml/schema/navigationMenus.xml]
[homolog] < [schema: dbscripts/xml/ojs_schema.xml]
[homolog] < [data: dbscripts/xml/indexes.xml]
[homolog] < [code: Installer Installer::installEmailTemplate]
[homolog] < [data: dbscripts/xml/upgrade/3.1.0_update_a.xml]
[homolog] < [code: Installer Installer::fixGenreIdInFileNames]
[homolog] < PHP Warning:  rename(files/journals/20//articles/1705//submission/final/1705-1-15394-1-6-20151201.docx,files/journals/20//articles/1705//submission/final/1705-193-15394-1-6-20151201.docx): Arquivo ou diretório não encontrado in [ojs_dir]/releases/11/classes/install/Upgrade.inc.php on line 2490
[homolog] < Unable to move "files/journals/20//articles/1705//submission/final/1705-1-15394-1-6-20151201.docx" to "files/journals/20//articles/1705//submission/final/1705-193-15394-1-6-20151201.docx".

[AND a lot of Unable to move like above, but the files were not in there]

[homolog] < [code: Installer Installer::repairKeywordsAndSubjects]
[homolog] < [code: Installer Installer::enabledSitePlugins]
[homolog] < [code: Installer Installer::moveCSSFiles]
[homolog] < [code: Installer Installer::repairSuppFilesFilestage]
[homolog] < PHP Warning:  rename(files/journals/4//articles/31//submission/31-36-77-1-2-20091030.doc,files/journals/4//articles/31//submission/proof/31-36-77-1-10-20091030.doc): Arquivo ou diretório não encontrado in [ojs_dir]/releases/11/classes/install/Upgrade.inc.php on line 2586
[homolog] < Unable to move "files/journals/4//articles/31//submission/31-36-77-1-2-20091030.doc" to "files/journals/4//articles/31//submission/proof/31-36-77-1-10-20091030.doc".

[AND a lot of Unable to move like above, but the files were not in there]    

[homolog] < [code: Installer Installer::moveReviewerFiles]
[homolog] < <h1>There are no readable files in this directory tree. Are safe mode or open_basedir active?</h1>
[homolog] < ojs2: There are no readable files in this directory tree. Are safe mode or open_basedir active?
[homolog] > sed -i -- 's/installed = Off/installed = On/g' [ojs_dir]/shared/config.inc.php 
Banco de dados atualizado
• done on [homolog]
✔ Ok [724s 309ms]

As you can see the @unserialized error is gone, but the menur bar is still missing

Hi @rafaelmansilha,

The upgrade does not complete – it fails here:

[homolog] < [code: Installer Installer::moveReviewerFiles]
[homolog] < <h1>There are no readable files in this directory tree. Are safe mode or open_basedir active?</h1>

There is another thread in the forum ([Solved] Upgrading 3.0.2 to 3.1.01 moveReviewerFiles fails) where the same error is discussed, and it seems to be related to articles that are orphaned from a journal that was removed. Can you check whether there are any articles in your database with a non-existent journal? To do this, run the following SQL:

SELECT submission_id FROM submissions s LEFT JOIN journals j ON (s.context_id = j.journal_id) WHERE j.journal_id IS NULL;

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher,

Thanks for the fast feedback! Indeed there are 96 occurrences. What procedure you suggest? Can I just remove them from submissions table? or I have to remove all occurrences from all tables? Or theres is a UI way to do this?

Hi @rafaelmansilha,

I think the best approach might be to recreate the missing entry in journals by hand (e.g. via phpMyAdmin), then with the newer code in place, try deleting that journal again via the web interface. This should clean up all relevant data. Make a backup before you try.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

As I don’t know the structure of OJS (I only know now from your reply that context_id is the journal_id on submissions table) to create the entries of the 5 journals deleted long time ago on version 2.x of OJS , i’ve created a new journal (theoretically it should create all the needed entryes required to use the delete journal function) and i’ve updated all the journal_id and context_id entries of the 5 deleted journals with the news journal_id. But when I tried to delete the journal it not work, and there were no feedback of why from aplication or errors logs.

As for second try I’ve decied to remove all occurrences from all tables that a managed to get association with the deleted journals by running the following commands:

DELETE FROM roles WHERE journal_id IN (4,3,7,2,5);
DELETE FROM rt_versions WHERE journal_id IN (4,3,7,2,5);
DELETE FROM notification_subscription_settings WHERE context IN (4,3,7,2,5);
DELETE FROM metrics WHERE context_id IN (4,3,7,2,5);
DELETE FROM authors WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM books_for_review WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM comments WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM dataverse_files WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM dataverse_studies WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM edit_decisions WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM library_files WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM metrics WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM object_for_review_assignments WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM published_submissions WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM referrals WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM review_assignments WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM review_round_files WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM review_rounds WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM stage_assignments WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM submission_comments WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM submission_files WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM submission_galleys WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM submission_search_objects WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM submission_settings WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM submission_tombstones WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM submission_xml_galleys WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM submissions WHERE context_id IN (4,3,7,2,5);
DELETE FROM user_groups WHERE context_id IN (4,3,7,2,5);
DELETE FROM user_group_stage WHERE context_id IN (4,3,7,2,5);

4,3,7,2,5 are the journals ids that I get from your query:

But I’m still getting: <h1>There are no readable files in this directory tree. Are safe mode or open_basedir active?</h1> error in [code: Installer Installer::moveReviewerFiles]

I really need some help here about what missing entries to creat, or what do look and delete from database.

Regards,
Rafael Mansilha.

Hi @rafaelmansilha,

I wouldn’t suggest creating a journal through the web interface – that’ll create all sorts of dependent objects. I meant instead to just create the entry in the journals table (e.g. using phpMyAdmin) with a journal_id corresponding to the context_id in submissions, then using the web interface to delete that journal. If all goes correctly, you should be able to re-run the SELECT statement above and get no results.

Regards,
Alec Smecher
Public Knowledge Project Team