magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.48k stars 9.29k forks source link

Couldnot place order "An error occured on the server. Please try to place the order again" #6929

Closed prasannanwr closed 7 years ago

prasannanwr commented 7 years ago

I am unable to place the order in Magento 2.1.1. I don't get specific log details to track the error. The console log shows "Failed to load resource: the server responded with a status of 400 (Bad Request)" at http://example.com/rest/default/V1/guest-carts/36b703a23e05b25a08da0e8ba5ab031f/payment-information

I have previously installed an extension to delete orders. But I removed it too and upgraded setup and cleared cache too. But I can't place order now.

There are no table prefixes either. After setup upgrade, I runned "bin/magento setup:di:compile" command.

image

Please suggest

kociiide commented 7 years ago

Hi there,

I am having the same issue, glad it's not isolated to me.

We upgraded to magento 2.1.1 and are facing checkout issues associated with he number of address lines a customer has.

If a customer has only 1 address line filled in and the default setting is 2 the error occurs.

If you set the value to 1 in the admin panel customers with 1 address line can then checkout but with existing customers who have filled in 2 lines the problem again happens.

I could really do with a fix asap.

Thanks in advance Dan

Oxidation1 commented 7 years ago

Been stuck on this problem for awhile now.. cant seem to figure it out.. hopefully someone can...

prasannanwr commented 7 years ago

Don't anybody have insight on it. I am really disappointed with magento 2.1. I don't think the 2.1 version is ready for production.

veloraven commented 7 years ago

@prasannanwr please provide exact steps you do and specify payment and shipment methods you use. Is the problem present for Cash on Delivery payment method only or for others as well? Is customer registered or making order as guest? Was it upgrade from some previous version or clear Magento install?

prasannanwr commented 7 years ago

The shipping method is Free shipping and the payment method is Cash on delivery. I have not tested on other payment methods. My requirement is cod now. The customer is making order as guest.

I have installed fresh magento 2.1.1. Before it was working well. But after when I runned system upgrade and compiled, I got this error I guess but not sure.

image

kociiide commented 7 years ago

Hi Veloraven.

To replicate the same bug on our website and little more info please see below.

The same error as posted here is happening with us. We upgrade from 2.0.9 to 2.1.1.

We are also experiencing the same issues as documented here which is looks like this is repeated to:

https://github.com/magento/magento2/issues/4921

Within the admin panel set the address lines for customers to 2:

Stores > Configuration > Customer > Customer Configuration > Name and Address Options: Number of Lines in a Street Address make it 2

Then register a new customer but only fill in one address line.

When you go to place an order you get the error originally posted here in the last stage.

If you change the admin value to 1 (which was a temporary fix for 2.1) the error occurs with customers who have 2 address lines filled in.

Hope this helps. Dan

prasannanwr commented 7 years ago

Finally I figured out the problem. I have skipped City field on checkout because we don't need city on address. Upon enabling the city field, it worked. I want to remove city on checkout. Are there any good way to do that?

Thanks

jvreeken commented 7 years ago

I'm having the same issue, but nothing has fixed it: When I try to checkout: {"message":"An error occurred on the server. Please try to place the order again.","trace":"#0 [internal function]: Magento\Checkout\Model\GuestPaymentInformationManagement->savePaymentInformationAndPlaceOrder('3bc99aeaf443e17...', 'james.vreeken@t...', Object(Magento\Quote\Model\Quote\Payment), Object(Magento\Quote\Model\Quote\Address))\n#1 \/Users\/jvreeken\/Sites\/morganjewelers\/vendor\/magento\/module-webapi\/Controller\/Rest.php(307): call_user_func_array(Array, Array)\n#2 \/Users\/jvreeken\/Sites\/morganjewelers\/vendor\/magento\/module-webapi\/Controller\/Rest.php(216): Magento\Webapi\Controller\Rest->processApiRequest()\n#3 \/Users\/jvreeken\/Sites\/morganjewelers\/var\/generation\/Magento\/Webapi\/Controller\/Rest\/Interceptor.php(37): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))\n#4 \/Users\/jvreeken\/Sites\/morganjewelers\/vendor\/magento\/framework\/App\/Http.php(135): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))\n#5 \/Users\/jvreeken\/Sites\/morganjewelers\/vendor\/magento\/framework\/App\/Bootstrap.php(258): Magento\Framework\App\Http->launch()\n#6 \/Users\/jvreeken\/Sites\/morganjewelers\/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))\n#7 {main}"}

