After upgrade OJS from 2.4.8 to 3.1 made all submission and user disappear

Hi Everybody,
I upgraded OJS from 2.4.8 to 3.1.0. Everythings gone very well, included the command php upgrade.php upgrade finished with the message: “Successfully upgraded to version 3.1.0.0”.
When I tried to log in the website the password didn’t work. I changed via mysql console using UPDATE users SET password=SHA1(CONCAT(username, ‘newPasswordHere’)) WHERE user_id = 1;
When I got access two things happened:
1 - All users from all journals don’t appear. The field users cames in blank;
ojs-users-roles
2 - All Submissions from all journals don’t appears.
ojs-submission

Messages from apache error that appear after access those fields:
p/classes/core/DataObject.inc.php on line 133, referer: http://submission3.scielo.br/index.php/alb/user/profile
[Mon Dec 04 13:52:38.918853 2017] [:error] [pid 26604] [client 192.168.1.91:9822] PHP Warning: Illegal string offset ‘pt_BR’ in /var/www/submission_scielo_br/htdocs/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: http://submission3.scielo.br/index.php/alb/user/profile
[Mon Dec 04 13:52:38.918895 2017] [:error] [pid 26604] [client 192.168.1.91:9822] PHP Warning: Illegal string offset ‘pt_BR’ in /var/www/submission_scielo_br/htdocs/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: http://submission3.scielo.br/index.php/alb/user/profile
[Mon Dec 04 13:52:38.918903 2017] [:error] [pid 26604] [client 192.168.1.91:9822] PHP Warning: Illegal string offset ‘pt_BR’ in /var/www/submission_scielo_br/htdocs/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: http://submission3.scielo.br/index.php/alb/user/profile
[Mon Dec 04 13:52:38.918911 2017] [:error] [pid 26604] [client 192.168.1.91:9822] PHP Warning: Illegal string offset ‘pt_BR’ in /var/www/submission_scielo_br/htdocs/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: http://submission3.scielo.br/index.php/alb/user/profile
[Mon Dec 04 13:52:38.928348 2017] [:error] [pid 26604] [client 192.168.1.91:9822] PHP Warning: Illegal string offset ‘pt_BR’ in /var/www/submission_scielo_br/htdocs/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: http://submission3.scielo.br/index.php/alb/user/profile
[Mon Dec 04 13:52:38.928396 2017] [:error] [pid 26604] [client 192.168.1.91:9822] PHP Warning: Illegal string offset ‘pt_BR’ in /var/www/submission_scielo_br/htdocs/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: http://submission3.scielo.br/index.php/alb/user/profile
[Mon Dec 04 13:52:38.928430 2017] [:error] [pid 26604] [client 192.168.1.91:9822] PHP Warning: Illegal string offset ‘pt_BR’ in /var/www/submission_scielo_br/htdocs/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: http://submission3.scielo.br/index.php/alb/user/profile
[Mon Dec 04 13:52:38.928438 2017] [:error] [pid 26604] [client 192.168.1.91:9822] PHP Warning: Illegal string offset ‘pt_BR’ in /var/www/submission_scielo_br/htdocs/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: http://submission3.scielo.br/index.php/alb/user/profile
[Mon Dec 04 13:52:38.928467 2017] [:error] [pid 26604] [client 192.168.1.91:9822] PHP Warning: Illegal string offset ‘pt_BR’ in /var/www/submission_scielo_br/htdocs/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: http://submission3.scielo.br/index.php/alb/user/profile
[Mon Dec 04 13:52:38.928475 2017] [:error] [pid 26604] [client 192.168.1.91:9822] PHP Warning: Illegal string offset ‘pt_BR’ in /var/www/submission_scielo_br/htdocs/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: http://submission3.scielo.br/index.php/alb/user/profile
[Mon Dec 04 13:52:38.928483 2017] [:error] [pid 26604] [client 192.168.1.91:9822] PHP Warning: Illegal string offset ‘pt_BR’ in /var/www/submission_scielo_br/htdocs/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: http://submission3.scielo.br/index.php/alb/user/profile
[Mon Dec 04 13:52:39.330899 2017] [:error] [pid 26604] [client 192.168.1.91:9822] PHP Warning: mktime(): It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone ‘UTC’ for now, but please set date.timezone to select your timezone. in /var/www/submission_scielo_br/htdocs/lib/pkp/lib/adodb/adodb-time.inc.php on line 1073, referer: http://submission3.scielo.br/index.php/alb/user/profile

Those lines appear all the time.

I have a problem when I want to upgrade OJS to 3.1 too. While upgrading, I face an error on SubmissionFile.inc.php file on line 643.
The error is:

PHP Fatal error: Call to a member function getUsername() on a non-object

So I cannot upgrade my OJS to 3.1. Did you face any problem during upgrading progress about submission or about any other things?
Thank
@Rondineli_Gama_Saad

Hello @MJB! I think your problem isn’t related with mine. My upgrade finished with a success message. It is better you describe the step you follow and in what moment happen it.
Best Regard,

Thanks @Rondineli_Gama_Saad
I thought because we both have problems in submissions, it might has same source.
When I click on upgrade, after about 10 seconds, I face above error.
Anyway I will be grateful if you can help me.

@MJB, see/stay on this other thread for your problem:Error when update to 3.1 version of ojs - #9 by MJB

