Unable to execute INSERT statement. [wrapped: SQLSTATE[22001]: String data, right truncated: 1406

735 views
Skip to first unread message

Ariel Felippi

unread,
Dec 5, 2016, 9:15:44 PM12/5/16
to AtoM Users
Hi,

I'm brazilian,.

i have a problem, i need help.

This is problem:

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


stack trace

  • at ()
    in SF_ROOT_DIR/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel/util/BasePeer.php line 299 ...

      1.         } catch (Exception $e) {
      2.             Propel::log($e->getMessage(), Propel::LOG_ERR);
      3.             throw new PropelException("Unable to execute INSERT statement."$e);
      4.         }

      5.         // If the primary key column is auto-incremented, get the id now.
tela2.png
tela3.png
tela4.png
tela5.png
tela 1.png
tela 6.png
tela 7.png

Jesús García Crespo

unread,
Dec 6, 2016, 1:16:59 AM12/6/16
to ica-ato...@googlegroups.com
I think that you are running into that compatibility issue with MySQL 5.7:

Try disabling the strict mode and it should work.

--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-users+unsubscribe@googlegroups.com.
To post to this group, send email to ica-atom-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ica-atom-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/481a235a-88f1-4d9c-9f85-3bdd9905c91b%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

Ariel Felippi

unread,
Dec 6, 2016, 4:32:46 AM12/6/16
to AtoM Users
How do I do that?

you help me?


Em terça-feira, 6 de dezembro de 2016 04:16:59 UTC-2, Jesús García Crespo escreveu:
I think that you are running into that compatibility issue with MySQL 5.7:

Try disabling the strict mode and it should work.
On Mon, Dec 5, 2016 at 6:15 PM, Ariel Felippi <ariel....@gmail.com> wrote:
Hi,

I'm brazilian,.

i have a problem, i need help.

This is problem:

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


stack trace

  • at ()
    in SF_ROOT_DIR/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel/util/BasePeer.php line 299 ...

      1.         } catch (Exception $e) {
      2.             Propel::log($e->getMessage(), Propel::LOG_ERR);
      3.             throw new PropelException("Unable to execute INSERT statement."$e);
      4.         }

      5.         // If the primary key column is auto-incremented, get the id now.

--
You received this message because you are subscribed to the Google Groups "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.

Ariel Felippi

unread,
Dec 6, 2016, 5:58:10 AM12/6/16
to AtoM Users
Hi Jesus,

I got it:

Follow the steps:

Visit website:

https://serverpilot.io/community/articles/how-to-disable-strict-mode-in-mysql-5-7.html

And the attached image, here I commented the MySql standard and put what is below.

Remember to first stop the MySql service make the changes and then start it again
strinc_tables.png

Eric Deumo

unread,
Jan 5, 2019, 7:26:37 AM1/5/19
to AtoM Users
Hello.
I had the same problem. During the installation, I have this message:
"Unable to execute INSERT statement. [Wrapped: SQLSTATE [22001]: String data, right truncated: 1406 Data too long for column 'culture' at row 1]"

Following the recommendations of this topic, I was able to go to the "sql mode" section, then enter edit as below:
"STRICT_ALL_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE SQL, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER"

Despite this the problem is not fixed.

Please tell me what to do.

Regards.

Eric.
Error.jpg

Dan Gillean

unread,
Jan 7, 2019, 11:25:03 AM1/7/19
to ICA-AtoM Users
Hi Eric, 

Can you tell us more about your installation? Are you installing version 2.4.1 or an earlier release? Are you following our recommended installation instructions (e.g. Ubuntu 14.04 or 16.04; PHP 5.x (for Ubuntu 14.04) or 7.0 (for Ubuntu 16.04), Elasticsearch 1.7.x, Nginx web server, etc), or have you made changes - and if so, what changes? Also, what is the default installation culture / language you are trying to use, as well as the language code you have entered?

If you've already made the change, it may just be that you need to restart some services, clear the application cache (and your browser cache), and try again. Generally, if you've edited your SQL configuration file, then you will need to restart the service for the changes to take effect. 

