craftcms / feed-me

Craft CMS plugin for importing entry data from XML, RSS or ATOM feeds—routine task or on-demand.
Other
286 stars 140 forks source link

SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'fieldMapping' at row 1 #1446

Closed DynamiteGoesBoom closed 1 month ago

DynamiteGoesBoom commented 1 month ago

Description

For whatever reason any time I try to import a CSV into any channel/structure that has 2 Matrix Builders (we have a hero builder and a content builder) we get this error

Screenshot 2024-05-17 at 1 47 48 PM

The weird thing is that we're not trying to import anything besides a Title and a PostDate data set.

What causes this error? Is it a database issue with the column size or something? I haven't seen this particular issue before.

Steps to reproduce

I can grant you access to our repo or email you whatever you need

Additional info

DynamiteGoesBoom commented 1 month ago

Is there anything that can be done with this? It's sounding more like a DB problem but hopeful that a solution can be made here.

Would upgrading to 5 help alleviate this issue?

i-just commented 1 month ago

Hi, thanks for getting in touch! The problem is that the field mapping information is too long for the database column it’s supposed to fit into. The field mapping for a feed is stored as a JSON-like string in a TEXT type column, which has a limit of 65,535 characters in Maria/MySQL (PostgreSQL doesn’t have that limit).

The weird thing is that we’re not trying to import anything besides a Title and a PostDate data set.

Field mapping stores information on all the attributes and fields for the element you’re importing to, including information on which fields and attributes not to import.

Would upgrading to 5 help alleviate this issue?

No, unfortunately not. The column type for the feed’s field mapping is the same in Feed Me v5 (for Craft 4) and Feed Me v6 (for Craft 5).

I raised a PR to migrate to a larger column size (for Maria and MySQL), which should help with the error you’re encountering.

angrybrad commented 1 month ago

Resolved in https://github.com/craftcms/feed-me/pull/1453 and will be included in the next release.