@Rondineli_Gama_Saad, did you get any warnings during the upgrade? – I think it could happen that some errors/warnings occurred but the updated run till the end and thus finished with that message…
Also, when you go to those pages that are blank now, do you see any error in your apache error log file?

Best,
Bozana

Hello @bozana,
Yes, there were many warning during the upgrade. Those warnings can be read in (ojs-upgrade-logs.pdf - Google Drive). About apache error log file, yes I see some warnings too. The apache errors logs were mentioned in my first message.
Best Regards,

Hi @Rondineli_Gama_Saad

Hmmm… It seems like you got a lot of warnings during the upgrade… I believe you would need to fix them first…
I will take a closer look and tell you what to look for then first… I hope you still have the clean 2.4.x backup…

Best,
Bozana

Hello @bozana,
I appreciate your help and I hope you can find out the solution.
I have all data preserved, include the database backup.
Best,
Rondineli Saad

Hi @Rondineli_Gama_Saad

Above all it seems like many of your files data are not correct – either the files are missing in the files folder, or they are in one DB table, but not in the other (where they should be) :frowning:

The messages “Unable to find a match for… in … Skipping this file.” mean that there are some files missing in your files folder but they are in the DB (eventually different databases).
The messages “Reviewer files with ID … from review assignment … could not be found in the database table submission_files” mean that this file is in the DB table review_assignments, but not in the DB table article_files.
Those are important errors and you would need to check them all, to see if all those files are needed and then either to upload the correct ones or remove them using the GUI (in order to correctly upload i.e. remove them).

The messages “Illegal string offset” are very strange – I still do not understand them :frowning: Like something with your localized metadata is not quite right, but I do not know what/why…

The messages from your apache error log above are only warnings. Is there an error message at the end?

Best,
Bozana

Hi @bozana
first of all, thank you for spending your time analyzing our issue. Answer your question and doubt in sequence:
The SciELO OJS is working for a long time with a lot of journals ~150 specifically and we upgrade the system until 2.4. It is almost impossible to control inconsistency in the database and files folders. So, we don’t have the files which aren’t present in the folder files.

The messages “Unable to find a match for… in … Skipping this file.” belong to the same case I mentioned in the first paragraph. I think is related to inconsistency in database and files folder.

I restored the database and deleted all journals except one which it was used for my propose to isolate the problem. The script used was: https://gist.githubusercontent.com/rondinelisaad/7f27993a8c7fe11f3779d23a21ea3ca7/raw/48da286157dcc2cf5b4d1e5706ea9b24cefa9f3a/gistfile1.txt
This script deletes all journal except the journals related to the variable tokeepjournals. Obs: This script was validated with @asmecher.
The journal used with an example is one of that has some files disappeared.
The result can be seen at https://gist.githubusercontent.com/rondinelisaad/6368e38e3eab3019ebc3e99bf65836c2/raw/0a8a4e816d0eed1000e7ee1ce337c7af75898cfe/ojs-logs
When upgraded the website showed the same problem:

Hi @Rondineli_Gama_Saad

Phew… Yes, that’s a huge installation then…

How did you get and installed the latest OJS code? From GitHub or release package? – Maybe you miss some parts…

(If you would like, if you can, you could maybe post me (e-mail: bozana dot bokan at posteo dot net) your anonymized DB dump with that one journal and the appropriate files folder, and I can take a look at/test it locally…)

Best,
Bozana

Hello @bozana,
I installed the latest ojs code via github following the instrucción below:
git config --global url.https://.insteadOf git://
&& git clone -v --recursive --progress https://github.com/pkp/ojs.git /var/www/ojs
&& cd /var/www/ojs
&& git fetch origin
&& git checkout remotes/origin/ojs-stable-3_1_0 -b ojs-stable-3_1_0
&& git submodule update --init --recursive
&& curl -sS https://getcomposer.org/installer | php
&& cd lib/pkp
&& php …/…/composer.phar update
&& cd …/…
&& cd plugins/paymethod/paypal
&& php …/…/…/composer.phar update
&& cd …/…/…
&& cd plugins/generic/citationStyleLanguage
&& php …/…/…/composer.phar update
&& cd …/…/…
&& cp config.TEMPLATE.inc.php config.inc.php
&& chown -R www-data:www-data /var/www/ojs

About share with you the database and files, our policy doesn’t authorize to share them. Sorry!
Best Regards,

Hi @Rondineli_Gama_Saad

OK, it seems you did miss one more step, s. ojs README: https://github.com/pkp/ojs:

Install or update dependencies via NPM:

install nodejs if you don’t already have it

npm install
npm run build

This could surely solve some of the problems :slight_smile:

Regarding the policy: I totally understand that!

Best,
Bozana

Touché! I think the issue was solved. @alexxxmendonca please, analyze and give a feedback to us if the problem was solved.
@bozana thank you a lot of help us to solve this issue.

1 Like

Yes, the problem was solved!

Thank you @Rondineli_Gama_Saad and @bozana!

Hello, I am facing exactly the same problem but in the OJS 3.1.14 version

From the console I have this:

Uncaught TypeError: Cannot read property ‘_constants’ of undefined
at Object.init (build.js:6)
at submissions:154

It looks like is using vue.js, Do I need to run npm install and npm run build?