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

When VAT number validation fails by the VIES service, there is no trace about the exception message in the log files #36065

Closed hostep closed 1 year ago

hostep commented 2 years ago

Preconditions and environment

Steps to reproduce

Look at the code over here: https://github.com/magento/magento2/blob/2.4.5/app/code/Magento/Customer/Model/Vat.php#L214-L218

  1. In the code over here, change the url to https://example.com/taxation_customs/vies/checkVatService.wsdl so we can simulate an unexpected error
  2. In the Magento back office, go to Stores > Configuration > General > General > Store Information
  3. For the Country field, pick an EU country (like France)
  4. For the VAT Number field, enter something random, like 012345
  5. Press the Validate VAT Number button
  6. Inspect the var/log/exception.log file or system.log file

Expected result

  1. Expect that the exception message is logged somewhere, so that when an exception is occurring, it's easy to find the details in a log file

Actual result

  1. No exception message is being logged

Additional information

We had a certain shop, where the VAT number validation kept on failing and there was no trace about why it happened, when we tried debugging on our local environment, no issue was found, it only happened on the staging server.

After some debugging directly on the staging server, we figured out that an exception was being thrown by that SoapClient and it was being catched, but not logged:

javax.xml.rpc.soap.SOAPFaultException: IP_BLOCKED [] []

If we would have seen this in some log file, it would have been easier to figure out exactly why the vat number validation failed in our case.

Release note

Exceptions thrown by the VIES VAT validation service are now being logged in the var/log/exception.log file so it becomes easier to figure out what goes wrong when the validation doesn't work.

Triage and priority

m2-assistant[bot] commented 2 years ago

Hi @hostep. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] commented 1 year ago

Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-November commented 1 year ago

Verified the issue on Magento 2.4-develop instance and the issue is reproducible. Hence updating the description with Manual steps to reproduce and confirming the issue. image No error/exception is being logged in the log files.

github-jira-sync-bot commented 1 year ago

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-6906 is successfully created for this GitHub issue.

m2-assistant[bot] commented 1 year ago

:white_check_mark: Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

hostep commented 1 year ago

Thanks for confirming @engcom-November, note that there is already a PR open to fix this: https://github.com/magento/magento2/pull/36067

ihor-sviziev commented 1 year ago

The fix for this issue was delivered to 2.4-develop branch in https://github.com/magento/magento2/commit/50b303edae8c26ceb24fc23dcb42b1ed2feb1b76 (changes from https://github.com/magento/magento2/pull/36067) I'm closing this issue.