xSevithx commented 7 years ago

I am receiving the same error as well. I am disappointed with this software, this is the first choice of e commerce software I have tried, and I am debating to switch. I CAN say, that given the bugs in this version, there is no way I will get a license for EE. No way. Bugs on adding items into the catalog I had to circumvent myself. Now I cant checkout because I get an error. I have checked every log and they show nothing. All the fields are valid on checkout, it break, but still goes through. Im using live transactions, Im in production mode (Just switched lastnight) Shipping&Handling is 0 (for local pickup & delivery). This software should have been well vetted before you release a buggy version, and cause problems for people with a customer base. Thank god I haven't launched yet.

Not to mention the install hung, but yet the log said it finished, front end would hang forever. But the installation went through.

sanjayjethva commented 7 years ago

I am facing the same issue in Magento 2.1.2.

entity53 commented 7 years ago

We have the same issue Magento 2.1.2

dreucifer commented 7 years ago

I am having the same issue with Magento 2.1.2.

Preconditions

  1. Magento CE 2.1.2 without sample data installed.
  2. Configured USPS and FedEx Shipping Methods.
  3. Configured PayPal Payments Pro Payment Method.
  4. Imported products and categories from a previous shopping cart.
  5. Set mode to production.

Steps to Reproduce

  1. Navigate to storefront as a guest.
  2. Open an imported category.
  3. Click "Add to Cart" on an imported product.
  4. Open mini shopping cart and click "Go to Checkout".
  5. Complete Address and Shipping steps of checkout.
  6. Select "Credit Card" for a Payment option.
  7. Enter Credit Card details and click "Place Order".

Actual and Expected Results

Expected Results

To be sent to an order confirmation page and have the order show up in the 'Sales->Orders'.

Actual Results

I get an error that says, "An error occurred on the server. Please try to place the order again." with a trace:

#0 [internal function]: Magento\Checkout\Model\GuestPaymentInformationManagement->savePaymentInformationAndPlaceOrder('****', '****', Object(Magento\Quote\Model\Quote\Payment), Object(Magento\Quote\Model\Quote\Address))
#1 ****/vendor/magento/module-webapi/Controller/Rest.php(307): call_user_func_array(Array, Array)
#2 ****/vendor/magento/module-webapi/Controller/Rest.php(216): Magento\Webapi\Controller\Rest->processApiRequest()
#3 ****/var/generation/Magento/Webapi/Controller/Rest/Interceptor.php(37): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))
#4 ****/vendor/magento/framework/App/Http.php(135): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#5 ****/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#6 ****/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#7 {main}

Additional Information

I am also seeing HTTP 400 Bad Request errors on ****/rest/default/V1/guest-carts/****/payment-information

jvreeken commented 7 years ago

I'm running into this exact problem on magento 2.1.2

Using authorize.net direct post method.

I tried changing address line to 1 and it started working... not sure how many customers had addresses that are 2 lines... anyone find a fix for this?

Maybe someone can figure out a sql query that could concatenate addresses in the database that were using 2 lines?

I don't really know how to move forward from this... maybe ditch magento and go with shopify, foxy.io, hell, even woocommerce would be a step up at this point with all the issues magento2 has...

If anyone has any ideas on how to fix this I'm all ears!

Thanks!

jvreeken commented 7 years ago

I tried the same fix on our staging server changing the address lines to 1, but this didn't fix it on staging...

Staging is in production mode, and local in development... maybe that has something to do with it?

I also thought it might be https vs http using a sandbox key with authorize.net so I changed staging to not force https trying to get staging more in line with my dev environment and I've ruled that out... I'm going to try to put staging into dev mode and try again.

Here is a screenshot of the network tabs on local dev and staging showing it worked on my local environment, but not on staging which is in production mode:

https://www.dropbox.com/s/fb17g39mo3mu9ds/Screenshot%202016-10-20%2009.50.12.png?dl=0

channelriyas commented 7 years ago

Same Issue facing on Magento 2.1.2. any solution ?

Asitis commented 7 years ago

Same for me :/ somehow glad to see it's not us, but damn, another critical bug? Where does it end...

