PrestaSharp
PrestaSharp copied to clipboard
Error on update product
Hi, My log file show some strange update error on Product update, I made some test but I can't discover the reason.
I try also to simply get and save the product without made anything, just:
Dim ProductFactory As New ProductFactory(BaseUrl, Account, Password)
Dim Prodotto As New product
Dim Prodotto As product
Prodotto = ProductFactory.Get("1025")
ProductFactory.Update(Prodotto)
Update return an error.
I'm using last Prestasharp version and e.commerce is running Prestashop version 1.5.6.2
This happened only to some products, about 30% of catalog...
I also get an error trying to update a product #267, Did you find a solution?
Hi, nope, but I think your issue #267 is the same problem. I think it's better you write down here your question.
I read you catch this specific error:
Original message: La etiqueta de apertura 'meta' en la línea 11 posición 2 no coincide con la etiqueta de cierre de 'head'. línea 20, posición 3. Translate message: The 'meta' opening tag on line 11 position 2 does not match the 'head' closing tag. Line 20, position 3.
This look like to be an XML tag problem. I think it's a good starting point....
@luiskar009 could you post the XML parsed call?
server call return "HTTP/1.1 500 Internal Server Error"
this is the call's XML debug:
<?xml version="1.0" encoding="utf-8"?> <prestashop> <product> <id xmlns="">6542</id> <id_supplier xmlns="">0</id_supplier> <id_manufacturer xmlns="">56</id_manufacturer> <id_category_default xmlns="">4</id_category_default> <id_default_image xmlns="">8272</id_default_image> <id_default_combination d2p1:nil="true" xmlns:d2p1="http://www.w3.org/2001/XMLSchema-instance" xmlns="" /> <id_tax_rules_group xmlns="">1</id_tax_rules_group> <id_shop_default xmlns="">1</id_shop_default> <on_sale xmlns="">1</on_sale> <online_only xmlns="">0</online_only> <ean13 xmlns="">8001154125375</ean13> <upc xmlns="" /> <ecotax xmlns="">0.000000</ecotax> <minimal_quantity xmlns="">1</minimal_quantity> <max_quantity xmlns="">0</max_quantity> <price xmlns="">9.72</price> <wholesale_price xmlns="">0.000000</wholesale_price> <unity xmlns="" /> <unit_price_ratio xmlns="">0.000000</unit_price_ratio> <additional_shipping_cost xmlns="">0.00</additional_shipping_cost> <reference xmlns="">970577502</reference> <supplier_reference xmlns="" /> <location xmlns="" /> <width xmlns="">0.000000</width> <height xmlns="">0.000000</height> <depth xmlns="">0.000000</depth> <weight xmlns="">0.750000</weight> <quantity_discount xmlns="">0</quantity_discount> <customizable xmlns="">0</customizable> <uploadable_files xmlns="">0</uploadable_files> <text_fields xmlns="">0</text_fields> <active xmlns="">1</active> <id_product_redirected xmlns="">0</id_product_redirected> <available_for_order xmlns="">1</available_for_order> <available_date xmlns="">0000-00-00</available_date> <condition xmlns="">new</condition> <show_price xmlns="">1</show_price> <indexed xmlns="">1</indexed> <visibility xmlns="">both</visibility> <cache_is_pack xmlns="">0</cache_is_pack> <cache_has_attachments xmlns="">1</cache_has_attachments> <is_virtual xmlns="">0</is_virtual> <cache_default_attribute xmlns="">0</cache_default_attribute> <date_add xmlns="">2016-01-23 03:07:06</date_add> <date_upd xmlns="">2017-06-19 09:33:37</date_upd> <advanced_stock_management xmlns="">0</advanced_stock_management> <meta_description xmlns=""> <language id="5" /> </meta_description> <meta_keywords xmlns=""> <language id="5" /> </meta_keywords> <meta_title xmlns=""> <language id="5">Almo cane nature alternative extra small e small salmone 750 gr</language> </meta_title> <link_rewrite xmlns=""> <language id="5">almo-nature-cane-alternative-extra-small-e-small-salmone-750-gr</language> </link_rewrite> <name xmlns=""> <language id="5">Almo nature cane alternative extra small e small salmone 750 gr</language> </name> <description xmlns=""> <language id="5"><p><strong>COMPOSIZIONE</strong></p> <p>Salmone fresco* 50%, riso 40%, lievito, grasso animale, polpa di barbabietola, proteina di patata, sostanze minerali, proteina idrolizzata di pesce, mannano-oligo-saccaridi 0,1%, inulina di cicoria fonte di FOS- 0,1%.</p> <p><strong>Additivi - additivi nutrizionali:</strong> vitamina A 22000 UI/kg, vitamina D3 1400 UI/kg, vitamina E 300 mg/kg, vitamina B1 12mg/kg, vitamina B2 14 mg/kg, calcio D-pantotenato 20 mg/kg, vitamina B6 12 mg/kg, vitamina B12 0,15 mg/kg, colina cloruro 3200 mg/kg, niacina 25 mg/kg, biotina 0,5 mg/kg, taurina 1000 mg/kg, L-carnitina 50 mg/kg, vitamina K 1 mg/kg, acido folico 1 mg/kg, solfato rameico pentaidrato 32 mg/kg, chelato rameico di amminoacidi, idrato 33 mg/kg, iodato di calcio anidro in granuli rivestiti (3b203) 1,64 mg/kg, solfato di zinco, monoidrato 222 mg/kg, chelato di zinco di amminoacidi, idrato 267 mg/kg, solfato manganoso, monoidrato 20,65 mg/kg, selenio in forma organica 80,44 mg/kg.</p> <p><strong>Componenti analitici:</strong> calcio 1,6%, fosforo 0,93%, omega 3 1,5%, omega 6 3%. *Fonte naturale di omega 3.</p> <p><strong>COMPOSIZIONE ANALITIICA</strong></p> <ul> <li>Proteina grezza 25% </li> <li>Fibra grezza 2,6% </li> <li>Oli e grassi grezzi 15% </li> <li>Ceneri grezze 7% </li> <li>Umidità 9,5%</li> </ul></language> </description> <description_short xmlns=""> <language id="5"><p>Almo nature cane alternative extra small e small salmone 750 gr</p></language> </description_short> <available_now xmlns=""> <language id="5">Disponibile</language> </available_now> <available_later xmlns=""> <language id="5" /> </available_later> <associations xmlns=""> <categories xmlns=""> <category> <id>4</id> </category> </categories> <images xmlns=""> <image> <id>8272</id> </image> </images> <combinations xmlns="" /> <product_option_values xmlns="" /> <product_features xmlns=""> <product_feature> <id>1</id> <id_feature_value>219</id_feature_value> </product_feature> <product_feature> <id>2</id> <id_feature_value>161</id_feature_value> </product_feature> <product_feature> <id>3</id> <id_feature_value>4</id_feature_value> </product_feature> <product_feature> <id>5</id> <id_feature_value>34</id_feature_value> </product_feature> </product_features> <tags xmlns="" /> <stock_availables xmlns=""> <stock_available> <id>4867</id> <id_product_attribute>0</id_product_attribute> </stock_available> </stock_availables> <product_bundle xmlns="" /> <accessories xmlns="" /> </associations> </product> </prestashop>
I think the problem is in the product_feature tag.
Using Fiddler I track some bad and good calls, I see that good calls have no product_feature tag.
Bad calls have 3 or 4 product_feature that is the same number of returned error:
<?xml version="1.0" encoding="utf-8"?>
<prestashop>
<product>
<id xmlns="">1523</id>
<id_supplier xmlns="">0</id_supplier>
<id_manufacturer xmlns="">73</id_manufacturer>
<id_category_default xmlns="">30</id_category_default>
<id_default_image xmlns="">4492</id_default_image>
<id_default_combination d2p1:nil="true" xmlns:d2p1="http://www.w3.org/2001/XMLSchema-instance" xmlns="" />
<id_tax_rules_group xmlns="">1</id_tax_rules_group>
<id_shop_default xmlns="">1</id_shop_default>
<on_sale xmlns="">0</on_sale>
<online_only xmlns="">0</online_only>
<ean13 xmlns="" />
<upc xmlns="" />
<ecotax xmlns="">0.000000</ecotax>
<minimal_quantity xmlns="">1</minimal_quantity>
<price xmlns="">9.917355</price>
<wholesale_price xmlns="">0.000000</wholesale_price>
<unity xmlns="" />
<unit_price_ratio xmlns="">0.000000</unit_price_ratio>
<additional_shipping_cost xmlns="">0.00</additional_shipping_cost>
<reference xmlns="">TRIS&TON</reference>
<supplier_reference xmlns="" />
<location xmlns="" />
<width xmlns="">0.000000</width>
<height xmlns="">0.000000</height>
<depth xmlns="">0.000000</depth>
<weight xmlns="">0.000000</weight>
<quantity_discount xmlns="">0</quantity_discount>
<customizable xmlns="">0</customizable>
<uploadable_files xmlns="">0</uploadable_files>
<text_fields xmlns="">0</text_fields>
<active xmlns="">1</active>
<redirect_type xmlns="">404</redirect_type>
<id_product_redirected xmlns="">0</id_product_redirected>
<available_for_order xmlns="">1</available_for_order>
<available_date xmlns="">0000-00-00</available_date>
<condition xmlns="">new</condition>
<show_price xmlns="">1</show_price>
<indexed xmlns="">1</indexed>
<visibility xmlns="">both</visibility>
<cache_is_pack xmlns="">0</cache_is_pack>
<cache_has_attachments xmlns="">0</cache_has_attachments>
<is_virtual xmlns="">0</is_virtual>
<cache_default_attribute xmlns="">0</cache_default_attribute>
<date_add xmlns="">2016-04-13 12:33:25</date_add>
<date_upd xmlns="">2017-05-06 13:34:52</date_upd>
<advanced_stock_management xmlns="">0</advanced_stock_management>
<meta_description xmlns="">
<language id="1" />
</meta_description>
<meta_keywords xmlns="">
<language id="1" />
</meta_keywords>
<meta_title xmlns="">
<language id="1" />
</meta_title>
<link_rewrite xmlns="">
<language id="1">protector-de-cinturon-giraffes</language>
</link_rewrite>
<name xmlns="">
<language id="1">FUNDA EMPUÑADURA ENTERA HORIZONTAL SILLA DE PASEO PINGÜINO</language>
</name>
<description xmlns="">
<language id="1" />
</description>
<description_short xmlns="">
<language id="1"><h4>FUNDA EMPUÑADURA SILLA DE PASEO</h4>
<p>Una funda que protege a la vez que decora tu silla de paseo.</p>
<p></p></language>
</description_short>
<available_now xmlns="">
<language id="1">PLAZO DE ENVÍO 24-48 HORAS</language>
</available_now>
<available_later xmlns="">
<language id="1">PLAZO DE ENTREGA 1 SEMANA</language>
</available_later>
<associations xmlns="">
<categories xmlns="">
<category>
<id>30</id>
</category>
</categories>
<images xmlns="">
<image>
<id>4492</id>
</image>
<image>
<id>4491</id>
</image>
</images>
<combinations xmlns="" />
<product_option_values xmlns="" />
<product_features xmlns="" />
<tags xmlns="" />
<stock_availables xmlns="">
<stock_available>
<id>4387</id>
<id_product_attribute>0</id_product_attribute>
</stock_available>
</stock_availables>
<product_bundle xmlns="" />
<accessories xmlns="" />
</associations>
</product>
</prestashop>
Basic RlM4MjMxQVlVUjc1SzdCWDhGVVBKVlpVVzhRN0FESDk6
</script>
La etiqueta de apertura 'meta' en la línea 11 posición 2 no coincide con la etiqueta de cierre de 'head'. línea 20, posición 3. HttpStatusCode: NotFound
StackTrace : en Bukimedia.PrestaSharp.Factories.RestSharpFactory.Execute[T](RestRequest Request)
en Bukimedia.PrestaSharp.Factories.ProductFactory.Update(product Product)
en ExportProducts.CreateProduct.btnEdit_Click(Object sender, RoutedEventArgs e) en CreateProduct.xaml.cs:línea 236
Date :24/06/2017 17:32:11`
The problem can be sourced from PrestaShop versiyon. Check your error_log file on prestashop root or /api folder. Also u can open developer mode for read errors with detail. /config/defines.inc.php