Error - Update OJS 2.4.8.3 to 3.1.2.0

Hi,

  • Launch the OJS 2.4.8.3 update and the first time it failed with the following error:

[data: dbscripts/xml/upgrade/3.0.0_update.xml]
ERROR: Upgrade failed: DB: Illegal mix of collations (latin1_swedish_ci,IMPLICIT), (utf8_general_ci,COERCIBLE), (utf8_general_ci,COERCIBLE) for operation ‘replace’

  • Then modify the encoding and characters of the database, tables and columns to utf8 and utf8_general_ci as it was in latin1. And the mysql engine is MyISAM, but in the DB, there are tables with MyISAM engine and others with InnoDB. What should the OJS database have for the update.
  • I launched the update again and it came back and failed, showing me the following error.

The encoding in the config.inc.php files are as follows:
OJS:2.4.8.3

image

OJS 3.1.2.0

image

[schema: lib/pkp/xml/schema/common.xml]
ERROR: Upgrade failed: DB: Data too long for column ‘setting_value’ at row 59042

But now I don’t know what to do

Hi @diegomejia07,

Since the database_charset and connection_charset settings were commented out in your OJS 2.4.8-3 configuration file, I suspect Latin1 defaults were used (according to your database server’s configuration) and special characters are double-encoded. When you try to upgrade OJS with the database configured for UTF-8, a further encoding occurs, leading to garbled characters and higher storage requirements (Data too long for column).

The best solution will be to resolve the encoding problem. It’s more of a MySQL question than an OJS question but essentially it’ll probably involve running a mysqldump through iconv or something similar. Then verify by looking through the mysqldump for accented characters and make sure they’re represented properly. Then reload the dump. (This should all be done on the OJS 2.x database before upgrading, in order to avoid further complicating the scenario.) Once this is done, you should be able to uncomment those OJS2 configuration file lines and verify that everything is working with UTF-8 as expected.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

But all the modification of the encoding and the characters of the database, tables and columns to utf8 and utf8_general_ci, I did it in the DB version 2.4.8.3 and check the platform and all the characters were fine.

Or what happens if I leave the file config.inc.php of version 3.1.2.0 the same as that of version 2.4.8.3 and update, and after updating, I modify the characters. Or does not update?

Hi @diegomejia07,

If the accented characters appear to be OK in the OJS web site, but your connection_charset and database_charset options are not configured to utf8 (as you’ve shown in the screenshot), then the contents in the database are probably double-encoded and it only works because of the misconfiguration. You could try to use the same configuration in OJS 3.x, and I believe that would work, but longer term I would recommend fixing the data so that it’s properly encoded.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I would like to try to update like this with that encoding that OJS 2.4.8.3 has, and then in version 3.1.2.0, if correcting the characters in the database. Is it okay to proceed like this?

I will still try to update, and if it fails or works, I will be letting you know.

Thanks.

Hi @diegomejia07,

That should be possible, but make sure you’re using the same configuration in config.inc.php for both OJS 2.x or 3.x. Watch out for a change to configuration that results in a mix of two types of encoding, one for older content, another for newer content. Disentangling mixed character encodings will be very difficult.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Run the update again as I told you and it failed, due to some recurring messages:

Unable to move "C:/wamp64/Archivos_ojs/journals/2//articles/1161//supp/1161-4030-1-SP.docx" to "C:/wamp64/Archivos_ojs/journals/2//articles/1161//attachment/1161-13-4030-1-13-20190614.docx.
PHP Warning:  rename(C:/wamp64/Archivos_ojs/journals/2//articles/1161//supp/1161-4031-1-SP.docx,C:/wamp64/Archivos_ojs/journals/2//articles/1161//attachment/1161-13-4031-1-13-20190614.docx): Access is denied. (code: 5) in C:\wamp64\www\revistasiue\classes\install\Upgrade.inc.php on line 965
WARNING: Unable to find a match for "83-234-1-SM.pdf" in "C:/wamp64/Archivos_ojs/journals/1//articles/83/". Skipping this file.
Unable to move "C:/wamp64/Archivos_ojs/journals/1//articles/1345//submission/original/1345-4383-1-SM.docx" to "C:/wamp64/Archivos_ojs/journals/1//articles/1345//submission/1345-1-4383-1-2-20200728.docx".
WARNING: Unable to find a match for "227-780-1-SM.pdf" in "C:/wamp64/Archivos_ojs/journals/3//articles/227/". Skipping this file.
WARNING: Unable to find a match for "228-782-1-SM.pdf" in "C:/wamp64/Archivos_ojs/journals/3//articles/228/". Skipping this file.
PHP Warning:  copy(C:/wamp64/Archivos_ojs/journals/1//articles/1297/attachment/1297-1-4277-1-13-20200327.pdf): failed to open stream: No such file or directory in C:\wamp64\www\revistasiue\lib\pkp\classes\file\FileManager.inc.php on line 162
PHP Warning:  assert(): assert(is_readable($targetFilePath)) failed in C:\wamp64\www\revistasiue\lib\pkp\classes\submission\SubmissionFileDAODelegate.inc.php on line 123

And this was the error fatla with which the update failed

PHP Fatal error:  Uncaught Error: Call to a member function getFileId() on null in C:\wamp64\www\revistasiue\lib\pkp\classes\file\SubmissionFileManager.inc.php:184
Stack trace:
#0 C:\wamp64\www\revistasiue\classes\install\Upgrade.inc.php(1476): SubmissionFileManager->copyFileToFileStage('4106', 1, 4, NULL, true)
#1 C:\wamp64\www\revistasiue\lib\pkp\classes\install\Installer.inc.php(421): Upgrade->provideSupplementaryFilesForReview(Object(Upgrade), Array)
#2 C:\wamp64\www\revistasiue\lib\pkp\classes\install\Installer.inc.php(265): Installer->executeAction(Array)
#3 C:\wamp64\www\revistasiue\lib\pkp\classes\install\Installer.inc.php(186): Installer->executeInstaller()
#4 C:\wamp64\www\revistasiue\lib\pkp\classes\cliTool\UpgradeTool.inc.php(88): Installer->execute()
#5 C:\wamp64\www\revistasiue\lib\pkp\classes\cliTool\UpgradeTool.inc.php(64): UpgradeTool->upgrade()
#6 C:\wamp64\www\revistasiue\tools\upgrade.php(34): UpgradeTool->execute()
#7 {main}
thrown in C:\wamp64\www\revistasiue\lib\pkp\classes\file\SubmissionFileManager.inc.php on line 184

I would like to know what I can do to organize these messages and the fatal error before updating again

Thanks.

Hi @diegomejia07,

The OJS 2.x to 3.x upgrade process also rearranges the files_dir (in config.inc.php) so if you want to re-run the upgrade you should also restore that from backup (along with your database). There was a quirk in the OJS upgrade process in older releases (including 3.1.2-0) that led to missing files causing errors like you see; this has been resolved in OJS 3.2.1-x so that they just result in warnings. So another way to work around this would be to upgrade to a newer release (which I’d recommend anyway).

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

If I know that every time an update is going to be done, and it fails, everything must be restored again. The missing files do not know why they are missing, but every time I update I do so by restoring the backup copy of my installation, data and BD. Then you would better advise me to upgrade to version 3.2.1, instead of 3.1.2.0.

Hi @diegomejia07,

Yes, I’d recommend upgrading to the latest release rather than 3.1.2. (We’re planning to release a new build – OJS 3.2.1-2 – perhaps late this week.) In the meantime, one option would be to put placeholder documents where the upgrade process warns about missing files; you may be able to bypass this error that way.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I already update to version 3.2.1.0, and it seems to me that so far it is working fine. I have a few things I want to ask:

  1. How do I translate the texts from English to Spanish, which come in some themes and plugins and are not translated, since in this version, the translation module, I cannot find it.

  2. I enter one of the journals, and I enter the users section, and it does not load the list of users, and it stays loading. It may be that many users are associated with this journal. How can you list them faster.

  3. And another is that the tar module of the path that I have on my Windows Server, does not decompress the modules.

Thanks…

Hi @diegomejia07,

How do I translate the texts from English to Spanish, which come in some themes and plugins and are not translated, since in this version, the translation module, I cannot find it.

See: PKP Translating Guide

I enter one of the journals, and I enter the users section, and it does not load the list of users, and it stays loading. It may be that many users are associated with this journal. How can you list them faster.

It might be a slow load, or it might be a PHP error. Check your PHP error log for details.

And another is that the tar module of the path that I have on my Windows Server, does not decompress the modules.

I don’t have a Windows installation to test with, but other users have found solutions, e.g. this one: The tar command is not available. Please correctly configure it in your "config.inc.php" - #13 by nicolols

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

It is very strange because I have several journals and only one does not load the list of users and I already checked the lists and the numbers to show these, and they are fine. After a while loading, it showed me the following error 500 and jquery.min, or I don’t know if there are many users associated with this journal:

$$$call$$$/grid/settings/user/user-grid/fetch-grid?oldUserId=&

I have the path to the tar configured correctly, in the config.inc.php file, but when trying to load, install or update any module, it shows me the following:

Files of this type cannot be uploaded.

Hi @asmecher,

The list of users, I could organize it.

Regarding the installation of the plugins, I have a problem in which it shows me and does not install, and in the php errors, I get the following message, but I don’t know what it can be, and as the OJS is installed in Windows, I don’t know what the error could be:

C:\Windows\System32\tar.exe: Missing file name after -C

Could you help me with this error, since I don’t know how to solve it.

Hi @diegomejia07,

What is your tar setting in config.inc.php?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

The tar configuration in the archive config.inc.php es:

tar = C:\Windows\System32\tar.exe

Hi @diegomejia07,

Check your PHP error log for details; I suspect you’ll see a warning mentioning mkdir and stating that PHP doesn’t have permission to create directories.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

If they were permission problems indeed.

But I have another problem, when trying to upload a .css file to the platform, it shows me the following error:

POST /api/v1/temporaryFiles 403 (Forbidden) at build.js?v=3.2.1.0:8

image

Hi @diegomejia07,

I’d suggest checking if you have a server-side security tool like mod_security that’s blocking the request from going through.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Thanks for your answer, indeed that was the problem and some permissions on some folders.