nuwaus commented 7 years ago

Please check your sales_sequence_meta and sales_sequence_profile tables They should be similar to these, 2016-10-25 19_50_07-magento2 nl _ localhost _ magento2_magento _ sales_sequence_profile _ phpmyadmin sales_sequence_profile

2016-10-25 19_51_29-magento2 nl _ localhost _ magento2_magento _ sales_sequence_meta _ phpmyadmin 4 sales_sequence_meta

After I fixed these tables, it started to working.

And not to forget, if you already have some orders, please insert a record to sequence_order_1 table above the number of orders. Ex : if you have 10 orders, insert a record with 11 or 12 as sequence_value

csdougliss commented 7 years ago

Same issue here, thought it was my payment code.. guess it's not! 2.1.2

nuwaus commented 7 years ago

It is more of db related issue, please check those tables mentioned.

csdougliss commented 7 years ago

@nuwaus Plus the store Id i'm checking out on is 3

screen shot 2016-11-02 at 16 31 59

screen shot 2016-11-02 at 16 32 23

Here is my error:

{"message":"An error occurred on the server. Please try to place the order again.","trace":"#0 \/Users
\/ccarnell\/Sites\/vax-uk2\/vendor\/magento\/framework\/Interception\/Interceptor.php(146): Magento\
\Checkout\\Model\\GuestPaymentInformationManagement->savePaymentInformationAndPlaceOrder('83aea169274f681
...', 'ccarnell@tti-fc...', Object(Magento\\Quote\\Model\\Quote\\Payment), Object(Magento\\Quote\\Model
\\Quote\\Address\\Interceptor))\n#1 \/Users\/ccarnell\/Sites\/vax-uk2\/var\/generation\/Magento\/Checkout
\/Model\/GuestPaymentInformationManagement\/Interceptor.php(26): Magento\\Checkout\\Model\\GuestPaymentInformationManagement
\\Interceptor->___callPlugins('savePaymentInfo...', Array, Array)\n#2 [internal function]: Magento\\Checkout
\\Model\\GuestPaymentInformationManagement\\Interceptor->savePaymentInformationAndPlaceOrder('83aea169274f681
...', 'ccarnell@tti-fc...', Object(Magento\\Quote\\Model\\Quote\\Payment), Object(Magento\\Quote\\Model
\\Quote\\Address\\Interceptor))\n#3 \/Users\/ccarnell\/Sites\/vax-uk2\/vendor\/magento\/module-webapi
\/Controller\/Rest.php(307): call_user_func_array(Array, Array)\n#4 \/Users\/ccarnell\/Sites\/vax-uk2
\/vendor\/magento\/module-webapi\/Controller\/Rest.php(216): Magento\\Webapi\\Controller\\Rest->processApiRequest
()\n#5 \/Users\/ccarnell\/Sites\/vax-uk2\/vendor\/magento\/framework\/Interception\/Interceptor.php(146
): Magento\\Webapi\\Controller\\Rest->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#6 \
/Users\/ccarnell\/Sites\/vax-uk2\/var\/generation\/Magento\/Webapi\/Controller\/Rest\/Interceptor.php
(39): Magento\\Webapi\\Controller\\Rest\\Interceptor->___callPlugins('dispatch', Array, Array)\n#7 \
/Users\/ccarnell\/Sites\/vax-uk2\/vendor\/magento\/framework\/App\/Http.php(135): Magento\\Webapi\\Controller
\\Rest\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#8 \/Users\/ccarnell\
/Sites\/vax-uk2\/vendor\/magento\/framework\/App\/Bootstrap.php(258): Magento\\Framework\\App\\Http-
>launch()\n#9 \/Users\/ccarnell\/Sites\/vax-uk2\/pub\/index.php(37): Magento\\Framework\\App\\Bootstrap-
>run(Object(Magento\\Framework\\App\\Http))\n#10 {main}"}
nuwaus commented 7 years ago

@craigcarnell Please check the AUTO_INCREMENT of your sequence_order_1 if it possible to delete your current orders please do as follow,

SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE `gift_message`;
TRUNCATE TABLE `quote`;
TRUNCATE TABLE `quote_address`;
TRUNCATE TABLE `quote_address_item`;
TRUNCATE TABLE `quote_id_mask`;
TRUNCATE TABLE `quote_item`;
TRUNCATE TABLE `quote_item_option`;
TRUNCATE TABLE `quote_payment`;
TRUNCATE TABLE `quote_shipping_rate`;
TRUNCATE TABLE `reporting_orders`;
TRUNCATE TABLE `sales_bestsellers_aggregated_daily`;
TRUNCATE TABLE `sales_bestsellers_aggregated_monthly`;
TRUNCATE TABLE `sales_bestsellers_aggregated_yearly`;
TRUNCATE TABLE `sales_creditmemo`;
TRUNCATE TABLE `sales_creditmemo_comment`;
TRUNCATE TABLE `sales_creditmemo_grid`;
TRUNCATE TABLE `sales_creditmemo_item`;
TRUNCATE TABLE `sales_invoice`;
TRUNCATE TABLE `sales_invoiced_aggregated`;
TRUNCATE TABLE `sales_invoiced_aggregated_order`;
TRUNCATE TABLE `sales_invoice_comment`;
TRUNCATE TABLE `sales_invoice_grid`;
TRUNCATE TABLE `sales_invoice_item`;
TRUNCATE TABLE `sales_order`;
TRUNCATE TABLE `sales_order_address`;
TRUNCATE TABLE `sales_order_aggregated_created`;
TRUNCATE TABLE `sales_order_aggregated_updated`;
TRUNCATE TABLE `sales_order_grid`;
TRUNCATE TABLE `sales_order_item`;
TRUNCATE TABLE `sales_order_payment`;
TRUNCATE TABLE `sales_order_status_history`;
TRUNCATE TABLE `sales_order_tax`;
TRUNCATE TABLE `sales_order_tax_item`;
TRUNCATE TABLE `sales_payment_transaction`;
TRUNCATE TABLE `sales_refunded_aggregated`;
TRUNCATE TABLE `sales_refunded_aggregated_order`;
TRUNCATE TABLE `sales_shipment`;
TRUNCATE TABLE `sales_shipment_comment`;
TRUNCATE TABLE `sales_shipment_grid`;
TRUNCATE TABLE `sales_shipment_item`;
TRUNCATE TABLE `sales_shipment_track`;
TRUNCATE TABLE `sales_shipping_aggregated`;
TRUNCATE TABLE `sales_shipping_aggregated_order`;
TRUNCATE TABLE `tax_order_aggregated_created`;
TRUNCATE TABLE `tax_order_aggregated_updated`;

ALTER TABLE `gift_message` AUTO_INCREMENT=1; 
ALTER TABLE `quote` AUTO_INCREMENT=1; 
ALTER TABLE `quote_address` AUTO_INCREMENT=1; 
ALTER TABLE `quote_address_item` AUTO_INCREMENT=1; 
ALTER TABLE `quote_id_mask` AUTO_INCREMENT=1; 
ALTER TABLE `quote_item` AUTO_INCREMENT=1; 
ALTER TABLE `quote_item_option` AUTO_INCREMENT=1; 
ALTER TABLE `quote_payment` AUTO_INCREMENT=1; 
ALTER TABLE `quote_shipping_rate` AUTO_INCREMENT=1; 
ALTER TABLE `reporting_orders` AUTO_INCREMENT=1; 
ALTER TABLE `sales_bestsellers_aggregated_daily` AUTO_INCREMENT=1; 
ALTER TABLE `sales_bestsellers_aggregated_monthly` AUTO_INCREMENT=1; 
ALTER TABLE `sales_bestsellers_aggregated_yearly` AUTO_INCREMENT=1; 
ALTER TABLE `sales_creditmemo` AUTO_INCREMENT=1; 
ALTER TABLE `sales_creditmemo_comment` AUTO_INCREMENT=1; 
ALTER TABLE `sales_creditmemo_grid` AUTO_INCREMENT=1; 
ALTER TABLE `sales_creditmemo_item` AUTO_INCREMENT=1; 
ALTER TABLE `sales_invoice` AUTO_INCREMENT=1; 
ALTER TABLE `sales_invoiced_aggregated` AUTO_INCREMENT=1; 
ALTER TABLE `sales_invoiced_aggregated_order` AUTO_INCREMENT=1; 
ALTER TABLE `sales_invoice_comment` AUTO_INCREMENT=1; 
ALTER TABLE `sales_invoice_grid` AUTO_INCREMENT=1; 
ALTER TABLE `sales_invoice_item` AUTO_INCREMENT=1; 
ALTER TABLE `sales_order` AUTO_INCREMENT=1; 
ALTER TABLE `sales_order_address` AUTO_INCREMENT=1; 
ALTER TABLE `sales_order_aggregated_created` AUTO_INCREMENT=1; 
ALTER TABLE `sales_order_aggregated_updated` AUTO_INCREMENT=1; 
ALTER TABLE `sales_order_grid` AUTO_INCREMENT=1; 
ALTER TABLE `sales_order_item` AUTO_INCREMENT=1; 
ALTER TABLE `sales_order_payment` AUTO_INCREMENT=1; 
ALTER TABLE `sales_order_status_history` AUTO_INCREMENT=1; 
ALTER TABLE `sales_order_tax` AUTO_INCREMENT=1; 
ALTER TABLE `sales_order_tax_item` AUTO_INCREMENT=1; 
ALTER TABLE `sales_payment_transaction` AUTO_INCREMENT=1; 
ALTER TABLE `sales_refunded_aggregated` AUTO_INCREMENT=1; 
ALTER TABLE `sales_refunded_aggregated_order` AUTO_INCREMENT=1; 
ALTER TABLE `sales_shipment` AUTO_INCREMENT=1; 
ALTER TABLE `sales_shipment_comment` AUTO_INCREMENT=1; 
ALTER TABLE `sales_shipment_grid` AUTO_INCREMENT=1; 
ALTER TABLE `sales_shipment_item` AUTO_INCREMENT=1; 
ALTER TABLE `sales_shipment_track` AUTO_INCREMENT=1; 
ALTER TABLE `sales_shipping_aggregated` AUTO_INCREMENT=1; 
ALTER TABLE `sales_shipping_aggregated_order` AUTO_INCREMENT=1; 
ALTER TABLE `tax_order_aggregated_created` AUTO_INCREMENT=1; 
ALTER TABLE `tax_order_aggregated_updated` AUTO_INCREMENT=1; 
SET FOREIGN_KEY_CHECKS = 1;

Doing this worked for me, make sure to disable any 3rd party extensions which effect on ordering process, such as modules for rewards points etc..

And make sure to backup your database as it is before doing truncate.

csdougliss commented 7 years ago

@nuwaus tried truncating my tables, increase the sequence, didn't work for me I'm afraid :( I'll have to try disabling modules.

nuwaus commented 7 years ago

@craigcarnell

Please try to place an order, then after you get the error message, go to sales_order table and see if it has inserted a new record. If that happen you can narrow down the issue.

Sometimes order places, but some other DB transaction after that can cause the issue because it happened to me as well after the order is placed I got an error when it trying to add records to rewards point table, it was a 3rd party module, so I had to truncate that table as well.

Asitis commented 7 years ago

I eventually fixed this by tracing the problem all the way back to certificates used for the payment provider. I recreated new certificates and replaced the old ones, and I then saw that the key in app/etc/env.php was changed after the installation. I changed it back to what it was before and the error resolved.

csdougliss commented 7 years ago

I setup a clean install of CE 2.1.2 continue development. I didn't have this issue with it, except now I do.? I tried setting address to 1

{"message":"An error occurred on the server. Please try to place the order again.","trace":"#0 [internal
 function]: Magento\\Checkout\\Model\\GuestPaymentInformationManagement->savePaymentInformationAndPlaceOrder
('0208c70f22bf5c8...', 'ccarnell@tti-fc...', Object(Magento\\Quote\\Model\\Quote\\Payment), NULL)\n#1
 \/Users\/ccarnell\/Sites\/codesocial-uk2\/vendor\/magento\/module-webapi\/Controller\/Rest.php(307)
: call_user_func_array(Array, Array)\n#2 \/Users\/ccarnell\/Sites\/codesocial-uk2\/vendor\/magento\/module-webapi
\/Controller\/Rest.php(216): Magento\\Webapi\\Controller\\Rest->processApiRequest()\n#3 \/Users\/ccarnell
\/Sites\/codesocial-uk2\/var\/generation\/Magento\/Webapi\/Controller\/Rest\/Interceptor.php(37): Magento
\\Webapi\\Controller\\Rest->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#4 \/Users\/ccarnell
\/Sites\/codesocial-uk2\/vendor\/magento\/framework\/App\/Http.php(135): Magento\\Webapi\\Controller
\\Rest\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#5 \/Users\/ccarnell\
/Sites\/codesocial-uk2\/vendor\/magento\/framework\/App\/Bootstrap.php(258): Magento\\Framework\\App
\\Http->launch()\n#6 \/Users\/ccarnell\/Sites\/codesocial-uk2\/pub\/index.php(37): Magento\\Framework
\\App\\Bootstrap->run(Object(Magento\\Framework\\App\\Http))\n#7 {main}"}
sergiojovanig commented 7 years ago

I can confirm this bug in Magento 2.1.2.

Following what @kociiide said I configured customer addresses to have only 1 line. After this, NEW customers can place order, but existing not.

Looking for a fix...

mehh commented 7 years ago

Any update here? I'm having the same issue.

hocomadvies commented 7 years ago

I have the same problem and trying to find a solution for several days now. My client is not amused and so Am I. This needs to be solved soon. When to expect the 2.1.3 version??? With al fixes?

In my Magento2.1.2 system I get the same error when placing an order:

400 (Bad Request)" at
http://example.com/rest/default/V1/guest-carts/36b703a23e05b25a08da0e8ba5ab031f/payment-information

Nothing is placed in sales_order. Also above mentioned tables are the same for me. These are the tables I have in my database. Am I missing some tables? sequence

I do not know if it is important but I migrated data from older 1.9 into Magento 2 (with the ubertheme module) only products and the category. Could that have caused some missing tables? How to trouble shoot that? Or any other workaround that solves this!

abdel1220 commented 7 years ago

Hello everybody,

Hope find urgent fix for this,

i have the same issue on magento 2.1.2, I tried every fix possible described in many issues, but with no success.

SewHappy58 commented 7 years ago

Ditto. Same issue with 2.1.1 I get the same error message shown above when placing an order using Authorize.net. The payment gets processed via Authorize.net (testing on staging site). Changed address to 1 line and still didn't work.

hocomadvies commented 7 years ago

Still did not find a solution. tried all things I red here. Looking again into the d-base as mentioned above by @nuwaus I wondered about the shop-id In the table there is only id=0 and id=1 but I see my shop has id=2 ? Should there than not be a third part in the sales_sequence_meta for the shop with id=2 ?

shopid

sequence_tabel

Or did I mess-up with my store settings I have this now:

stores_settings

and I have set one store somewhere in the config (could not find where) :)

webagil-kevin commented 7 years ago

I have the same problem with checkmo and banktransfer.

I can force payment validation. To do this, in the "quote" table, I look for the line of this basket and I reset the "reserved_order_id" field to "NULL".

schasiepen commented 7 years ago

Same problem with Check / Money Order (only payment method) Magento 2.1.1 PHP 7.0.13 MySql 5.6.34 Stores: German, Italian, Englisch Street: 1 Line

Order is generated correctly, Order Confirmation Email is send. But customer is not redirected to the success page. Instead the error shows up (for just a few seconds) An error occurred on the server. Please try to place the order again.

, the cart is empty and the customer is still on the checkout page. Of course the customer can't place the order again and is confused.

tempo-ruud commented 7 years ago

common @magento-admin This can't be true, your system does not support receiving payments at the moment. This should have been fixed right when the bug came in.

hocomadvies commented 7 years ago

@veloraven When to expect a solution on this "crucial" subject? Many are struggling with this problem. If no solution is found than the system is not usable for running a commercial shop. Please dig into this and come up with a solution or a Magento2.1.3 upgrade fast.

tempo-ruud commented 7 years ago

Indeed, I am even wondering if we should still proceed with Magento 2. We know there are many bugs there, but having a bug like this since the 8th of October is simply not acceptable. Even for an open source application.

hocomadvies commented 7 years ago

Still waiting for a solution!! Any results on this guys? One of you Magento developers willing to dig into this and provide us with a solution now!!!? This is not good! 👎

southerncomputer commented 7 years ago

Comment out the exception catcher in vendor/magento/module-checkout/Model/PaymentInformationManagement.php

Then try again, you will see an error show up in your logs in production mode!

For me it was an extension that used a plugin that was calling an undefined variable!

