Magento2: Magento 2.2.0 Checkout - Unable to save address. Please, check input data.

Created on 2 Oct 2017  路  13Comments  路  Source: magento/magento2


Preconditions


  1. Magento 2.2.0
  2. PHP 7.0.23
  3. MySQL 5.6.36-2.el6
  4. Just updated from 2.1.9 to 2.2.0

Steps to reproduce

  1. Add product to cart
  2. Go to checkout
  3. Check "My billing and shipping address are the same"
  4. Try to place order

Expected result

  1. Get redirected to bank

Actual result

  1. Loader does endless loading, a message appears and disappearis quickly :
    "Unable to save address. Please, check input data."

Console throws :
POST https://my-domain.com/france/rest/france/V1/guest-carts/4b9063581eace9deeaa63a0abd87b692/payment-information 400 (Bad Request)

POST XHR https://my-domain.com/france/rest/france/V1/guest-carts/4b9063581eace9deeaa63a0abd87b692/payment-information [HTTP/1.1 400 Bad Request 3739 ms]

HEADERS
Cache-Control no-store, no-cache, must-revalidate
Connection keep-alive
Content-Type application/json; charset=utf-8
Date Mon, 02 Oct 2017 19:00:16 GMT
Expires Thu, 19 Nov 1981 08:52:00 GMT
Pragma no-cache
Server nginx
Set-Cookie PHPSESSID=js7gfc5llp0ten5436ahsjh3o0; expires=Mon, 02-Oct-2017 20:00:14 GMT; Max-Age=3600; path=/; domain=.my-domain.com; secure; HttpOnly
Transfer-Encoding chunked
X-Powered-By PHP/7.0.23, PleskLin
X-UA-Compatible IE=edge

Accept/Accept-Encodinggzip, deflate, br
Accept-Language fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
Connection keep-alive
Content-Length 482
Content-Type application/json
Cookie mage-translation-storage=%7B%7D; mage-translation-file-version=%7B%7D; __utma=123854227.1859157111.1496161968.1496842312.1496847631.3; __utmz=123854227.1496847631.3.3.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); _ga=GA1.2.1859157111.1496161968; private_content_version=3cd2bf0b4e0c09534d9f803cabc07884; PHPSESSID=js7gfc5llp0ten5436ahsjh3o0; StoreSelector=storeselected; form_key=4ea0chhNjRwll5uC; _gid=GA1.2.1080026318.1506964584; X-Magento-Vary=c1bb9c6672715ebd2df6a482ac3205c192756cf4; mage-cache-storage=%7B%7D; mage-cache-storage-section-invalidation=%7B%7D; mage-cache-sessid=true; section_data_ids=%7B%22directory-data%22%3A1506969329%2C%22customer%22%3A1506969329%2C%22compare-products%22%3A1506969329%2C%22last-ordered-items%22%3A1506969329%2C%22cart%22%3A1506970759%2C%22review%22%3A1506969329%2C%22wishlist%22%3A1506969329%2C%22recently_viewed_product%22%3A1506969329%2C%22recently_compared_product%22%3A1506969329%2C%22product_data_storage%22%3A1506969329%2C%22paypal-billing-agreement%22%3A1506969329%2C%22messages%22%3A1506970808%7D; mage-messages=; recently_viewed_product=%7B%7D; recently_viewed_product_previous=%7B%7D; recently_compared_product=%7B%7D; recently_compared_product_previous=%7B%7D; product_data_storage=%7B%7D
Host my-domain.com
Referer https://my-domain.com/europe/checkout/
User-AgentMozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:56.0) Gecko/20100101 Firefox/56.0
X-Requested-With XMLHttpRequest

