Good morning...or else,

I've been stukked for days with an error (showed below) occuring when I try to delete some combination of products placed into my cart.

The thing is that I've the same site in two places. One locally on my desktop and one remotely hosted by ovh. Both have the same db and files.

The error occurs uniquely on the remote server. Another thing to notice is that the amount of errors decreses (but some combination of products still generate errors) when I remotely modify the view of the 'Form cart' by unchecking the 'Provide default field wrapper elements' check box in Home > Administration > Structure > Views > Shopping cart form > displays > master details > Field settings > Provide default field wrapper elements.

The errors decrese too when I remove from the field list view some elements I added as options for the customer to select, created in custom 'Line item types'.

I'd just point again that, all the same, the problem only occurs in the remote site.

NB: to duplicate the sites I FTP all the files and use 'Home » Administration » Configuration » System » Backup and Migrate : QUICK BACKUP'

Could it be an Apache config or php.ini issue or db transfer issue? I multiple check all of this without finding anything.

If anyone would like to suggest some track I'd be to happy to take a chance on it. As a matter of fact I'm a bit at a lost with this bug (if it's one).

Best regards.
Claude

----------------->
Notice : Undefined index: order dans commerce_line_item_handler_field_edit_delete->views_form_submit() (ligne 56 dans /homez.547/equisele/www/sites/all/modules/commerce/modules/line_item/includes/views/handlers/commerce_line_item_handler_field_edit_delete.inc).
Notice : Trying to get property of non-object dans commerce_line_item_handler_field_edit_delete->views_form_submit() (ligne 56 dans /homez.547/equisele/www/sites/all/modules/commerce/modules/line_item/includes/views/handlers/commerce_line_item_handler_field_edit_delete.inc).
Warning : array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! dans DrupalDefaultEntityController->load() (ligne 178 dans /homez.547/equisele/www/includes/entity.inc).
Warning : array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! dans DrupalDefaultEntityController->cacheGet() (ligne 355 dans /homez.547/equisele/www/includes/entity.inc).
Warning : array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! dans DrupalCommerceEntityController->buildQuery() (ligne 44 dans /homez.547/equisele/www/sites/all/modules/commerce/includes/commerce.controller.inc).
EntityMetadataWrapperException : Invalid data value given. Be sure it matches the required data type and format. dans EntityDrupalWrapper->set() (ligne 735 dans /homez.547/equisele/www/sites/all/modules/entity/includes/entity.wrapper.inc).
<-----------------

Comments

rszrama’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

I'm not really sure what it can be, but I don't know of any core issues with this code. What version of Views are you running, and have you customized the Cart form View any other way? If so, if you use that View in a clean install of Kickstart 1.x, can you reproduce the issue?

clasie’s picture

Thank you for your help Rszrama,

To answer your question, I'm using a Views 7.x-3.5 and yes I've modified the cart form view by adding 92 fields on it, all grabbed from the 17 custom line items I added.

Therefore to reproduce this to a clean kickstart it will require quite a time, but if no other choices...

In order to make exaustive migration testing I dit the following:

1- I exported (db + files) all the 'non errors ' local site to my remote server.
2- I tested on the remote server and found errors.
3- I re-imported (db + files) all the remote appli from remote server to my local local server.
4- I tested again in local and did not found any errors

I can be sure then that isn't any corruption table errors involved in my problem.

Could it be a PHP version issue?

local [no errors]

PHP Version 5.3.5-1ubuntu7.11
Mysql server 5.1.63-0ubuntu0.11.04.1

remote [error occur]

PHP Version 5.3.16
Mysql server 5.1.63

Another possibility:

When creating custom line items it occured sometimes that the system name for a field being troncated because of the limit of the length of those variables.

For example 'field_sc_chem_plastron_filet_na_' in place of the value I entered 'field_sc_chem_plastron_filet_na_abcd'. I thought as long as they are unique it would'nt be problematic. Perhaps am I wrong on this?

But if this could be the case could it explains why working in one place and not in other.

I will rebuild the view and retest. If the problem persists I will rebuild all the custom line items too. If still generating errors .... I will enter in monastery to consider calmly why I had not choose to reincarnate in some lettuce leaf :)

