>> What are the steps required to reproduce the bug?
When modifying a content type or adding a new one, the page which renders the 'successfully added field' is unable to display. The field itself is still added.

>> What behavior were you expecting?
Not getting an error

>> What happened instead?
I received an Error:

Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'cid' at row 1: INSERT INTO {cache_block} (cid, serialized, created, expire, tags, checksum_invalidations, checksum_deletions, data) VALUES [...] in "core/themes/bartik/templates/page.html.twig" at line 173. in Twig_Template->displayWithErrorHandling() (line 291 of core/vendor/twig/twig/lib/Twig/Template.php).

Running current Drupal 8.x head (2014-03-24), Apache, MySQL, PHP 5.4, Ubuntu.

Comments

stefan lehmann’s picture

I can confirm that this error occurs on a fresh clone / installation of today.

Windows 7, Apache 2.2.22, PHP 5.4.3, MySQL 5.5.24

stefan lehmann’s picture

Looks like this is already fixed now. Can't replicate error anymore, after pulling in the latest changes.

taran2l’s picture

Still seeing this.

Error

Error messageTwig_Error_Runtime: An exception has been thrown during the rendering of a template ("SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'cid' at row 1: INSERT INTO {cache_render} (cid, serialized, created, expire, tags, checksum_invalidations, checksum_deletions, data) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7); Array ( [:db_insert_placeholder_0] => entity_view:block:stark_tools:en:stark:http://range.local/admin/structure/types/manage/page/fields/node.page.field_test/field?destinations%5B0%5D%5Broute_name%5D=field_ui.instance_edit_node&destinations%5B0%5D%5Broute_parameters%5D%5Bfield_instance_config%5D=node.page.field_test&destinations%5B0%5D%5Broute_parameters%5D%5Bnode_type%5D=page&destinations%5B1%5D=admin%2Fstructure%2Ftypes%2Fmanage%2Fpage%2Ffields:r.authenticated [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] => 1396017444 [:db_insert_placeholder_3] => -1 [:db_insert_placeholder_4] => content:1 block_view:1 block:stark_tools block_plugin:system_menu_block__tools menu:tools [:db_insert_placeholder_5] => 15 [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => a:2:{s:7:"#markup";s:290:"<div class="block block-system block-menu" id="block-stark-tools" role="navigation"> <h2>Tools</h2> <div class="content"> <ul class="menu"><li class="leaf"><a href="/node/add" data-drupal-link-system-path="node/add">Add content</a></li> </ul> </div> </div> ";s:6:"#cache";a:1:{s:4:"tags";a:5:{s:7:"content";b:1;s:10:"block_view";b:1;s:5:"block";a:1:{s:11:"stark_tools";s:11:"stark_tools";}s:12:"block_plugin";a:1:{s:24:"system_menu_block__tools";s:24:"system_menu_block__tools";}s:4:"menu";a:1:{s:5:"tools";s:5:"tools";}}}} ) ") in "core/modules/system/templates/page.html.twig" at line 136. in Twig_Template->displayWithErrorHandling() (line 291 of core\vendor\twig\twig\lib\Twig\Template.php).
The website has encountered an error. Please try again later.
Uncaught exception thrown in shutdown function.

Symfony\Component\DependencyInjection\Exception\RuntimeException: You have requested a synthetic service ("request"). The DIC does not know how to construct this service. in service_container_prod->getRequestService() (line 2762 of D:\sites\range\sites\default\files\php\service_container\service_container_prod.php\cc38d56cd7ec0aec5a1ba4127fe70a51a61b7c5bd2b1332ea3f7985481e2c49a.php).

service_container_prod->getRequestService()
Symfony\Component\DependencyInjection\Container->get('request', 1)
Drupal\Core\DependencyInjection\Container->get('request')
Drupal::request()
drupal_session_initialize()
Drupal\Core\Authentication\Provider\Cookie->authenticate(Object)
Drupal\Core\Authentication\AuthenticationManager->authenticate(Object)
Drupal\Core\Session\AccountProxy->getAccount()
Drupal\Core\Session\AccountProxy->hasPermission('access devel information')
devel_shutdown_real()
call_user_func_array('devel_shutdown_real', Array)
_drupal_shutdown_function()

danblack’s picture

Note VARCHARS can contain more than 255 characters - 65535 actually (as of MySQL 5.0.3 and MySQL 5.0.15 is specified in D7/D8 as the minimum despite its old age). Don't create VARCHAR fields grossly larger than needed as the Memory Engine, the one used for non-disk based sorts/groups by/joins etc, will convert these to CHAR fields of the maximum varchar size and so will use more memory and hence possibly push the result to disk depending on data size.

Looks like the comment #3 url is 428 bytes.

dawehner’s picture

Priority: Normal » Critical

That is certainly a big problem.

I can reproduce when I add a translatable field.

Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'cid' at row 1: INSERT INTO {cache_render} (cid, serialized, created, expire, tags, checksum_invalidations, checksum_deletions, data) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7); Array ( [:db_insert_placeholder_0] => entity_view:block:seven_help:en:seven:http://www/d8/admin/config/regional/content-language?destination=admin%2Fstructure%2Ftypes%2Fmanage%2Ftype2%2Ffields%2Fnode.type2.field_test%2Ffield%3Fdestinations%5B0%5D%5Broute_name%5D%3Dfield_ui.instance_edit_node%26destinations%5B0%5D%5Broute_parameters%5D%5Bnode_type%5D%3Dtype2%26destinations%5B0%5D%5Broute_parameters%5D%5Bfield_instance_config%5D%3Dnode.type2.field_test%26destinations%5B1%5D%3Dadmin%2Fstructure%2Ftypes%2Fmanage%2Ftype2%2Ffields [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] => 1397944177 [:db_insert_placeholder_3] => -1 [:db_insert_placeholder_4] => content:1 block_view:1 block:seven_help theme:seven block_plugin:system_help_block [:db_insert_placeholder_5] => 18 [:db_insert_placeholder_6] => 3 [:db_insert_placeholder_7] => a:2:{s:7:"#markup";s:400:"<div class="block block-system" id="block-seven-help" role="complementary"> <div class="content"> Change language settings for <em>content types</em>, <em>taxonomy vocabularies</em>, <em>user profiles</em>, or any other supported element on your site. By default, language settings hide the language selector and the language is the site's default language. </div> </div> ";s:6:"#cache";a:1:{s:4:"tags";a:5:{s:7:"content";b:1;s:10:"block_view";b:1;s:5:"block";a:1:{s:10:"seven_help";s:10:"seven_help";}s:5:"theme";s:5:"seven";s:12:"block_plugin";a:1:{s:17:"system_help_block";s:17:"system_help_block";}}}} ) ") in "core/themes/seven/templates/page.html.twig" at line 93. in Twig_Template->displayWithErrorHandling() (line 291 of core/vendor/twig/twig/lib/Twig/Template.php).

danblack’s picture

Status: Active » Closed (duplicate)
dawehner’s picture

Ah great. thank you!

danblack’s picture

Though I've raised the limit to 1024, there isn't a real limit now apart from making sure database driver implementations are using the right type underneath. If you can measure a use of the cache that indicates this should be higher its better to know now before the patch committed.