Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
DynamiteGoesBoom opened this issue May 17, 2024 · 3 comments
Assignees
Labels

Comments

@DynamiteGoesBoom
Copy link

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

  • Craft version: 4.9.2
  • PHP version: 8.2
  • Database driver & version: mariadb
  • Plugins & versions: 5.4
@DynamiteGoesBoom
Copy link
Author

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
Copy link
Contributor

i-just commented May 24, 2024

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
Copy link
Member

Resolved in #1453 and will be included in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants