Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vertex: Magento 2.3.3. - Error on Store -> Sales -> Tax #25403

Closed
MrAmbro opened this issue Oct 31, 2019 · 14 comments
Closed

Vertex: Magento 2.3.3. - Error on Store -> Sales -> Tax #25403

MrAmbro opened this issue Oct 31, 2019 · 14 comments
Labels
Component: Bundled Extension Issue is caused by one of the bundled extensions Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Progress: needs update

Comments

@MrAmbro
Copy link

MrAmbro commented Oct 31, 2019

I have a problem with my magento 2.3.3. installation. When i try to access the Store -> Sales -> Tax I receive this error:

Fatal error: Uncaught TypeError: Argument 1 passed to Vertex\Tax\Model\FlexField\FlexFieldProcessableAttribute::setLabel() must be of the type string, null given, called in /home/shopmon0/public_html/vendor/vertex/module-tax/Model/FlexField/Extractor/EavAttributeExtractor.php on line 122 and defined in /home/shopmon0/public_html/vendor/vertex/module-tax/Model/FlexField/FlexFieldProcessableAttribute.php:112 Stack trace: #0 /home/shopmon0/public_html/vendor/vertex/module-tax/Model/FlexField/Extractor/EavAttributeExtractor.php(122): Vertex\Tax\Model\FlexField\FlexFieldProcessableAttribute->setLabel(NULL) #1 /home/shopmon0/public_html/vendor/vertex/module-tax/Model/FlexField/Processor/CustomerGetterProcessor.php(142): Vertex\Tax\Model\FlexField\Extractor\EavAttributeExtractor->extract('customer', 'customer.custom', 'Customer', 'Vertex\Tax\Mode...', Array) #2 /home/shopmon0/public_html/vendor/vertex/module-tax/Model/FlexField/Processor/FlexFieldAttributeProcessor.php(68): Vertex\Tax\Model\FlexField\Processor\CustomerGetterPr in /home/shopmon0/public_html/vendor/vertex/module-tax/Model/FlexField/FlexFieldProcessableAttribute.php on line 112

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Oct 31, 2019
@shikhamis11 shikhamis11 self-assigned this Oct 31, 2019
@m2-assistant
Copy link

m2-assistant bot commented Oct 31, 2019

Hi @shikhamis11. 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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@magento-engcom-team magento-engcom-team added Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed and removed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed labels Oct 31, 2019
@MrAmbro MrAmbro changed the title Error on Store -> Sales -> Tax Vertex: Magento 2.3.3. - Error on Store -> Sales -> Tax Oct 31, 2019
@sdzhepa sdzhepa added the Component: Bundled Extension Issue is caused by one of the bundled extensions label Oct 31, 2019
@Orims14
Copy link

Orims14 commented Nov 1, 2019

Is there a patch for this? Having the same exact issue.

Thank You

@sdzhepa
Copy link
Contributor

sdzhepa commented Nov 1, 2019

Hello @MrAmbro

We cannot reproduce this issue using the provided steps in the description.
Verified next case:

  1. Get latest Magento 2 code from composer
php -v
PHP 7.2.18

$ composer create-project --repository=https://repo.magento.com/ magento/project-community-edition .
Installing magento/project-community-edition (2.3.3)

 ...
- Installing vertex/sdk (1.2.0): Loading from cache
- Installing vertex/module-tax (3.2.0): Loading from cache
- Installing vertex/product-magento-module (3.2.0)
 ...

  1. Install Magento
  2. "Sign in" to the Admin panel
  3. Go to STORES > Taxes > Tax Rules
  4. Create any new test Tax Rule and save
  5. Go to STORES > Taxes > Tax Zones and Rates
  6. Create any new test New Tax Rate and save
  7. Go to STORES > Settings > Configuration
  8. Open SALES > Tax
  9. Open Vertex Settings
  10. Enable it, fill some test data and click "Save Config" button
  11. Sign Out and Sign In again

Actual result:
-- No fatal errors on pages
-- No errors in log files
-- tested also in developer mode - no errors

@shikhamis11 are you able to reproduce it?

@sdzhepa sdzhepa added Progress: needs update Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch labels Nov 1, 2019
@shikhamis11
Copy link
Member

hi @sdzhepa
yes I checked both scenario you shared I am also not able to reproduce it.
@MrAmbro can you please recheck the steps required to reproduce the issue also please check and share if it requires some additional informations to reproduce this issue

@Orims14
Copy link

Orims14 commented Nov 3, 2019

if it helps I experienced it on 2.3.3 Commerce and i had migrated taxes from Magento 1 to Magento 2 using the data migration tool.

