Upgrade ojs 3.0.2 error classes/db/DAO.inc.php and classes/core/DataObject.inc.php on line 133

[code: Installer Installer::concatenateIntoAbout]
PHP Warning: Cannot use a scalar value as an array in /home/journal/ojs302/lib/pkp/classes/core/DataObject.inc.php on line 133
PHP Warning: Cannot use a scalar value as an array in /home/journal/ojs302/lib/pkp/classes/db/SettingsDAO.inc.php on line 41
PHP Notice: unserialize(): Error at offset 63 of 273 bytes in /home/journal/ojs302/lib/pkp/classes/db/DAO.inc.php on line 347
PHP Notice: unserialize(): Error at offset 63 of 276 bytes in /home/journal/ojs302/lib/pkp/classes/db/DAO.inc.php on line 347
PHP Warning: Cannot use a scalar value as an array in /home/journal/ojs302/lib/pkp/classes/core/DataObject.inc.php on line 133
PHP Notice: unserialize(): Error at offset 63 of 273 bytes in /home/journal/ojs302/lib/pkp/classes/db/DAO.inc.php on line 347
PHP Notice: unserialize(): Error at offset 63 of 276 bytes in /home/journal/ojs302/lib/pkp/classes/db/DAO.inc.php on line 347
PHP Warning: Cannot use a scalar value as an array in /home/journal/ojs302/lib/pkp/classes/db/SettingsDAO.inc.php on line 41

[code: Installer Installer::concatenateIntoMasthead]
PHP Warning: Cannot use a scalar value as an array in /home/journal/ojs302/lib/pkp/classes/core/DataObject.inc.php on line 133
PHP Warning: Cannot use a scalar value as an array in /home/journal/ojs302/lib/pkp/classes/db/SettingsDAO.inc.php on line 41
PHP Notice: unserialize(): Error at offset 63 of 273 bytes in /home/journal/ojs302/lib/pkp/classes/db/DAO.inc.php on line 347
PHP Notice: unserialize(): Error at offset 63 of 276 bytes in /home/journal/ojs302/lib/pkp/classes/db/DAO.inc.php on line 347
PHP Warning: Cannot use a scalar value as an array in /home/journal/ojs302/lib/pkp/classes/core/DataObject.inc.php on line 133
PHP Notice: unserialize(): Error at offset 63 of 273 bytes in /home/journal/ojs302/lib/pkp/classes/db/DAO.inc.php on line 347
PHP Notice: unserialize(): Error at offset 63 of 276 bytes in /home/journal/ojs302/lib/pkp/classes/db/DAO.inc.php on line 347
PHP Warning: Cannot use a scalar value as an array in /home/journal/ojs302/lib/pkp/classes/db/SettingsDAO.inc.php on line 41
PHP Notice: unserialize(): Error at offset 63 of 273 bytes in /home/journal/ojs302/lib/pkp/classes/db/DAO.inc.php on line 347
PHP Notice: unserialize(): Error at offset 63 of 276 bytes in /home/journal/ojs302/lib/pkp/classes/db/DAO.inc.php on line 347
PHP Warning: Cannot use a scalar value as an array in /home/journal/ojs302/lib/pkp/classes/db/SettingsDAO.inc.php on line 41

Hi @sorayainth

Hmmm… :-
Lets consider first the function “concatenateIntoAbout”:
Could you please post how the following entries/rows look like in your DB journal_settings (you can replace the text with some default text, if you want): where setting_name is focusScopeDesc, reviewPolicy, pubFreqPolicy, openAccessPolicy, customAboutItems, sponsorNote, sponsors, contributorNote, contributors, history ?

Thanks a lot!
Bozana

Hi, I have a similar problem when I am trying to migrated from ojs-stable2_4_8 to 3.1.1
With PHP 5.6 and MySQL 5.6.40

