When i try to install "Migrate Source CSV" module csv path not found error coming?

You must declare the “path” to the source CSV file in your source settings

InvalidArgumentException: You must declare the “path” to the source CSV file in your source settings. in Drupal\migrate_source_csv\Plugin\migrate\source\CSV->__construct() (line 108 of modules/migrate_source_csv/src/Plugin/migrate/source/CSV.php).

Drupal\migrate_source_csv\Plugin\migrate\source\CSV->__construct() (Line: 45) Drupal\farm_import_csv\Plugin\migrate\source\CSVFile->__construct() (Line: 60) Drupal\farm_import_csv\Plugin\migrate\source\CSVFile::create() (Line: 57) Drupal\migrate\Plugin\MigratePluginManager->createInstance() (Line: 392) Drupal\migrate\Plugin\Migration->getSourcePlugin() (Line: 734) forum_migration_plugins_alter() (Line: 545) Drupal\Core\Extension\ModuleHandler->alter() (Line: 372) Drupal\Core\Plugin\DefaultPluginManager->alterDefinitions() (Line: 259) Drupal\migrate\Plugin\MigrationPluginManager->findDefinitions() (Line: 205) Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() (Line: 48) Drupal\farm_import_csv\Plugin\Derivative\CsvImportMenuLink->getDerivativeDefinitions() (Line: 101) Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives() (Line: 87) Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() (Line: 125) Drupal\Core\Menu\MenuLinkManager->getDefinitions() (Line: 150) Drupal\Core\Menu\MenuLinkManager->rebuild() (Line: 82) admin_toolbar_tools_entity_update() call_user_func_array() (Line: 409) Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension{closure}() (Line: 388) Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 416) Drupal\Core\Extension\ModuleHandler->invokeAll() (Line: 343) Drupal\Core\Config\Entity\ConfigEntityStorage->invokeHook() (Line: 564) Drupal\Core\Entity\EntityStorageBase->doPostSave() (Line: 489) Drupal\Core\Entity\EntityStorageBase->save() (Line: 257) Drupal\Core\Config\Entity\ConfigEntityStorage->save() (Line: 352) Drupal\Core\Entity\EntityBase->save() (Line: 609) Drupal\Core\Config\Entity\ConfigEntityBase->save() (Line: 174) Drupal\config_update\ConfigReverter->revert() (Line: 125) Drupal\farm_update\FarmUpdate->rebuild() (Line: 12) farm_update_rebuild() call_user_func_array() (Line: 409) Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension{closure}() (Line: 388) Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 416) Drupal\Core\Extension\ModuleHandler->invokeAll() (Line: 477) drupal_flush_all_caches() (Line: 362) Drupal\system\Controller\DbUpdateController->selection() (Line: 173) Drupal\system\Controller\DbUpdateController->handle() call_user_func_array() (Line: 115) Drupal\Core\Update\UpdateKernel->handleRaw() (Line: 76) Drupal\Core\Update\UpdateKernel->handle() (Line: 27)

Response from chatGPT:

In Drupal, to declare the path to a source CSV file in your source settings, you typically need to use a module like Migrate Source CSV. This module allows you to migrate data from a CSV file into Drupal entities.

Here's a general guide on how to do this:

    Install Migrate Source CSV Module: Firstly, ensure that the Migrate Source CSV module is installed and enabled on your Drupal site. You can download and install it from Drupal.org or by using Composer.

    Define a Migration: Create a migration definition using YAML files. This involves defining the source, destination, field mappings, and other relevant settings.

    Declare CSV File Path: In your migration definition YAML file, you'll specify the path to your CSV file under the source settings. Here's an example of how you might do this:


    id: custom_csv_migration
    label: 'Custom CSV Migration'
      plugin: csv
      path: 'public://path/to/your/file.csv'
      delimiter: ','
      enclosure: '"'
      header_row_count: 1
      plugin: entity:node
      default_bundle: article
      # Field mappings go here

    In the path key, provide the file path to your CSV file. You can use Drupal's stream wrappers like public:// to specify the path relative to your site's files directory.

    Configure Field Mappings: After specifying the source CSV file, you'll need to configure the field mappings to map the CSV columns to Drupal entity fields.

    Run Migration: Once you've defined your migration, you can run it using Drush or through the Drupal administrative interface.

