OJS 2.3.7 to 2.4.8 Upgrade failed: DB: Data truncated for column 'first_name' at row 2659

Hello Team.

I have followed ojs/UPGRADE-UNSUPPORTED.md at main · pkp/ojs · GitHub and Update ojs 2.3.7 to 3 to migrate ojs from 2.3.7 to 2.4.8.5 and i am getting the following error

/var/www/newdani/ojs-2.4.8-5# php5.6 tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 2.4.8.5]
[schema: lib/pkp/xml/schema/signoff.xml]
[data: dbscripts/xml/upgrade/2.4.3_preupdate_usageStatistics.xml]
[data: dbscripts/xml/upgrade/2.4.3_preupdate_usageStatistics2.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_article_files.xml]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_emaillog.xml]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_reviewrounds.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_issues.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_articles.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_published_articles.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_issue_galleys.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_article_galleys.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_supp_files.xml]
[data: dbscripts/xml/upgrade/2.4.0_notifications.xml]
[schema: lib/pkp/xml/schema/common.xml]
[schema: lib/pkp/xml/schema/groups.xml]
[schema: lib/pkp/xml/schema/log.xml]
[schema: lib/pkp/xml/schema/announcements.xml]
[schema: lib/pkp/xml/schema/scheduledTasks.xml]
[schema: lib/pkp/xml/schema/temporaryFiles.xml]
[schema: lib/pkp/xml/schema/metadata.xml]
[schema: lib/pkp/xml/schema/reviews.xml]
[schema: lib/pkp/xml/schema/reviewForms.xml]
[schema: lib/pkp/xml/schema/controlledVocab.xml]
[schema: lib/pkp/xml/schema/submissions.xml]
ERROR: Upgrade failed: DB: Data truncated for column ‘first_name’ at row 2659

Any help is much appreciated.
thanks
Regards
Konstantinos

Getting the same error even if i try to upgrade to 2.3.8.0

root@new-ojs-2019:/var/www/newdani/ojs-2.3.8# php5.6 tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 2.3.8.0]
[schema: lib/pkp/xml/schema/signoff.xml]
[schema: lib/pkp/xml/schema/common.xml]
[schema: lib/pkp/xml/schema/groups.xml]
[schema: lib/pkp/xml/schema/announcements.xml]
[schema: lib/pkp/xml/schema/scheduledTasks.xml]
[schema: lib/pkp/xml/schema/temporaryFiles.xml]
[schema: lib/pkp/xml/schema/metadata.xml]
[schema: lib/pkp/xml/schema/reviews.xml]
[schema: lib/pkp/xml/schema/reviewForms.xml]
[schema: lib/pkp/xml/schema/controlledVocab.xml]
[schema: lib/pkp/xml/schema/submissions.xml]
ERROR: Upgrade failed: DB: Data truncated for column ‘first_name’ at row 2659
root@new-ojs-2019:/var/www/newdani/ojs-2.3.8#

Hey Team. Any ideas/help on this matter? Regards Kostas

Hi @koumoutsos,

It looks like the first_name column in the authors table, which has a maximum length of 40 characters, is getting something longer than it expects.

This is odd because the same limit exists in 2.3.7, which you currently have installed.

There are several possibilities I can think of…

  • Was the column manually extended in your 2.3.7 database? If so, you’ll need to edit lib/pkp/xml/schema/submissions.xml and extend it there too before running the upgrade.
  • Has your character set configuration in config.inc.php accidentally changed? If so, this could cause non-ASCII characters to take up more space than they should.

Regards,
Alec Smecher
Public Knowledge Project Team

thanks @asmecher for your response.
I had already checked lib/pkp/xml/schema/submissions.xml between version and i can see the same maximum length of 40 characters on lib/pkp/xml/schema/submissions.xml as you already mentioned

Looking for character set i cannot see issues between old and new database server as follows

Old database server

mysql> USE NewDani;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show variables like “character_set_database”;
±-----------------------±------+
| Variable_name | Value |
±-----------------------±------+
| character_set_database | utf8 |
±-----------------------±------+
1 row in set (0.01 sec)

mysql>

new database server

mysql> USE NewDani2485_10;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show variables like “character_set_database”;
±-----------------------±------+
| Variable_name | Value |
±-----------------------±------+
| character_set_database | utf8 |
±-----------------------±------+
1 row in set (0.00 sec)

mysql>

/newdani/ojs-2.4.8-5# egrep -i charset config.inc.php
;mysql_set_charset(“UTF8”, $db);
client_charset = utf-8
; If enabled, must be the same character set as “client_charset”
;connection_charset = Off
connection_charset = utf8
;database_charset = Off
database_charset = utf8
; Note that client_charset and database collation must be set
;charset_normalization = On
newdani/ojs-2.4.8-5#

Any help is much appreciated.

Issue persists with the same error.

Regards
Kostas

Hi @koumoutsos,

What do you get in your old (pre-upgrade) database for…

DESCRIBE authors;

Regards,
Alec Smecher
Public Knowledge Project Team

On the old database (pre-upgrade) i am getting

mysql> DESCRIBE authors;
±----------------±-------------±-----±----±--------±---------------+
| Field | Type | Null | Key | Default | Extra |
±----------------±-------------±-----±----±--------±---------------+
| author_id | bigint(20) | NO | PRI | NULL | auto_increment |
| submission_id | bigint(20) | NO | MUL | NULL | |
| primary_contact | tinyint(4) | NO | | 0 | |
| seq | double | NO | | 0 | |
| first_name | varchar(40) | YES | | NULL | |
| middle_name | varchar(40) | YES | | NULL | |
| last_name | varchar(90) | YES | | NULL | |
| country | varchar(90) | YES | | NULL | |
| email | varchar(90) | YES | | NULL | |
| url | varchar(255) | YES | | NULL | |
| user_group_id | bigint(20) | YES | | NULL | |
±----------------±-------------±-----±----±--------±---------------+
11 rows in set (0.00 sec)

mysql>

Hi @koumoutsos,

Hmm, that’s confusing, because all the application of lib/pkp/xml/schema/submissions.xml should be doing is reiterating that 40-character limit that appears to already apply. After the upgrade fails, what do you see for entries longer than 40 characters long in the authors table in the first_name column?

Regards,
Alec Smecher
Public Knowledge Project Team

Checking for differences on authors

image

Hi @koumoutsos,

Do you have NULL entries for first_name?

SELECT COUNT(*) FROM authors WHERE first_name IS NULL;

If so, that could be causing the problem. Those shouldn’t be allowed in 2.3.7 either but it appears that condition might’ve been relaxed (manually?).

Regards,
Alec Smecher
Public Knowledge Project Team

it seems that something is wrong on the old database where i can see ???

new

mysql> SELECT first_name FROM NewDani2485_10.authors LIMIT 15;
±---------------------+
| first_name |
±---------------------+
| Τέλης Δ. |
| |
| |
| |
| |
| |
| |
| Γ. |
| Αθηνόδωρος |
| Αλεξ. |
| Ν. |
| Αλεξ. |
| |
| Μ. |
| |
±---------------------+
15 rows in set (0.00 sec)

mysql>

whereas on old

old
mysql> SELECT first_name FROM NewDani.authors LIMIT 15;
±-----------+
| first_name |
±-----------+
| ??? ?. |
| |
| |
| |
| |
| |
| |
| ?. |
| ??? |
| ???. |
| ?. |
| ???. |
| |
| ?. |
| |
±-----------+
15 rows in set (0.00 sec)

mysql>

how to overcome this?

thanks a lot

I can see same nulls on old and new database as follows

new

mysql> SELECT COUNT() FROM authors WHERE first_name IS NULL;
±---------+
| COUNT(
) |
±---------+
| 50694 |
±---------+
1 row in set (0.01 sec)

mysql>

old
mysql> SELECT COUNT() FROM authors WHERE first_name IS NULL;
±---------+
| COUNT(
) |
±---------+
| 50694 |
±---------+
1 row in set (0.06 sec)

mysql>

Hi @koumoutsos,

I think this is your problem – there should be no null entries in the first_name column of authors. You can change null entries to empty strings before running the upgrade:

UPDATE authors SET first_name='' WHERE first_name IS NULL;

