Error: Call to undefined method League\Csv\Reader::setHeaderOffset()
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3060172. -->
Reported by: [khalimero](https://www.drupal.org/user/3516687)
>>>
<p>Hi all,</p>
<p>I used migrate_csv to populate my drupal site with French cities characteristics, forcing the nid value to fit some specific needs, ensuring unicity with some simple rules. It worked well and I even used it several times to update some values, using the NID value. I did it about one year ago.</p>
<p>Yesterday, as I wanted to update again some values, using the same CSV frame and the same migration, drush throwed a first error :</p>
<pre>In CSV.php line 105:<br>You must declare "ids" as a unique array of fields in your source settings.</pre><p>I saw on internet that some examples differed from the reference page of the migration_csv package, using "ids" keyword rather than (that's what I inferred but I may be wrong) the "keys" one.</p>
<p>I replaced the keyword, and then went into a new error :<br>
<code> [error] Error: Call to undefined method League\Csv\Reader::setHeaderOffset() in Drupal\migrate_source_csv\Plugin\migrate\source\CSV->getReader() (line 251 of /var/www/bremond/prod/web/modules/contrib/migrate_source_csv/src/Plugin/migrate/source/CSV.php) #0 /var/www/bremond/prod/web/modules/contrib/migrate_source_csv/src/Plugin/migrate/source/CSV.php(182): Drupal\migrate_source_csv\Plugin\migrate\source\CSV->getReader()</code></p>
<p>I found that it may come from a problem between drupal/csv_serialization and league/csv versions but I wasn't able to solve it. Here is the composer error when I try to update league/csv package :</p>
<pre>Using version ^9.2 for league/csv<br>./composer.json has been updated<br>> DrupalProject\composer\ScriptHandler::checkComposerVersion<br>Loading composer repositories with package information<br>Updating dependencies (including require-dev)<br>Your requirements could not be resolved to an installable set of packages.<br><br> Problem 1<br> - Installation request for league/csv ^9.2 -> satisfiable by league/csv[9.2.0, 9.x-dev].<br> - drupal/csv_serialization 1.4.0 requires league/csv ^8.0 -> satisfiable by league/csv[8.x-dev].<br> - drupal/csv_serialization 1.4.0 requires league/csv ^8.0 -> satisfiable by league/csv[8.x-dev].<br> - drupal/csv_serialization 1.4.0 requires league/csv ^8.0 -> satisfiable by league/csv[8.x-dev].<br> - Conclusion: don't install league/csv 8.x-dev<br> - Installation request for drupal/csv_serialization (locked at 1.4.0, required as ^1.4) -> satisfiable by drupal/csv_serialization[1.4.0].<br><br>Installation failed, reverting ./composer.json to its original content.</pre><p>You will find enclosed:</p>
<ul>
<li>the full error flow</li>
<li>the csv file (renamed with txt extension for upload restrictions reasons)</li>
<li>the yml migration file</li>
</ul>
<p>Any help will be greatly appreciated.</p>
<p>Many thanks.</p>
<p>Remi.</p>
issue