I'm having a real nightmare trying to import customers using "Single File" right now.

I've been using Firebear Importer for this, but I've since noticed that this is happening using the native importer too and I'm stumped.

So after much trial and error with the customer import I'm working with, I've generated the sample file and used that. This is what I'm trying to import:

note, I'm working with British Addresses here

[email protected],base,,0,Jon,Male,1,Doe,,703feeb7a8a5195cf1cc9b759ba1e113:V2h36OrOJRh56MyGHw9NF1J855eL9X4P,,,,0,,,1,,Campbell,GB,Jon,Doe,,95008,,Lancashire,"Main Street 1
Suite 200",,123456789,,1,1

If I attempt to import this file, I get the error

  1. Please enter a valid region. in row(s): 1

However, if I switch the country to "US" and the region to "California", it will import. If I switch to US and then use something other than a state name or abbreviation, it will not import either. If I do the opposite (switch country to GB and use a state name) that won't import.

It just doesn't accept anything that's not USA and I'm really struggling.

Here's some additional notes:

  • This works on another magento store I tested with
  • My store locale is Great Britain
  • In configuration > State Options, "State is required For" has nothing selected now.
  • My store was migrated from M1
  • The directory_ db tables are identical between this store and another that works
  • On the frontend, I can create a customer using any old value in the region field.

I'm puzzled. The only instance of this error message is in /vendor/magento/module-customer-import-export/Model/Import/Address.php. In typical Magento fashion, I can find absolutely no documentation for this error anywhere. It would help to know what the specifics are because I haven't a scooby.


  • Hey Thomas, did you find any solution for this?
    – djmzfKnm
    Commented May 21, 2020 at 18:40
  • 1
    Hey Prashant. My colleague managed to solve it. I'll post it in a separate answer now. Commented May 22, 2020 at 8:33

2 Answers 2


Managed to solve it (well a colleague managed to solve it).

I think it was an issue with one of the updates up to Magento 2.3.4, it basically tries to validate a region against a country even if the country doesn't have region IDs already specified.

Here's what he changed.

The file that needs to be overridden is vendor/magento/module-customer-import-export/Model/Import/Address.php

At around line 896, there is this function:

            if (isset($rowData[self::COLUMN_REGION])
                && !empty($rowData[self::COLUMN_REGION])
                && false === $this->getCountryRegionId(
            ) {
                $this->addRowError(self::ERROR_INVALID_REGION, $rowNumber, self::COLUMN_REGION);

He replaced it with:

       if (isset($rowData[self::COLUMN_COUNTRY_ID]) && isset($rowData[self::COLUMN_REGION])) {
                        $countryRegions = isset(
                        ) ? $this->_countryRegions[strtolower(
                        )] : [];

                        if (!empty($rowData[self::COLUMN_REGION]) && !empty($countryRegions) && !isset(
                        ) {
                            $this->addRowError(self::ERROR_INVALID_REGION, $rowNumber, self::COLUMN_REGION);

...and that seemed to do the trick.

  • Hey Thomas, it worked. Thanks :)
    – djmzfKnm
    Commented May 22, 2020 at 14:31
  • Same bug on 2.3.5-p1. The solution provided by Thomas Harding seems to work here too. Thanks! Commented Aug 4, 2020 at 9:57
  • 1
    Works beautifully Magento 2.3.5-p2 thank you for posting this. You'd think Adobe/Magento would take the rest of the world into account!! Commented Oct 14, 2020 at 9:52

In my case I just write region label instead region id and that solved my problem,

so for others please use region label instead region id to get rid out of this error

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.