Comment out the TRY { } { catch} but not the $orderId = $this->cartManagement->placeOrder($cartId);

This will expose the underlying error to a tee!

//try { $orderId = $this->cartManagement->placeOrder($cartId); / } catch (\Exception $e) { throw new CouldNotSaveException( __('CNSE1: An error occurred on the server. Please try to place the order again.'.' '.$cartId.$sam.' '.$orderId), $e ); } /

hocomadvies commented 7 years ago

@southerncomputer Thanks for the reply. I tried it with the code commented out and it returned a 500 internal Server error.

{"message":"SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '', : INSERT INTO `` () VALUES ()",

See the full error here: http://pastebin.com/YYxTvGis

Is there an other file / place where to look for info on the error?

southerncomputer commented 7 years ago

Magento\SalesSequence\Model\Sequence->getNextValue() is failing!

Are you using split databases EE feature? in vendor/magento/module-sales-sequence/Model/Sequence.php it should be able to access the sales_sequence tables:

see here: https://github.com/magento/magento2/issues/3066

select * from sales_sequence_meta;

+---------+-------------+----------+-----------------------+ | meta_id | entity_type | store_id | sequence_table | +---------+-------------+----------+-----------------------+ | 1 | order | 0 | sequence_order_0 | | 2 | invoice | 0 | sequence_invoice_0 | | 3 | creditmemo | 0 | sequence_creditmemo_0 | | 4 | shipment | 0 | sequence_shipment_0 | | 5 | rma_item | 0 | sequence_rma_item_0 | | 6 | order | 1 | sequence_order_1 | | 7 | invoice | 1 | sequence_invoice_1 | | 8 | creditmemo | 1 | sequence_creditmemo_1 | | 9 | shipment | 1 | sequence_shipment_1 | | 10 | rma_item | 1 | sequence_rma_item_1 | | 11 | quote | 0 | sequence_quote_0 | | 12 | quote | 1 | sequence_quote_1 | +---------+-------------+----------+-----------------------+ 12 rows in set (0.01 sec)

mysql> select * from sales_sequence_profile; +------------+---------+--------+--------+-------------+------+------------+---------------+-----------+ | profile_id | meta_id | prefix | suffix | start_value | step | max_value | warning_value | is_active | +------------+---------+--------+--------+-------------+------+------------+---------------+-----------+ | 1 | 1 | NULL | NULL | 1 | 1 | 4294967295 | 4294966295 | 1 | | 2 | 2 | NULL | NULL | 1 | 1 | 4294967295 | 4294966295 | 1 | | 3 | 3 | NULL | NULL | 1 | 1 | 4294967295 | 4294966295 | 1 | | 4 | 4 | NULL | NULL | 1 | 1 | 4294967295 | 4294966295 | 1 | | 5 | 5 | NULL | NULL | 1 | 1 | 4294967295 | 4294966295 | 1 | | 6 | 6 | NULL | NULL | 1 | 1 | 4294967295 | 4294966295 | 1 | | 7 | 7 | NULL | NULL | 1 | 1 | 4294967295 | 4294966295 | 1 | | 8 | 8 | NULL | NULL | 1 | 1 | 4294967295 | 4294966295 | 1 | | 9 | 9 | NULL | NULL | 1 | 1 | 4294967295 | 4294966295 | 1 | | 10 | 10 | NULL | NULL | 1 | 1 | 4294967295 | 4294966295 | 1 | | 11 | 11 | Q15. | NULL | 1 | 1 | 4294967295 | 4294966295 | 1 | | 12 | 12 | Q15. | NULL | 1 | 1 | 4294967295 | 4294966295 | 1 | +------------+---------+--------+--------+-------------+------+------------+---------------+-----------+ 12 rows in set (0.00 sec)

For each store there should be one set of tables and profiles! ignore the quote lines - those are custom for me!

SerhiyShkolyarenko commented 7 years ago

@dreucifer thank you for the steps. I tried 2.1.2 in production mode by the steps you described and placed order twice: 1) FedEx shipping with credit card payment 2) USPS shipping with credit card payment

Imported products and categories from a previous shopping cart.

Could you pleas clarify what you mean here?

Let's try to understand what we are doing in the different way. Did you use any other configuration changes?

SerhiyShkolyarenko commented 7 years ago

@craigcarnell could you point steps to reproduce for that error?