Regards
Claude

clasie’s picture

Suite...

I cleared the 'cart form view' and restarted filling it up.

After a while without any errors on my remote site (+- 50 fields added) an AJAX error started to emerge complaining about the size of the insert I just tried to make when adding a field through the admin view gui.

The message is below.

This could be a track to determine my problem, could'nt it be?

I'll now ask OVH for an extra size permision for my inserts, through a probably private additional DB, to see if this could solve my enigmatic malfunctionnements.

The fact that such AJAX messages is not recorded in the error journal had make it not obvious to notice for me.

I'll report here the following happenings.

Many thanks so far for the help and support.
Claude

--------------->
Une erreur HTTP AJAX s'est produite.
Code de statut HTTP : 200
Informations de débogage ci-dessous.
Chemin : http://www ...
StatusText: OK
ResponseText : Additional uncaught exception thrown while handling exception.OriginalPDOException: SQLSTATE[08S01]: Communication link failure: 1153 Got a packet bigger than &#039;max_allowed_packet&#039; bytes: INSERT INTO {ctools_object_cache} (sid, obj, name, data, updated) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placehold
er_3, :db_insert_placeholder_4); Array
(
[:db_insert_placeholder_0] =&gt; -ILY_5Qg2XIPDxE9sJIt3R3HDHHgQ8-7TS1HkDFdGRc
[:db_insert_placeholder_1] =&gt; view
[:db_insert_placeholder_2] =&gt; commerce_cart_form
[:db_insert_placeholder_3] =&gt;
<-------------

rszrama’s picture

Sure, you might try upping your max_allowed_packet size. Also, if at all possible you should do your development on the same version of PHP / MySQL as your live server. Then you won't have to wonder. : )

clasie’s picture

Suite...

Perhaps you could advise me now that I have the opportunity to tune my remote private sql.

I modified the my.cmf by changing the value of 'max_allowed_packet' from 1M to 16M.

Could you advises me some other values in order to optimize a drupal commerce install with some other values found in the my.cmf?

Now I will continue to insert in the 'cart form' view's all the 90 fields ( the errors occured when I had entered 50 ) and if all is running well will close this issue.

Big big thanks for all.
Claude

There are the values in it now:

my.cmf----------------------------->

[mysqld]

tmp_table_size=5M
query_cache_size=10M
thread_cache_size=5
max_connections=75
open_files_limit=900

skip-locking
key_buffer_size = 10M
max_allowed_packet = 16M
table_cache = 300
sort_buffer_size = 1M
join_buffer_size = 1M
read_buffer_size = 512K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 128K

max_binlog_cache_size = 1M
max_join_size = 12M
max_seeks_for_key = 2M
max_write_lock_count = 512K
myisam_max_sort_file_size = 1M

########################
##Configuration Innodb##
##Uncomment the next line to disable Innodb

#skip-innodb

innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M

innodb_log_file_size = 10M
innodb_log_buffer_size = 4M

innodb_flush_log_at_trx_commit=1

<-----------------------------------

clasie’s picture

Suite...

After having increased the db settings (see below 1) I started to continue enter fields into my 'cart form' view. I wa at the 50th field when I restarted.

All goes right until I arrives at the 71th. No ajax errors messages from the admin view editor but those errors previously encountered (see below 2) when tempting to delete a product from a cart or when tempting to 'update the cart' or when tempting to 'proceed to checkout' from the cart form.

Then I removed the 71th field added and retry to 'update the cart' and all goes right. I re-added it again for the test and again (as expected) the same error occurs.

Then I added another additionnal field and all the same. It seems that with 70 fields in the 'cart form view' I reached some limits, perhaps not when inserting them from the admin but rather when the 'form cart' attempts to manage the fields.

When I did the test it was with a cart containing 11 products with each having +- 5 option fields.

Another thing is that if I force to play with 71 fields and I remove the product present in the cart form (which is using this 71th élément ) by the means of admin view cart (Shop-> command->cart->modify->check the last product in the cart->delete it) then everithing is working in the cart. This makes me thing that there is something to tune about the memory used by the cart when the form is send. Bu what memory exactly?

Have you any suggestion about what I should have to increase in order to make it possible to manage carts with lots of fields in the view?

Could it be a hidden memory_limit error issue? ...

Thank you for any suggestion
Claude

-----below 1----------->
[mysqld]

tmp_table_size=64M
query_cache_size=64M
thread_cache_size=8
max_connections=100
open_files_limit=900

skip-locking
key_buffer_size = 64M
max_allowed_packet = 64M
table_cache = 300
sort_buffer_size = 64M
join_buffer_size = 64M
read_buffer_size = 512K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 128K

max_binlog_cache_size = 64M
max_join_size = 16M
max_seeks_for_key = 16M
max_write_lock_count = 512K
myisam_max_sort_file_size = 1M

########################
##Configuration Innodb##
##Uncomment the next line to disable Innodb

#skip-innodb

innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 16M

innodb_log_file_size = 16M
innodb_log_buffer_size = 16M

innodb_flush_log_at_trx_commit=1
<----below 1-----------

-----below 2----------->
Notice : Undefined index: order dans commerce_line_item_handler_field_edit_delete->views_form_submit() (ligne 56 dans /homez.547/equisele/www/sites/all/modules/commerce/modules/line_item/includes/views/handlers/commerce_line_item_handler_field_edit_delete.inc).
Notice : Trying to get property of non-object dans commerce_line_item_handler_field_edit_delete->views_form_submit() (ligne 56 dans /homez.547/equisele/www/sites/all/modules/commerce/modules/line_item/includes/views/handlers/commerce_line_item_handler_field_edit_delete.inc).
Warning : array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! dans DrupalDefaultEntityController->load() (ligne 178 dans /homez.547/equisele/www/includes/entity.inc).
Warning : array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! dans DrupalDefaultEntityController->cacheGet() (ligne 355 dans /homez.547/equisele/www/includes/entity.inc).
Warning : array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! dans DrupalCommerceEntityController->buildQuery() (ligne 44 dans /homez.547/equisele/www/sites/all/modules/commerce/includes/commerce.controller.inc).
Notice : Undefined index: order dans commerce_cart_line_item_views_form_submit() (ligne 276 dans /homez.547/equisele/www/sites/all/modules/commerce/modules/cart/commerce_cart.module).
Notice : Trying to get property of non-object dans commerce_cart_line_item_views_form_submit() (ligne 276 dans /homez.547/equisele/www/sites/all/modules/commerce/modules/cart/commerce_cart.module).
Warning : array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! dans DrupalDefaultEntityController->load() (ligne 178 dans /homez.547/equisele/www/includes/entity.inc).
Warning : array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! dans DrupalDefaultEntityController->cacheGet() (ligne 355 dans /homez.547/equisele/www/includes/entity.inc).
Warning : array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! dans DrupalCommerceEntityController->buildQuery() (ligne 44 dans /homez.547/equisele/www/sites/all/modules/commerce/includes/commerce.controller.inc).
Notice : Trying to get property of non-object dans commerce_order_status_update() (ligne 1271 dans /homez.547/equisele/www/sites/all/modules/commerce/modules/order/commerce_order.module).
EntityMalformedException : Propriété de bundle manquante sur l'entité de type commerce_order. dans entity_extract_ids() (ligne 7633 dans /homez.547/equisele/www/includes/common.inc).
<----below 2-----------

clasie’s picture

Suite...

Ok, I made a mistake when reconfiguring the settings.php file in my drupal remote site, making me erroneously thought that I was using my new brand private DB. How wrong can a man be!

Now I'm sure of the config, I use the new private db.

I just increased the max_allowed_packet to 16M and I restarted to fill my 'view cart form' with fields.

I reached 90 fields now and no errors.

I tested with a cart containing 16 items with full options for all products and still no errors, neither AJAX or 'Undefined index: order'.

Then it seems this could be the end of this issue.

I have still to enter +- 70 other fields in my view. If all still goes well I will ( i hope ) close this quite stressing issue when I'm sure of the solution.

Thank you Rszrama

Claude

clasie’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

This issue was solved with the upgrade of the field 'max_allowed_packet' to 16M (was 1M) in my.cmf
Claude

clasie’s picture

Issue summary: View changes

Added info on method how I duplicate the sites