@mmmattera
Copy link

mmmattera commented Nov 4, 2019

I have this problem in 2.3.3 opensource. I also migrated from magento 1 1.9.3.10.

As the error message states the data retrieved by /.../vendor/vertex/module-tax/Model/FlexField/Extractor/EavAttributeExtractor.php line 122
$attribute->setLabel($eavAttribute->getDefaultFrontendLabel());

is not a string. parameter validation? anyone, anyone...
I debugged this with changing the line to:$attribute->setLabel(strval($eavAttribute->getDefaultFrontendLabel()));
and printing each attributes with:
file_put_contents("/home/.../public_html/dump.txt", "\nXXXX\n", FILE_APPEND );
file_put_contents("/home/.../public_html/dump.txt", "Y" . strval($eavAttribute->getDefaultFrontendLabel())."Z", FILE_APPEND );
file_put_contents("/home/.../public_html/dump.txt", "A" . strval($eavAttribute->getAttributeCode())."B", FILE_APPEND );

#a quick command to force the file to rerun:
rm -R var/cache/* var/page_cache/* var/di/* var/generation/* var/view_preprocessed/* pub/static/*
and we have the results and it shows an empty attribute:
....
YHS CodeZAts_hs_codeB
XXXX
YCountry of OriginZAts_country_of_originB
XXXX
YFrom ShoppingFluxZAfrom_shoppingfluxB
XXXX
YPassword created atZApassword_created_atB
XXXX
YZArp_customer_idB <----- null value for rp_customer_id

A quick search finds these attributes in eav_attribute ( I hate that table and I've only been working on m2 for less than a month)

I used phpadmin to add text frontend labels to all entries just in case an upgrade has the same code.

@sdzhepa
Copy link
Contributor

sdzhepa commented Nov 7, 2019

Hello @MrAmbro and @mmmattera

We have notified the vendor owner of Vertex about this report.
As I know they are working on it now.
Internal Jira ticket to track progress for this issue has been created BUNDLE-2311

We will provide updates as soon as we have it

@itzB3rnD
Copy link

itzB3rnD commented Nov 8, 2019

I can confirm the issue, as we also have migrated tax in our database. We migrated from 1.8.1.0

@BenItt
Copy link

BenItt commented Nov 18, 2019

Hi there,

we were facing the exact same error.

We worked around this by disabling the Vertex module (which we anyhow do not use)

php bin/magento module:disable -c Vertex_Tax
php bin/magento setup:upgrade

Maybe it helps you guys as well. After disabling the module all works fine again.

Best regards

@navarr
Copy link
Member

navarr commented Nov 21, 2019

This patch is not yet tested, but should resolve the issue:

Index: vendor/vertex/module-tax/Model/FlexField/Extractor/EavAttributeExtractor.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- vendor/vertex/module-tax/Model/FlexField/Extractor/EavAttributeExtractor.php	(revision 21bce02860fb6a0661f434dc38527664aaa7dded)
+++ vendor/vertex/module-tax/Model/FlexField/Extractor/EavAttributeExtractor.php	(date 1574367021765)
@@ -119,7 +119,7 @@
             $attribute = $this->attributeFactory->create();
             $attributeCode = $prefix . '.' . $eavAttribute->getAttributeCode();
             $attribute->setAttributeCode($attributeCode);
-            $attribute->setLabel($eavAttribute->getDefaultFrontendLabel());
+            $attribute->setLabel($eavAttribute->getDefaultFrontendLabel() ?: $eavAttribute->getAttributeCode());
             $attribute->setOptionGroup(__($optionGroup)->render());
             $attribute->setType($type);
             $attribute->setProcessor($processor);

If anyone using Vertex as their calculation engine needs a fix. Disabling the module also works well if you are not using Vertex as your calculation engine.

A fully tested and proper fix should be included with Magento 2.3.4

@navarr
Copy link
Member

navarr commented Dec 9, 2019

This issue is fixed in Vertex 3.3.0 included in Magento 2.3.4

@sheshagiriAnvekar
Copy link

sheshagiriAnvekar commented Jan 29, 2020

This issue fixed in Magento 2.3.4.

@MikeVelazcoMtz
Copy link

I still see this logs on Magento 2.4..3.

@navarr
Copy link
Member

navarr commented Aug 30, 2021

@MikeVelazcoMtz To confirm, you're unable to load the tax configuration page and see the vertex error in your log?

Can you please copy/paste the error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Bundled Extension Issue is caused by one of the bundled extensions Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Progress: needs update
Projects
None yet
Development

No branches or pull requests