Magento 2 Exception Invalid method Magento\Eav\Model\Entity\Attribute::canBeFilterableInGrid.

I recently worked on a Magento project and faced an exception on Magento backend Customer Dashboard while accessing the customer grid on the admin panel.

Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid method Magento\Eav\Model\Entity\Attribute::canBeFilterableInGrid

How to resolve the issue for the customer grid?

I have just resolved the issue by updating the eav_attribute table customer attribute value. In my case, I have installed a third-party Nosto Module and that creates an extra customer attribute called `nosto_customer_reference`.

While I debug the code, I found the issue is from the database end, Just check the eav_attribute table and I saw Nosto customer attribute contains an attribute_model value Magento\Eav\Model\Entity\Attribute.

You just need to remove the attribute_model column value from the attribute and just check it again after running the setup upgrade command.

Run Query:

UPDATE `eav_attribute` SET `attribute_model` = NULL WHERE `eav_attribute`.`attribute_code` = 'nosto_customer_reference';

You can create a Setup\Patch\Data file to update the query in the module or directly run the SQL query to the database table.