Hallo, mir ist dieser Fehler schon häufiger aufgefallen. Er trat komischweise nicht immer auf, behindert aber meine momentane Artikelpflege und besteht meines Wissens nach seit 2.6.X. Es gibt keinen Zusammenhang zwischen frischer Neuinstallation, angepasstem Shop oder lokal/online. Das Problem: Wenn ich einen Artikel kopieren möchte erscheint eine weiße Seite mit dem Fehler "SQL Error (256)" mehr nicht. Bisher funktionierte alles. Das Einzige, was ich geändert habe war die Kategoriestruktur. Es gab eine Oberkategorie A und zwei Unterkategorien a und b. Die Unterkategorien wurden nun beide zur Oberkategorie a und b und A wurde gelöscht. Ich weiß nicht, ob bereits ein Ticket besteht, da ich der Meinung bin solch ein Verhalten schon einmal gelesen zu haben. Der Artikel wid scheinbar kopiert, aber keiner Kategorie zugeordnet. Vielleicht hilft es, wenn ich kurz erläutere, was in der Datenbank passiert: 1) product Einer neuer Eintrag wird eingefügt. Alle Spalten werden kopiert bis auf "products_image". Die Spalte wird auf NULL gesetzt. 2) product_content Einträge werden scheinbar kopiert. Die products_id wird überall auf 0 gesetzt. 3) products_description Zwei neue Einträge werden angelegt. 3.1) für language_id = 1 (Englisch): products_name wird kein " - Kopie" angefügt. gm_url_keywords wird mit "-0" belegt. Der Rest wird richtig kopiert. 3.2) für language_id = 2 (Deutsch): products_id ist um 1 erhöht wurden. products_name wird kein " - Kopie" angefügt. gm_url_keywords wird mit "-0" belegt. Der Rest wird richtig kopiert. 4) products_images Einträge werden scheinbar kopiert. Die products_id wird überall auf 0 gesetzt. 5) products_item_codes Eintrag wird scheinbar kopiert. Die products_id wird auf 0 gesetzt. 6) products_quantity_unit Tabelle ist sonst komplett leer. Hier wird ein Eintrag erzeugt der komplett mit 0'en belegt ist. Andere Tabellen werden bei dem Vorgang gar nicht beschrieben! (products_to_categories, products_hermesoptions, ...) Beim Kopieren möchte ich das Produkt in die gleiche Kategorie duplizieren (Fehler tritt auch bei anderen Katgorien auf). Häckchen bei den Kopieroptionen sind alle raus, sprich keine Attribute, Sonderangebote oder Cross Selling. Der Ausgangsartikel besitzt trotzdem Cross Selling, Eigenschaften und ist unter Umständen ein Sonderangebot. Die GET-Variable "cID" ist bei der KopierURL immer leer. Wie gesagt: Bisher funktionierte das Kopieren! Ich habe seit dem letzten Versuch kein neues Update eingespielt gehabt. Läuft momentan auf 2.7.1.2. Fehler fiel mir vorher aber schon lokal auf anderen Versionen auf. Hoffe ich konnte es genau und verständlich beschreiben. Alle Logfiles etc. geben keine Auskunft.
Die einzige relevanten Einträge sind folgende: Code: 2016-02-26 16:00:30 (6a8683934e4d243a6e0b51198c890a39) SQL ERROR(1062): "Duplicate entry '0' for key 'PRIMARY'" in /www/htdocs/testserver/inc/xtc_db_error.inc.php:23 (Details) 2016-02-26 16:00:30 (6a8683934e4d243a6e0b51198c890a39) USER ERROR(256): "SQL Error" in /www//testserver/inc/xtc_db_error.inc.php:24 (Details) (nachvollziehbar, wenn vorher die ID verloren geht) und: Code: 2016-02-26 16:00:30 (6a8683934e4d243a6e0b51198c890a39) SQL ERROR(1062): "Duplicate entry '0' for key 'PRIMARY'" in /www/htdocs/testserver/inc/xtc_db_error.inc.php:23 #5 File: /www/htdocs/testserver/inc/xtc_db_error.inc.php:23 #4 File: /www/htdocs/testserver/inc/xtc_db_query.inc.php:77 #3 File: /www/htdocs/testserver/system/core/GMDataObject.inc.php:340 #2 File: /www/htdocs/testserver/system/classes/quantity_units/ProductQuantityUnitHandler.inc.php:42 #1 File: /www/htdocs/testserver/admin/includes/classes/categories.php:1803 #0 File: /www/htdocs/testserver/admin/categories.php:425 Request: POST /admin/categories.php?action=multi_action_confirm&pID=61&cPath=3 - duration: ~92ms - server: Apache - server address: 85.13.144.171 - user agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36 - remote address: 6a8683934e4d243a6e0b51198c890a39 Post: - cPath: 3 - page_token: af00b1581b19ffea54543efc2debff86 - multi_products: Array ( [0] => _61 ) - copy_as: duplicate - dest_category_id: 3 - multi_copy_confirm: MoveConfirm Get: - action: multi_action_confirm - pID: 61 - cPath: 3 Information: Query: INSERT INTO products_quantity_unit SET quantity_unit_id = "0" , products_id = "0" ================================================================================ 2016-02-26 16:00:30 (6a8683934e4d243a6e0b51198c890a39) USER ERROR(256): "SQL Error" in /www/htdocs/testserver/inc/xtc_db_error.inc.php:24 #5 File: /www/htdocs/testserver/inc/xtc_db_error.inc.php:24 Code: │ line 22: $coo_logger = LogControl::get_instance(); │ line 23: $coo_logger->notice($p_error, 'error_handler', 'errors', 'notice', 'SQL ERROR', $p_errno, 'Query:' . "\r\n" . trim($p_query)); ├─ line 24: trigger_error('SQL Error', E_USER_ERROR); │ line 25: } #4 File: /www/htdocs/testserver/inc/xtc_db_query.inc.php:77 Code: │ line 75: # ALL OTHER RUN MODES │ line 76: # execute query ├─ line 77: $result = mysql_query($p_query, $$link) or xtc_db_error($p_query, mysql_errno(), mysql_error()); │ line 78: } │ line 79: #3 File: /www/htdocs/testserver/system/core/GMDataObject.inc.php:340 Code: │ line 338: ; │ line 339: $this->v_last_sql = $t_sql; ├─ line 340: $t_result = xtc_db_query($t_sql); │ line 341: $t_return_id = xtc_db_insert_id(); │ line 342: #2 File: /www/htdocs/testserver/system/classes/quantity_units/ProductQuantityUnitHandler.inc.php:42 Code: │ line 40: $coo_data_object->set_data_value('products_id', (int) $p_products_id); │ line 41: ├─ line 42: $coo_data_object->save_body_data(); │ line 43: return true; │ line 44: } #1 File: /www/htdocs/testserver/admin/includes/classes/categories.php:1803 Code: │ line 1801: $coo_unit_handler = MainFactory::create_object('ProductQuantityUnitHandler'); │ line 1802: $t_src_unit_id = $coo_unit_handler->get_quantity_unit_id($src_products_id); ├─ line 1803: $coo_unit_handler->set_quantity_unit($dup_products_id, $t_src_unit_id); │ line 1804: unset($coo_unit_handler); │ line 1805: #0 File: /www/htdocs/testserver/admin/categories.php:425 Code: │ line 423: } │ line 424: elseif ($_POST['copy_as'] == 'duplicate') { ├─ line 425: $catfunc->duplicate_product($product_id, $dest_category_id); │ line 426: } else { │ line 427: $messageStack->add_session('Copy type not specified.', 'error'); Request: POST /admin/categories.php?action=multi_action_confirm&pID=61&cPath=3 - duration: ~115ms - server: Apache - server address: 85.13.144.171 - user agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36 - remote address: 6a8683934e4d243a6e0b51198c890a39 Session: - tpl: Honeygrid - MOBILE_ACTIVE: false - language: german - languages_id: 2 - language_charset: utf-8 - language_code: de - currency: EUR - customers_status: Array ( [customers_status_id] => 0 [customers_status_name] => Admin [customers_status_image] => admin_status.gif [customers_status_public] => 0 [customers_status_min_order] => 0 [customers_status_max_order] => 0 [customers_status_discount] => 0.00 [customers_status_ot_discount_flag] => 1 [customers_status_ot_discount] => 0.00 [customers_status_graduated_prices] => 1 [customers_status_show_price] => 1 [customers_status_show_price_tax] => 1 [customers_status_add_tax_ot] => 1 [customers_status_payment_unallowed] => [customers_status_shipping_unallowed] => [customers_status_discount_attributes] => 0 [customers_fsk18] => 1 [customers_fsk18_display] => 1 [customers_status_write_reviews] => 1 [customers_status_read_reviews] => 1 ) - cart: shoppingCart Object ( [contents] => Array ( ) [total] => 0 [weight] => 0 [cartID] => [content_type] => ) - wishList: wishList Object ( [contents] => Array ( [15x1517] => Array ( [qty] => 1.0000 ) ) [total] => 0 [weight] => 0 [cartID] => 37604 [content_type] => ) - customer_id: 1 - payment: ### Session entry not present ### - shipping: ### Session entry not present ### - cartID: ### Session entry not present ### - sendto: ### Session entry not present ### - billto: ### Session entry not present ### Post: - cPath: 3 - page_token: af00b1581b19ffea54543efc2debff86 - multi_products: Array ( [0] => _61 ) - copy_as: duplicate - dest_category_id: 3 - multi_copy_confirm: MoveConfirm Get: - action: multi_action_confirm - pID: 61 - cPath: 3
Hallo Daniel, SQL-Logging ist aktiviert, nur: Code: 2016-02-26 15:57:52 QUERY: "Execution time: ~0.000189s" Information: Query: INSERT INTO products_item_codes (google_export_condition, google_export_availability_id, brand_name, code_isbn, code_upc, code_mpn, code_jan, identifier_exists, gender, age_group, expiration_date, products_id) VALUES ('neu', '0', '', '', '', '', '', '1', '', '', '0000-00-00', '0') Information: Query: INSERT INTO products_content (products_id, group_ids, content_name, content_file, content_link, languages_id, content_read, file_comment) VALUES ('0', '', 'Zusicherung', '0781619001453298670.pdf', '', '2', '0', '')
Das SQL-Logging kann durchaus Probleme verursachen und zu Fehlfunktionen im Shop führen. Welche Option hast du denn an? SQL-Logging im Frontend? SQL-Logging im Backend? Speichern aller Datenbankabfragen?
Wir werden in nächster Zeit mal das Problem mit aktivem SQL-Logging angucken. Nun haben wir ein konkretes Szenario, um die Ursache zu finden. Vielen Dank dafür