magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

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

Open prasannanwr opened this issue 10 years ago • 176 comments

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

prasannanwr avatar Oct 08 '16 08:10 prasannanwr

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

kociiide avatar Oct 08 '16 10:10 kociiide

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

Oxidation1 avatar Oct 09 '16 01:10 Oxidation1

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.

prasannanwr avatar Oct 10 '16 06:10 prasannanwr

@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?

veloraven avatar Oct 10 '16 06:10 veloraven

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

prasannanwr avatar Oct 10 '16 07:10 prasannanwr

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

kociiide avatar Oct 10 '16 07:10 kociiide

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

prasannanwr avatar Oct 10 '16 09:10 prasannanwr

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}"}

jvreeken avatar Oct 10 '16 19:10 jvreeken

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.

xSevithx avatar Oct 13 '16 16:10 xSevithx

I am facing the same issue in Magento 2.1.2.

sanjayjethva avatar Oct 18 '16 04:10 sanjayjethva

We have the same issue Magento 2.1.2

entity53 avatar Oct 18 '16 19:10 entity53

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

dreucifer avatar Oct 19 '16 19:10 dreucifer

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 avatar Oct 19 '16 20:10 jvreeken

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

jvreeken avatar Oct 20 '16 16:10 jvreeken

Same Issue facing on Magento 2.1.2. any solution ?

channelriyas avatar Oct 21 '16 11:10 channelriyas

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

Asitis avatar Oct 21 '16 12:10 Asitis

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

nuwaus avatar Oct 25 '16 14:10 nuwaus

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

cscd98 avatar Nov 02 '16 15:11 cscd98

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

nuwaus avatar Nov 02 '16 16:11 nuwaus

@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}"}

cscd98 avatar Nov 02 '16 16:11 cscd98