POST
cartId"59377d6c473b5306670f6424559b546a"billingAddress{鈥paymentMethod{鈥email"[email protected]"
{"cartId":"59377d6c473b5306670f6424559b546a","billingAddress":{"countryId":"FR","regionId":"257","regionCode":"75","region":"Paris","street":["2 rue d Espagne"],"company":"","telephone":"0622434841","postcode":"75015","city":"Paris","firstname":"David","lastname":"Porre","extension_attributes":{"colissimo_network_code":null,"colissimo_pickup_id":null},"saveInAddressBook":null},"paymentMethod":{"method":"pbxep_cb","additional_data":{"cc_type":"EUROCARD_MASTERCARD"}},"email":"[email protected]"}

RESPONSE
message"Unable to save address. Please check input data."
{"message":"Unable to save address. Please check input data."}


I tried with 2 payment sytems, and 2 shipping methods to be sure it was not coming from them.
I have a custom module handling customer custom attributes, I uninstalled it to check if it could cause the issue.

Hoping for some help here..

Best regards,
David

Format is valid needs update

Most helpful comment

Getting this on a test site, copied magento files and DB to it and this happens when trying to add the product to cart.

Unable to save address. Please check input data. in red text.

Solution: To add items to cart, on Plesk I had to change the include_path for php from .:/usr/share/php to .:/var/www/vhosts/yoursite/httpdocs/vendor/magento/zendframework1/library

All 13 comments

try {
            $address->save();
        } catch (\Exception $e) {
            $this->logger->critical($e);
            throw new InputException(__('Unable to save address. Please check input data.'));
        }

Please provide logged critical message also.

Sorry, but where can I find that please ?

In system.log I found :

2017-10-02 21:25:21] main.CRITICAL: Exception message: Validate class not found from basename 'Magento\Framework\Validator\EmailAddress'
Trace: #0 /var/www/vhosts/my-domain.com/httpdocs/vendor/magento/module-newsletter/Controller/Subscriber/NewAction.php(106): Zend_Validate::is('broe@acuitycxo....', 'Magento\Framewo...')

1 /var/www/vhosts/my-domain.com/httpdocs/vendor/magento/module-newsletter/Controller/Subscriber/NewAction.php(123): Magento\Newsletter\Controller\Subscriber\NewAction->validateEmailFormat('broe@acuitycxo....')

2 /var/www/vhosts/my-domain.com/httpdocs/generated/code/Magento/Newsletter/Controller/Subscriber/NewAction/Interceptor.php(24): Magento\Newsletter\Controller\Subscriber\NewAction->execute()

3 /var/www/vhosts/my-domain.com/httpdocs/vendor/magento/framework/App/Action/Action.php(107): Magento\Newsletter\Controller\Subscriber\NewAction\Interceptor->execute()

4 /var/www/vhosts/my-domain.com/httpdocs/vendor/magento/framework/Interception/Interceptor.php(58): Magento\FrameworkAppActionAction->dispatch(Object(Magento\FrameworkApp\Request\Http))

5 /var/www/vhosts/my-domain.com/httpdocs/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Newsletter\Controller\Subscriber\NewAction\Interceptor->___callParent('dispatch', Array)

6 /var/www/vhosts/my-domain.com/httpdocs/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Newsletter\Controller\Subscriber\NewAction\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\FrameworkApp\Request\Http))

7 /var/www/vhosts/my-domain.com/httpdocs/generated/code/Magento/Newsletter/Controller/Subscriber/NewAction/Interceptor.php(39): Magento\Newsletter\Controller\Subscriber\NewAction\Interceptor->___callPlugins('dispatch', Array, Array)

8 /var/www/vhosts/my-domain.com/httpdocs/vendor/magento/framework/App/FrontController.php(55): Magento\Newsletter\Controller\Subscriber\NewAction\Interceptor->dispatch(Object(Magento\FrameworkApp\Request\Http))

9 /var/www/vhosts/my-domain.com/httpdocs/vendor/magento/framework/Interception/Interceptor.php(58): Magento\FrameworkApp\FrontController->dispatch(Object(Magento\FrameworkApp\Request\Http))

10 /var/www/vhosts/my-domain.com/httpdocs/vendor/magento/framework/Interception/Interceptor.php(138): Magento\FrameworkApp\FrontController\Interceptor->___callParent('dispatch', Array)

11 /var/www/vhosts/my-domain.com/httpdocs/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(94): Magento\FrameworkApp\FrontController\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\FrameworkApp\Request\Http))

12 /var/www/vhosts/my-domain.com/httpdocs/vendor/magento/framework/Interception/Interceptor.php(135): Magento\StoreApp\FrontController\Plugin\RequestPreprocessor->aroundDispatch(Object(Magento\FrameworkApp\FrontController\Interceptor), Object(Closure), Object(Magento\FrameworkApp\Request\Http))

13 /var/www/vhosts/my-domain.com/httpdocs/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(73): Magento\FrameworkApp\FrontController\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\FrameworkApp\Request\Http))

14 /var/www/vhosts/my-domain.com/httpdocs/vendor/magento/framework/Interception/Interceptor.php(135): Magento\PageCache\ModelApp\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\FrameworkApp\FrontController\Interceptor), Object(Closure), Object(Magento\FrameworkApp\Request\Http))

15 /var/www/vhosts/my-domain.com/httpdocs/vendor/magento/framework/Interception/Interceptor.php(153): Magento\FrameworkApp\FrontController\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\FrameworkApp\Request\Http))

16 /var/www/vhosts/hervechapelier.com/httpdocs/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\FrameworkApp\FrontController\Interceptor->___callPlugins('dispatch', Array, NULL)

17 /var/www/vhosts/my-domain.com/httpdocs/vendor/magento/framework/App/Http.php(135): Magento\FrameworkApp\FrontController\Interceptor->dispatch(Object(Magento\FrameworkApp\Request\Http))

18 /var/www/vhosts/my-domain.com/httpdocs/vendor/magento/framework/App/Bootstrap.php(256): Magento\FrameworkApp\Http->launch()

19 /var/www/vhosts/my-domain.com/httpdocs/index.php(39): Magento\FrameworkApp\Bootstrap->run(Object(Magento\FrameworkApp\Http))

20 {main} [] []

On a new try, exception.log just threw me :

[2017-10-02 21:51:37] main.CRITICAL: Validate class not found from basename 'Magento\Framework\Validator\EmailAddress' {"exception":"[object] (Zend_Validate_Exception(code: 0): Validate class not found from basename 'Magento\Framework\Validator\EmailAddress' at /var/www/vhosts/my-domain.com/httpdocs/vendor/magento/zendframework1/library/Zend/Validate.php:244)"} []

I have the same issue, and I can't save email addresses for the store as well from the backend.

The same issue is reported earlyer: #10821
https://github.com/magento/magento2/issues/10821

Best regards
脴rjan

Same issue... How to solve?

@ShapesGraphicStudio
This ticket seems to be a duplicate of #10821. We will continue investigation and conversation there.

I am having the same issue is there any fixed even your duplicate #10821 doesn't have any . It says include_path = "." but that doesnt fix it either..

It's a bug with magento email address validation, need a patch from magento. See this forum https://github.com/magento/magento2/issues/8544

I don't think this is a bug It is misconfiguration at least in my case.
I have 3 website setup:
I've got the same issue and found out that currency rates where not set up
Once I've added it the currency rates the problem was solved! 馃憤

Getting this on a test site, copied magento files and DB to it and this happens when trying to add the product to cart.

Unable to save address. Please check input data. in red text.

Solution: To add items to cart, on Plesk I had to change the include_path for php from .:/usr/share/php to .:/var/www/vhosts/yoursite/httpdocs/vendor/magento/zendframework1/library

I solved this problem using .htaccess just add this following
php_value include_path "."

http://prntscr.com/k6lo2q

I don't think this is a bug It is misconfiguration at least in my case.
I have 3 website setup:
I've got the same issue and found out that currency rates where not set up
Once I've added it the currency rates the problem was solved!

Yea I have the same issue, I just checked the log file and get to know this is currency rate issue, thanks!

In my case open_basedir was the problem.

Was this page helpful?
0 / 5 - 0 ratings