I have had the same issue and here's what I figured out
ON AN "ERROR" DURING THE EAV STAGE, WHEN THE SYSTEM SAYS "REVERTING" IT DOES NOT REVERT THE ATTRIBUTE_SET AND ATTRIBUTE_GROUP DATA FULLY, AND SO WHEN RUN AGAIN THERE WILL BE ERRORS OVER AND OVER.
The attribute sets and attribute groups are also not reverted properly if you use --reset
m2's eav_attribute_set table ends up containing the "migration_" entries after the undefined offset error or any other error during a further substep of the eav process, hence causing the "duplicate" error next time
m2's eav_attribute_set table ends up completely empty after the Duplicate entry, hence causing the "undefined offset" next time
The tool itself is creating the situation for this error, and an endless loop of it!
I have managed to pass through by MANUALLY rebuilding the
eav_attribute_group tables in the database to have only the original entries (but with the IDs from after my first migration)
But if I then get another error in the EAV step (eg: class name reference from a module I am not planning to migrate) then this error is back on the next run so I have to do that manual clean up over and over.
And because especially on the EAV stage things are a trial and error process (what classes, fields etc does the system flag up? decide whether to migrate or ignore, rinse, repeat) this is very very frustrating.
It also means people are sidetracked by this error which has nothing to do with our data or site!
The "cleanup": In my case I have 13 attribute sets, so 14 is my ID to recreate the sets. m2_ is my prefix, adapt for yours.
INSERT INTO `m2_eav_attribute_set` (`attribute_set_id`, `entity_type_id`, `attribute_set_name`, `sort_order`) VALUES
(14, 1, 'Default', 2),
(15, 2, 'Default', 2),
(16, 3, 'Default', 1),
(17, 4, 'Default', 1),
(18, 5, 'Default', 1),
(19, 6, 'Default', 1),
(20, 7, 'Default', 1),
(21, 8, 'Default', 1);
Similarly, delete from
eav_attribute_group all entries referring to attribute set id <14
And yes, I have to do this each time until I have figured out all the configuration changes necessary in the eav stage.