Skip to content

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

@hostep

Description

@hostep

Preconditions and environment

  • Magento version: any

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

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions