magento / magento/data-migration-tool

Return value of Migration\ResourceModel\AbstractCollection::key() must be an instance of Migration\ResourceModel\mixed, int returned

Open
#902 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
339
Forks
195
PR merge metrics
No merged PRs in 30d

Description

### Preconditions

1. Magento 1.9.3.10 to Magento 2.4.5
2. PHP 7.4 & MySQL 8.0.30 - Ubuntu 22.04.1
3. FRESH Magento 2 install

### Steps to reproduce

1. Run - composer require magento/data-migration-tool:~2.4.5
2. Create and configure a Migration module in app/code/Vendor/Migration following steps in official docs
4. Check data integrity and add ignores for tables and fields that are flagged as problematic i.e. 3rd party extensions
5. Run - php bin/magento migrate:settings --reset app/code/Vendor/Migration/etc/opensource-to-opensource/1.9.3.10/config.xml

### Expected result
[2022-09-08T11:15:47.605990+00:00][INFO][mode: settings][stage: integrity check][step: Settings Step]: started
100% [============================] Remaining Time: < 1 sec
[2022-09-08T11:15:47.632163+00:00][INFO][mode: settings][stage: integrity check][step: Stores Step]: started
100% [============================] Remaining Time: < 1 sec
[2022-09-08T11:15:47.652288+00:00][INFO][mode: settings][stage: data migration][step: Settings Step]: started
100% [============================] Remaining Time: < 1 sec
[2022-09-08T11:15:49.870886+00:00][INFO][mode: settings][stage: data migration][step: Stores Step]: started
100% [>---------------------------] Remaining Time: < 1 sec

### Actual result
[2022-09-08T11:15:47.605990+00:00][INFO][mode: settings][stage: integrity check][step: Settings Step]: started
100% [============================] Remaining Time: < 1 sec
[2022-09-08T11:15:47.632163+00:00][INFO][mode: settings][stage: integrity check][step: Stores Step]: started
100% [============================] Remaining Time: < 1 sec
[2022-09-08T11:15:47.652288+00:00][INFO][mode: settings][stage: data migration][step: Settings Step]: started
100% [============================] Remaining Time: < 1 sec
[2022-09-08T11:15:49.870886+00:00][INFO][mode: settings][stage: data migration][step: Stores Step]: started
0% [>---------------------------] Remaining Time: < 1 secReturn value of Migration\ResourceModel\AbstractCollection::key() must be an instance of Migration\ResourceModel\mixed, int returned#0 /var/www/html/magento2/vendor/magento/data-migration-tool/src/Migration/ResourceModel/AbstractCollection.php(69): Migration\ResourceModel\AbstractCollection->key()
#1 /var/www/html/magento2/vendor/magento/data-migration-tool/src/Migration/ResourceModel/Destination.php(38): Migration\ResourceModel\AbstractCollection->valid()
#2 /var/www/html/magento2/vendor/magento/data-migration-tool/src/Migration/Step/Stores/Data.php(118): Migration\ResourceModel\Destination->saveRecords()
#3 /var/www/html/magento2/vendor/magento/data-migration-tool/src/Migration/Mode/AbstractMode.php(82): Migration\Step\Stores\Data->perform()
#4 /var/www/html/magento2/vendor/magento/data-migration-tool/src/Migration/Mode/Settings.php(100): Migration\Mode\AbstractMode->runStage()
#5 /var/www/html/magento2/vendor/magento/data-migration-tool/src/Migration/Mode/Settings.php(58): Migration\Mode\Settings->runData()
#6 /var/www/html/magento2/vendor/magento/data-migration-tool/src/Migration/Console/MigrateSettingsCommand.php(59): Migration\Mode\Settings->run()
#7 /var/www/html/magento2/vendor/symfony/console/Command/Command.php(255): Migration\Console\MigrateSettingsCommand->execute()
#8 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(58): Symfony\Component\Console\Command\Command->run()
#9 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(138): Migration\Console\MigrateSettingsCommand\Interceptor->___callParent()
#10 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(153): Migration\Console\MigrateSettingsCommand\Interceptor->Magento\Framework\Interception\{closure}()
#11 /var/www/html/magento2/generated/code/Migration/Console/MigrateSettingsCommand/Interceptor.php(77): Migration\Console\MigrateSettingsCommand\Interceptor->___callPlugins()
#12 /var/www/html/magento2/vendor/symfony/console/Application.php(1009): Migration\Console\MigrateSettingsCommand\Interceptor->run()
#13 /var/www/html/magento2/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#14 /var/www/html/magento2/vendor/magento/framework/Console/Cli.php(116): Symfony\Component\Console\Application->doRun()
#15 /var/www/html/magento2/vendor/symfony/console/Application.php(149): Magento\Framework\Console\Cli->doRun()
#16 /var/www/html/magento2/bin/magento(23): Symfony\Component\Console\Application->run()
#17 {main}

### Additional notes
The error: Return value of Migration\ResourceModel\AbstractCollection::key() must be an instance of Migration\ResourceModel\mixed, int returned

I have not been able to find anything related to this error. Is there a compatibility issue with 2.4.5?

Please advise.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the reported `migrate:settings --reset` command and trace the failure through `src/Migration/ResourceModel/AbstractCollection.php`, `Destination.php`, and `Step/Stores/Data.php`. Check how `key()` is used by `valid()` and confirm the migration completes without the return-type error; use the stack trace as the initial test path.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.