1406: Data too long for column 'setting_value' at row 1
									ADOConnection._Execute(INSERT INTO journal_settings 					(journal_id, setting_name, setting_value, setting_type, locale) 					VALUES ('152', 'about', '...)% line 1032, file: /ojs/lib/pkp/lib/adodb/adodb.inc.php
								ADOConnection.Execute(INSERT INTO journal_settings 					(journal_id, setting_name, setting_value, setting_type, locale) 					VALUES (?, ?, ?, ?, ?), Array[5])% line  223, file: /ojs/lib/pkp/classes/db/DAO.inc.php
							DAO.update(INSERT INTO journal_settings 					(journal_id, setting_name, setting_value, setting_type, locale) 					VALUES (?, ?, ?, ?, ?), Array[5])% line  232, file: /ojs/lib/pkp/classes/db/SettingsDAO.inc.php
						SettingsDAO.updateSetting(152, about, Array[3], string, true)% line 2071, file: /ojs/classes/install/Upgrade.inc.php
					Upgrade.concatenateIntoAbout(Object:Upgrade, Array[1])% line    0, file: 
<h1>DB Error: Data too long for column 'setting_value' at row 1</h1><h4>Stack Trace:</h4>
<strong>File:</strong> /ojs/lib/pkp/classes/db/SettingsDAO.inc.php line 232<br />
<strong>Function:</strong> DAO->update("INSERT INTO journal_settings
					(journal_id, setting_name, set...", Array(5))<br />
<br/>
<strong>File:</strong> /ojs/classes/install/Upgrade.inc.php line 2071<br />
<strong>Function:</strong> SettingsDAO->updateSetting("152", "about", Array(3), "string", True)<br />
<br/>
<strong>File:</strong> (unknown) line (unknown)<br />
<strong>Function:</strong> Upgrade->concatenateIntoAbout(Object(Upgrade), Array(1))<br />
<br/>
<strong>File:</strong> /ojs/lib/pkp/classes/install/Installer.inc.php line 415<br />
<strong>Function:</strong> call_user_func(Array(2), Object(Upgrade), Array(1))<br />
<br/>
<strong>File:</strong> /ojs/lib/pkp/classes/install/Installer.inc.php line 265<br />
<strong>Function:</strong> Installer->executeAction(Array(3))<br />
<br/>
<strong>File:</strong> /ojs/lib/pkp/classes/install/Installer.inc.php line 186<br />
<strong>Function:</strong> Installer->executeInstaller()<br />
<br/>
<strong>File:</strong> /ojs/lib/pkp/classes/cliTool/UpgradeTool.inc.php line 88<br />
<strong>Function:</strong> Installer->execute()<br />
<br/>
<strong>File:</strong> /ojs/lib/pkp/classes/cliTool/UpgradeTool.inc.php line 64<br />
<strong>Function:</strong> UpgradeTool->upgrade()<br />
<br/>
<strong>File:</strong> /ojs/tools/upgrade.php line 34<br />
<strong>Function:</strong> UpgradeTool->execute()<br />
<br/>
ojs2: DB Error: Data too long for column 'setting_value' at row 1

Thanks !!
xavi.

Hi @xavi

Hmmm… The new journal settings filed “about” in OJS 3 will contain everything that is on the journal about page in OJS 2, i.e. the following fields: focus and scope, peer review process, publication frequency, open access policy, custom about items, sponsors, contributors and history. And it will contain the text in all journal languages.
The DB field where this all is save is defined as “text”, and it seems like you have lots of text, so that the “text” seems not to be enough :frowning:
Do you see a way to reduce/shorten those texts, so that they fit into the new field about? If so, you can either reduce them in the OJS 2, or maybe even better comment out that upgrade function (on this line ojs/upgrade.xml at ojs-3_1_1-2 · pkp/ojs · GitHub) and then after the upgrade enter the new fresh new texts in the journal about input field (Settings > Journal > About the journal).
Usually, the “text” size is enough for the journal settings, so I believe that it does not make sense for us to increase that in general, but I will double check with the others in the team…

Best,
Bozana

Hi @bozana, I did a dump and I left this field empty(“customAboutItems”) and I went back to upgrade, but I had other problem.

(mysql): ALTER TABLE submission_files ADD uploader_user_id BIGINT

-----



-----

(mysql): ALTER TABLE submission_files ADD assoc_type BIGINT

-----



-----

(mysql): ALTER TABLE submission_files MODIFY COLUMN assoc_id BIGINT

-----



-----

(mysql): ALTER TABLE submission_files ADD INDEX submission_files_submission_id (submission_id)

-----



-----

(mysql): CREATE TABLE submission_file_settings (
file_id BIGINT NOT NULL,
locale VARCHAR(5) NOT NULL DEFAULT ‘’,
setting_name VARCHAR(255) NOT NULL,
setting_value TEXT,
setting_type VARCHAR(6) NOT NULL
)

-----



-----

(mysql): ALTER TABLE submission_file_settings ADD INDEX submission_file_settings_id (file_id)

-----



-----

(mysql): ALTER TABLE submission_file_settings ADD UNIQUE INDEX submission_file_settings_pkey (file_id, locale, setting_name)

-----



1071: Specified key was too long; max key length is 767 bytes
ADOConnection._Execute(ALTER TABLE submission_file_settings ADD UNIQUE INDEX submission_file_settings_pkey (file_id, locale, setting_name), false)% line 1051, file: /ojs/lib/pkp/lib/adodb/adodb.inc.php
ADOConnection.Execute(ALTER TABLE submission_file_settings ADD UNIQUE INDEX submission_file_settings_pkey (file_id, locale, setting_name))% line 440, file: /ojs/lib/pkp/classes/install/Installer.inc.php
Installer.executeSQL(ALTER TABLE submission_file_settings ADD UNIQUE INDEX submission_file_settings_pkey (file_id, locale, setting_name))% line 435, file: /ojs/lib/pkp/classes/install/Installer.inc.php
Installer.executeSQL(Array[28])% line 375, file: /ojs/lib/pkp/classes/install/Installer.inc.php
Installer.executeAction(Array[3])% line 265, file: /ojs/lib/pkp/classes/install/Installer.inc.php
ERROR: Upgrade failed: DB: Specified key was too long; max key length is 767 bytes

Hi @xavi

Hmmm…
Did you take a new, clean copy of your 2.4 installation when you started that second upgrade?
What was the last upgrade command, when that error occurred?
I also wonder why is locale defined as varchar(5), when it should be varchar(14), s. pkp-lib/submissionFiles.xml at omp-3_1_1-2 · pkp/pkp-lib · GitHub. Do you use the latest 3.1.1-2 release?
What is the biggest file_id you have? – that index contains file_id, locale and setting_name – only setting_name seems to be problematic, but it is usually very short text, so that the index should actually not be so long…

Hmmm…
:-\ Bozana

Hi, @bozana, I changed branch from 3_0_2 to 3_1_1 and now it’s working the process.

Thanks
xavi.