Installation: "SQLSTATE[22001]: String data, right truncated: 1406 Data too long" error

2,249 views
Skip to first unread message

stefano....@gmail.com

unread,
Oct 9, 2015, 3:26:28 PM10/9/15
to ICA-AtoM Users
Hi.
I have the error:

symfony [err] {PropelException} Unable to execute INSERT statement. [wrapped: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'culture' at row 1]

in installation process. My enviroment is CentOS 6.6 whit MySQL community 5.6.27. After some tests I found the cause:  "sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES", in my.cnf. My DBA consultant suggests to not change setting but to expand the culture column size.
I tray to change "culture" and "source_culture" size from 7 to 14 in the files
~/data/sql/lib.model.schema.sql
~/data/sql/plugins.qbAclPlugin.lib.model.schema.sql
~/data/sql/plugins.qtAccessionPlugin.lib.model.schema.sql

The installation run correctly. AtoM looks running correctly, but I haven't doing a good testing.

Now a copple of questions:
- way this error?
- there's a better fixing?
- any more column to change in db structure?

Thank you in advanced.

Jesús García Crespo

unread,
Oct 9, 2015, 3:52:00 PM10/9/15
to ica-ato...@googlegroups.com
Hi Stefano,

What's the size of your culture code or the value of default_culture in your installation? Normally a language code just takes a few characters, but no more than seven that I know. My suggestion would be to try first to see what value is the application putting in that column. You could use MySQL's General Query Log or AtoM's debug mode.

Regards,

--
You received this message because you are subscribed to the Google Groups "ICA-AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To post to this group, send email to ica-ato...@googlegroups.com.
Visit this group at http://groups.google.com/group/ica-atom-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/83269c30-9552-48e9-a63b-adcb80fbbbd1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Jesús García Crespo,
Software Engineer, Artefactual Systems Inc.
http://www.artefactual.com | +1.604.527.2056

stefano....@gmail.com

unread,
Oct 10, 2015, 5:37:14 AM10/10/15
to ICA-AtoM Users
Thank you Jesús.
I attach a screenshot. My be it is better than my words ;)

The error happens in installation step. I suppose default_culture used in istallation is en. After I changed default_culture from en to it.

Where I can found install log AtoM's? And how can run AtoM installation in debug mode?

Regards



Il giorno venerdì 9 ottobre 2015 21:52:00 UTC+2, Jesús García Crespo ha scritto:
Hi Stefano,

What's the size of your culture code or the value of default_culture in your installation? Normally a language code just takes a few characters, but no more than seven that I know. My suggestion would be to try first to see what value is the application putting in that column. You could use MySQL's General Query Log or AtoM's debug mode.

Regards,
screenshot1.png

Jesús García Crespo

unread,
Oct 13, 2015, 12:22:59 PM10/13/15
to ica-ato...@googlegroups.com
Thank you so much! We'll try to reproduce the problem using STRICT_TRANS_TABLES locally and see if we can find a solution before our next release. I've filed a ticket: https://projects.artefactual.com/issues/9051.

In the meantime, I'd say that your workaround will just work fine, but that's something that I can't guarantee because we've never used STRICT_TRANS_TABLES before. Let us know what are your findings if you are going to be using the strict mode, please!

Thank you so much,

--
You received this message because you are subscribed to the Google Groups "ICA-AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To post to this group, send email to ica-ato...@googlegroups.com.
Visit this group at http://groups.google.com/group/ica-atom-users.

For more options, visit https://groups.google.com/d/optout.

suliga...@gmail.com

unread,
Jan 10, 2017, 4:26:09 AM1/10/17
to AtoM Users, stefano....@gmail.com
It's an old thread but I just took a fight with this and won using your solution.

I believe (can't confirm that) that VARCHAR is a byte array in default installation of MySQL and the installer tries to insert Unicode data into it, which is by definition longer (twice as long).
Reply all
Reply to author
Forward
0 new messages