SerhiyShkolyarenko commented 7 years ago

@sjovanig we need steps to reproduce to fix it. Do you reproduce it on the clean Magento installation? What are configuration changes? Which payment and shipping methods you use?

hocomadvies commented 7 years ago

@SerhiyShkolyarenko as mentioned above my store id = 2 but the strange thing is I only have 1 shop? So why is my store_id=2 ? Can I change the store id into 1 somehow? Or would it be better adding some rows to sales_sequence_meta and sales_sequence_profile?

| 11 | order | 2 | sequence_order_2 |
| 12 | invoice | 2 | sequence_invoice_2|
| 13 | creditmemo | 2 | sequence_creditmemo_2 |
| 14 | shipment | 2 | sequence_shipment_2 |
| 15 | rma_item | 2 | sequence_rma_item_2 |

But hwo would that be for the sales_sequence_profile than? like this ? : 11 | 11 | NULL | NULL | 1 | 1 | 4294967295 | 4294966295 | 1 |

SerhiyShkolyarenko commented 7 years ago

2 everyone who reported 400 error on API request. Let's clarify how to reproduce. I added product to cart on frontend, then set shipping address and shipping method on frontend, then sent request to guest-carts/f21a5febd9e9acf68cdb03bccc8caa99/payment-information with payload

{
  "email": "string@magento.com",
  "paymentMethod": {
    "po_number": "string",
    "method": "checkmo",
    "additional_data": [
      "string"
    ],
    "extension_attributes": {
      "agreement_ids": []
    }
  },
  "billingAddress": {
    "region_code": "CA",
    "country_id": "US",
    "street": [
      "string"
    ],
    "company": "string",
    "telephone": "string",
    "postcode": "90323",
    "city": "string",
    "firstname": "string",
    "lastname": "string",
    "middlename": "string",
    "prefix": "string",
    "suffix": "string",
    "email": "string@magetno.com",
    "same_as_billing": 0,
    "extension_attributes": {}
  }
}

and order was placed successfully. Which payload should I use to reproduce the issue?

southerncomputer commented 7 years ago

| 11 | order | 2 | sequence_order_2 | | 12 | invoice | 2 | sequence_invoice_2| | 13 | creditmemo | 2 | sequence_creditmemo_2 | | 14 | shipment | 2 | sequence_shipment_2 | | 15 | rma_item | 2 | sequence_rma_item_2 | ^^^^^^^^^^ YES ^^^^^^^^^^^^^^ But hwo would that be for the sales_sequence_profile than? like this ? : [[[[[[YES!]]]]]]]]]]]] 11 | 11 | NULL | NULL | 1 | 1 | 4294967295 | 4294966295 | 1 |

you would need to create the tables as well as do above!

hocomadvies commented 7 years ago

Getting some progress now, but ended up with a new error:

{"message":"SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '000000000-2' for key
 'SALES_ORDER_INCREMENT_ID_STORE_ID', query was: INSERT INTO `sales_order` 

When I lookinto sales_order store_id says: 2 ? So why this error?

In addition to @SerhiyShkolyarenko advise I also added a new record for:

sequence_creditmemo_2, sequence_invoice_2, sequence_order_2, sequence_shipment_2

Could that be the reason Of this error?

hocomadvies commented 7 years ago

When I clear the sales_order record than I can place an order and it seems to work. Than placing an new order I get again the error:


:"SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '000000000-2' for key
 'SALES_ORDER_INCREMENT_ID_STORE_ID', query was: INSERT INTO `sales_order` 

This is how the new created order number looks like: order0000

In the sequence_order_2 table all the values are 0 ? Is that ok?

SerhiyShkolyarenko commented 7 years ago

@jvreeken I looked at the screenshot

https://www.dropbox.com/s/fb17g39mo3mu9ds/Screenshot%202016-10-20%2009.50.12.png?dl=0

and seen a custom theme there and payment method code md_authorizecim which is not part of Magento CE. Is the issue is reproducible for you on clean Magento instance without custom modules and themes?

hocomadvies commented 7 years ago

Could this be the problem?:

eav_entity

So do I also need to create an entity for store id=2 here to get rid of the "duplicate entry error?

Any idea how to solve this issue? I'm getting a bit lost now! Have the feeling that I'm close but do not know how to get there :)