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

Undefined offset: error at [stage: data migration][step: EAV Step] for Migration from Magento 1.7.0.2 to Magento 2.3.5 #816

Open
skthewebmaster opened this issue May 23, 2020 · 6 comments

Comments

@skthewebmaster
Copy link

Preconditions

  1. Magento 1.7.0.2 to Magento 2.3.5.p1
  2. PHP 7.2.28

Steps to reproduce

  1. In source database, that is Magento 1.7.0.2, select any attribute_id from "catalog_eav_attribute" table
  2. Now remove row of same attribute_id from table "eav_attribute"
  3. Execute data migration command

php bin/magento migrate:data -r -a vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.7.0.2/config.xml
or
php bin/magento migrate:data -a vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.7.0.2/config.xml

Expected result

Actual result

  1. [Screenshot, logs]

Notice: Undefined offset: 144 in /vendor/magento/data-migration-tool/src/Migration/Step/Eav/Data.php on line 561

Additional notes

I also executed a query

SET SQL_SAFE_UPDATES = 0;
DELETE FROM catalog_eav_attribute WHERE attribute_id NOT IN (SELECT attribute_id FROM eav_attribute);
DELETE FROM eav_entity_attribute WHERE attribute_id NOT IN (SELECT attribute_id FROM eav_attribute);
SET SQL_SAFE_UPDATES = 1;

which was given at
#599
and execute data migration command
but then after I am getting another error

syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')) ORDER BY entity_attribute_id ASC
LIMIT 160' at line 1, query was: SELECT eav_entity_attribute.* FROM eav_entity_attribute WHERE (entity_attribute_id >= 0) AND (attribute_id IN ()) ORDER BY entity_attribute_id ASC
LIMIT 160

Attached screenshots for both error.
eav_error
eav_error2

@m2-assistant
Copy link

m2-assistant bot commented May 23, 2020

Hi @skthewebmaster. Thank you for your report.
To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


@KZNcode
Copy link

KZNcode commented May 25, 2020

SEE: ##813

(Restore the database backup you made BEFORE running the data-migration-tool... Using "--reset" or "-r" won't work... You gotta restore the backup each time it fails with this latest version)

cd vendor/magento/

mv data-migration-tool data-migration-tool-bak

git clone https://github.com/magento/data-migration-tool.git

Now copy over your config.xml from the bak to this latest install, and try running the tool again.

@victor-v-rad
Copy link
Collaborator

@skthewebmaster please also take a look at similar error in #813 and fix

@skthewebmaster
Copy link
Author

skthewebmaster commented May 26, 2020

Hi @KZNcode and @victor-v-rad

Thanks for sharing this link.
I made changes to src/Migration/Step/Eav/Data.php as mentioned in ea9cc9f and it worked.

Database migrated and products, orders etc. shows in list but when I try to edit product it gives 500 error.

@ChameleonDevil
Copy link

@skthewebmaster

The referred issue #813 was the starting point of many other issues for many - completely unrelated to that because just getting a successful import took several restarts.

Refer to my last comment I added there today for migration resets, and possibly some more ideas.

Unfortunately I cannot assist with error 500, for me I got these errors SOMETHING WENT WRONG in almost all admin pages.

In my case it was related to the modules Temando, Paypal, and Authorizenet. I cannot remember which one, but as soon as I disabled all those modules, and their related modules, the SOMETHING WENT WRONG error was gone. I was never able to save anything in the backend before doing this.

This might be completely unrelated to your issue; but you can try.

@skthewebmaster
Copy link
Author

Hi,

The error 500 was coming from 3 attributes entry in "eav_attribute" database table.

  1. "preorder",
  2. "preorderdescript"
  3. "status_preorder".

I deleted this entries and now I can edit product.

I have also noticed that database from magento 1.7 version has "manufacturer" attribute exist and new magento 2.3.5 also has this attribute "manufacturer" exist in "eav_attribute" database table with same attribute_id but after migration "catalog_product_index_eav" database table has 0 rows in new 2.3.5 database whereas old 1.7.0.2 database has 4656 rows. So this records not migrated.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants