2

I recently upgraded from 2.2.3 to 2.2.8 then to 2.3 and onto 2.3.3 and I've come across a strange error. When an order is being created, I get the following error:

Failed address validation: Email has a wrong format

I've searched stack exchange and Magento forums and I cannot seem to find out why this is happening. In the logs, it shows a valid Paypal email address.

Any help would be appreciated.

The full error is:

main.CRITICAL: Exception message: Failed address validation:
Email has a wrong format
Trace: <pre>#1 Magento\Quote\Model\QuoteManagement->submitQuote() called at [vendor/magento/module-quote/Model/QuoteManagement.php:447]
#2 Magento\Quote\Model\QuoteManagement->submit() called at [generated/code/Magento/Quote/Model/QuoteManagement/Interceptor.php:89]
#3 Magento\Quote\Model\QuoteManagement\Interceptor->submit() called at [vendor/magento/module-paypal/Model/Express/Checkout.php:807]
#4 Magento\Paypal\Model\Express\Checkout->place() called at [vendor/magento/module-paypal/Controller/Express/AbstractExpress/PlaceOrder.php:98]
#5 Magento\Paypal\Controller\Express\AbstractExpress\PlaceOrder->execute() called at [vendor/magento/framework/App/Action/Action.php:108]
#6 Magento\Framework\App\Action\Action->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#7 Magento\Paypal\Controller\Express\PlaceOrder\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#8 Magento\Paypal\Controller\Express\PlaceOrder\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#9 Magento\Paypal\Controller\Express\PlaceOrder\Interceptor->___callPlugins() called at [generated/code/Magento/Paypal/Controller/Express/PlaceOrder/Interceptor.php:26]
#10 Magento\Paypal\Controller\Express\PlaceOrder\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:159]
#11 Magento\Framework\App\FrontController->processRequest() called at [vendor/magento/framework/App/FrontController.php:99]
#12 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#13 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#14 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php:94]
#15 Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#16 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php:73]
#17 Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#18 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#19 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:26]
#20 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:137]
#21 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:24]
#22 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:261]
#23 Magento\Framework\App\Bootstrap->run() called at [index.php:39]
</pre> [] []
  • do you have access to db? – Shyam Krishna Sreekumar Nov 12 '19 at 10:46
  • Yes, I have access to the database. – Paul Donnelly Nov 13 '19 at 11:48
  • I would suggest, try to disable your custom module and theme. – Nits Nov 13 '19 at 13:17
  • I've disabled all modules and custom theme. It's still the same unfortunately. It seems to be a core issue but not seeing much relating to this bug. – Paul Donnelly Nov 19 '19 at 12:09
1

You can check below vendor file

vendor/magento/module-sales/Model/Order/Address/Validator.php

Here in validate() function there is Email Validation that returns this error, if email is not valid.

if (!filter_var($address->getEmail(), FILTER_VALIDATE_EMAIL)) {
    $warnings[] = 'Email has a wrong format';
}

In Magento 2.3.3 we need PHP 7+ version. So in PHP 7.1 some validation filter rules for email You can check that here

Hope this information helpful to you!

| improve this answer | |
1

The issue is something related to Magento 2.3.3 bug and its now fixed on develop branch. Refer to the issues on github:

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

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

And this is the pull request from develop branch:

https://github.com/magento/magento2/pull/24906/files#diff-dfb3ee5a7f863458afea75f5524cd2e5R398

Hope this helps!

| improve this answer | |
  • The issue is with creating an order rather then sending an email. It could be related but from scanning the issues above, i dont see anything with Email has a wrong format mentioned. – Paul Donnelly Nov 19 '19 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.