Remember to replace 'path/to/your/file.csv' with the actual path to your CSV file. Make sure the file is accessible and readable by the Drupal installation.

By following these steps, you can declare the path to the source CSV file in your Drupal source settings and migrate data from the CSV into your Drupal site.

but, custom_module not defined in default. Then i added csv path in “modules/migrate_source_csv/src/Plugin/migrate/source/CSV.php” file in default configuration function like below ‘public://migration/file.csv’.

public function defaultConfiguration() {
    return [
      'path' => 'public://migration/file.csv', 
      'ids' => [],
      'header_offset' => 0,
      'fields' => [],
      'delimiter' => ",",
      'enclosure' => "\"",
      'escape' => "\\",
      'create_record_number' => FALSE,
      'record_number_field' => 'record_number',

then i run drush cache-rebuild cmd . this is resolved now.

@aathi179 Is this on a “default” farmOS installation or have you made any modifications to it? Please provide a numbered list of steps that I can take to reproduce this issue on a fresh default farmOS installation and I will figure out if it’s a bug that we need to fix.


No sir, still i didn’t touch any code. FarmOS i was installed by composer command like below step.
step1: composer create-project --no-install farmos/project:3.x-dev farmos -vvv

srep2: cd farmos & composer install --no-dev -vvv

step3: added public and private file location to default/settings.php

step4: Added /farmos/web as virtualhost in appache && made all of folder owner to www-data
chown -R www-data farmos

step5: hit url from browse : https://mydomain/core/install.php

step6: added db & sit root pwd. it’s installed

step7: still geophp warning and Transaction isolation level error in data_stream_basic

this are step followed for initial installation. after, i was added smtp,farmos notification, plan and other modules from configuration->extend menu.

@aathi179 I’m confused. The title of this forum topic is “When i try to run /update.php csv path not found error coming?” but you did not mention “update.php” or “csv path” in your previous comment.

sorry. the “csv” path found error happened today only. i was installed farmOS on 27 th Feb. Today first i was installed module forum, history , comment and Migrate Source CSV module. then i was hit mydomain/update.php from browser that time error happend.

if error come again i will mention here. else, In my free time i shall try to reproduce this error. Thank you.

@aathi179 The forum, history, and comment modules are Drupal core modules and are not officially supported by farmOS.

Sorry if this is a bit confusing to a new user. I will try to explain:

farmOS is a “distribution” of Drupal: https://www.drupal.org/docs/getting-started/drupal-distributions

This means that farmOS is a pre-configured set of modules and settings on top of the Drupal framework/platform. farmOS comes with a set of “farmOS core modules” that we support. Drupal itself comes with a bunch of other modules that are for building websites/applications more generally, which we do NOT necessarily support in the farmOS context.

farmOS provides it’s own “Modules” form at /setup/modules, which shows farmOS core modules. This is different from Drupal’s /admin/modules page, which shows ALL modules.

So I would recommend only enabling modules that are in /setup/modules if you are just getting started.

If you are an experienced Drupal developer who wants to push the limits of farmOS by experimenting with unsupported Drupal modules, you can enable them in /admin/modules, but the farmOS community cannot provide support for these. We have to focus on the modules that we officially support.

Hope that all makes sense, and hopefully this will make your life easier now that you know what to avoid! :slight_smile:

So try installing farmOS again from scratch, but this time avoid experimenting with modules in /admin/modules and only try modules in /setup/modules.

Another way to experience farmOS as it was intended is to create a separate user login that has the “Manager” and “Account Admin” roles (install the “Account Admin” module to enable that role) after you install farmOS, and log in as that user. Then you will see a more limited/curated set of features.

When you are logged in as user 1 (the “root” Drupal user), you can see EVERYTHING that Drupal provides in the admin section, which is a) more than you need for farmOS, and b) dangerous because it’s very easy to break things.

Sorry if this is a bit confusing to a new user. I will try to explain:

i will change title of this post.

i can understand what you said. now this farmos instance running for demo. can you give idea (web reference) for export content to new instance ?

Great. Thanks for sticking with it! :slight_smile:

We’ve discussed creating a “farmOS Demo” module that adds demo content (assets and logs), but that has not been built yet. So you will just have to mock up the demo data yourself. I might recommend using the CSV importers for this. If you create some CSVs that work for demo data, feel free to share them with the rest of the community!

ok sir, Thank you.

1 Like