For example, if you have installed following our Ubuntu 16.04 instructions, you could try: 
  • sudo systemctl restart mysql
  • sudo systemctl restart php7.0-fpm
  • php symfony cc
Be sure to clear your browser cache as well to make sure you are seeing the latest version of the page you are trying to access. 

Let us know if that helps! If not, please provide further information about your installation, and we can go from there. 

Cheers, 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory


--
You received this message because you are subscribed to the Google Groups "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 https://groups.google.com/group/ica-atom-users.

Dan Gillean

unread,
Jan 7, 2019, 12:23:50 PM1/7/19
to ICA-AtoM Users
Hi again Eric, 

One of our team members pointed out something I missed in your original post! 

The issue seems to be that MySQL strict t column length checking is turned on by default in version 5.7. Some culture codes, such as the Valencian one, will cause issues in AtoM if strict mode is not disabled, as outlined in the issue linked in Jesús' original response: 
Looking at the changes you've made, you have actually enabled strict mode for all tables in AtoM, rather than turning it off, which is necessary to resolve the issue. Remove the following from the configuration file: 
  • STRICT_ALL_TABLES  
Don't forget to restart MySQL and other services before re-testing. 

Cheers, 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory

On Sat, Jan 5, 2019 at 7:26 AM Eric Deumo <e.d...@gmail.com> wrote:
--

Eric Deumo

unread,
Jan 20, 2019, 12:31:01 PM1/20/19
to ica-ato...@googlegroups.com
I have removed "STRICT_ALL_TABLES". It's still not working.
I'm using Wampserver on windows 10.
WAMPSERVER  3.1.3 64 bits
Apache : 2.4.33
PHP : 5.6.35
MySQL : 5.7.21
elasticsearch-1.7.6

image.png
Please, help.
Eric.


Dan Gillean

unread,
Jan 21, 2019, 11:37:08 AM1/21/19
to ICA-AtoM Users
Hi Eric, 

I haven't used WAMP myself, so I can't recommend specifics on the exact commands to use. However, I hope the following might still point you in the right direction. After a bit of searching online, I have a few further ideas to suggest. 

First, did you remember to restart MySQL as a service, as well other services like PHP-FPM and memcached, before retesting? If not, be sure to do so now. 

You can check what SQL mode values you have with the following: 
  • mysql -u root -proot -e "SELECT @@sql_mode, @@GLOBAL.SQL_MODE;"
If you have changed the default credentials for your MySQL installation, be sure to change them in this command as well. 

Second, some posts I saw suggested that you might need the NO_ENGINE_SUBSTITUTION variable to be set. 

According to this manual page, you can change session and global variables as follows: 
  • SET GLOBAL sql_mode = 'modes';
Where modes is replaced by the values you want to set. For example, here is the output of me checking my site, seeing no SQL modes defined, and adding NO_ENGINE_SUBSTITUTION, then restarting mysql: 

sql-mode.png

Remember to restart PHP-FPM and memcached after as well. 

Finally, some posts also suggested that, depending on your installation, there might actually be more than 1 MySQL configuration file on your system - you should make sure that the updates are consistently added in each. Some other places to look include: 
  • /usr/my.cnf
  • /etc/my.cnf
  • /etc/mysql/my.cnf
You can search for all files named my.cnf on your installation with the following - however, be aware: not all of these files necessarily relate to MySQL! Look at them closely before modifying. However, this may help you identify if you have more than 1 MySQL configuration file: 
  • sudo find / -name my.cnf
Finally, if you continue to have issues, then you might consider using our Vagrant box instead. Note that it is NOT intended for production use - rather it is for local testing and development - but if you are installing using WAMP on a Windows 10 home computer, then that is not a production installation anyway. Instructions for installation: 
Suggestions for upgrading the vagrant box to the latest version - alternatively, you could switch the branch to stable/2.4.x for the stable 2.4.1 release: 
If you wanted to copy your data from the WAMP installation to the vagrant box, these slides should help get you started: 

I hope this helps - let us know how it goes! 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory

Reply all
Reply to author
Forward
0 new messages