[Query corrected to refer to authors instead of `users. -AS]

Regards,
Alec Smecher
Public Knowledge Project Team

Hello @asmecher
I assume you meant authors instead of users on sql command.

I did it

mysql> UPDATE authors SET first_name=’’ WHERE first_name IS NULL;
Query OK, 50694 rows affected (0.32 sec)
Rows matched: 50694 Changed: 50694 Warnings: 0

mysql>

And now it fails on “last name” Should i do the same?

root@new-ojs-2019:/var/www/newdani/ojs-2.4.8-5# php5.6 tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 2.4.8.5]
[schema: lib/pkp/xml/schema/signoff.xml]
[data: dbscripts/xml/upgrade/2.4.3_preupdate_usageStatistics.xml]
[data: dbscripts/xml/upgrade/2.4.3_preupdate_usageStatistics2.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_article_files.xml]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_emaillog.xml]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_reviewrounds.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_issues.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_articles.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_published_articles.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_issue_galleys.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_article_galleys.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_supp_files.xml]
[data: dbscripts/xml/upgrade/2.4.0_notifications.xml]
[schema: lib/pkp/xml/schema/common.xml]
[schema: lib/pkp/xml/schema/groups.xml]
[schema: lib/pkp/xml/schema/log.xml]
[schema: lib/pkp/xml/schema/announcements.xml]
[schema: lib/pkp/xml/schema/scheduledTasks.xml]
[schema: lib/pkp/xml/schema/temporaryFiles.xml]
[schema: lib/pkp/xml/schema/metadata.xml]
[schema: lib/pkp/xml/schema/reviews.xml]
[schema: lib/pkp/xml/schema/reviewForms.xml]
[schema: lib/pkp/xml/schema/controlledVocab.xml]
[schema: lib/pkp/xml/schema/submissions.xml]
ERROR: Upgrade failed: DB: Data truncated for column ‘last_name’ at row 2659
root@new-ojs-2019:/var/www/newdani/ojs-2.4.8-5#

thanks
Regards
Kostas

Hi @koumoutsos,

Yes, that typo correction is right; I’ve noted it above.

It looks like you have the same problem in last_name, so yes, the same fix would apply. I’m not sure why null values are allowed there in your case – they shouldn’t be in 2.3.7 either.

Regards,
Alec Smecher
Public Knowledge Project Team

hey @asmecher it passed but now it stuck somewhere else. See below. Any help?

root@new-ojs-2019:/var/www/newdani/ojs-2.4.8-5# php5.6 tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 2.4.8.5]
[schema: lib/pkp/xml/schema/signoff.xml]
[data: dbscripts/xml/upgrade/2.4.3_preupdate_usageStatistics.xml]
[data: dbscripts/xml/upgrade/2.4.3_preupdate_usageStatistics2.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_article_files.xml]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_emaillog.xml]
[data: dbscripts/xml/upgrade/2.4.0_preupdate_reviewrounds.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_issues.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_articles.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_published_articles.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_issue_galleys.xml (skipped)]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_article_galleys.xml]
[data: dbscripts/xml/upgrade/2.4.0_idupgrade_supp_files.xml]
[data: dbscripts/xml/upgrade/2.4.0_notifications.xml]
[schema: lib/pkp/xml/schema/common.xml]
[schema: lib/pkp/xml/schema/groups.xml]
[schema: lib/pkp/xml/schema/log.xml]
[schema: lib/pkp/xml/schema/announcements.xml]
[schema: lib/pkp/xml/schema/scheduledTasks.xml]
[schema: lib/pkp/xml/schema/temporaryFiles.xml]
[schema: lib/pkp/xml/schema/metadata.xml]
[schema: lib/pkp/xml/schema/reviews.xml]
[schema: lib/pkp/xml/schema/reviewForms.xml]
[schema: lib/pkp/xml/schema/controlledVocab.xml]
[schema: lib/pkp/xml/schema/submissions.xml]
[schema: lib/pkp/xml/schema/comments.xml]
[schema: lib/pkp/xml/schema/notes.xml]
[schema: lib/pkp/xml/schema/gifts.xml]
[schema: lib/pkp/xml/schema/mutex.xml]
[schema: lib/pkp/xml/schema/tombstone.xml]
[schema: lib/pkp/xml/schema/metrics.xml]
[schema: dbscripts/xml/ojs_schema.xml]
ERROR: Upgrade failed: DB: Incorrect datetime value: ‘0000-00-00 00:00:00’ for column ‘date_published’ at row 549
root@new-ojs-2019:/var/www/newdani/ojs-2.4.8-5#

Hi @koumoutsos,

Let’s treat that separately, as it’s different than the issues in this post – that’ll help keep the forum organized as a resource for others. I’d suggest reviewing existing postings with that error message (e.g. Upgrade failed 2.4.7-1/2.4.8-1 --> 3.0.0), and if those don’t help, post a new one with details on what you’ve tried so far.

Thanks,
Alec Smecher
Public Knowledge Project Team

you are right @asmecher I am sorry. You can close this thread. Thanks for your help. Regards Kostas

Not a problem – good luck!

Thanks,
Alec Smecher
Public Knowledge Project Team

This topic was automatically closed after 13 days. New replies are no longer allowed.