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

Customer Import - Invalid data for insert #4291

Closed
zinittest opened this issue Apr 25, 2016 · 16 comments
Closed

Customer Import - Invalid data for insert #4291

zinittest opened this issue Apr 25, 2016 · 16 comments
Labels
bug report Component: ImportExport Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@zinittest
Copy link

Steps to reproduce

  1. Create CSV file for customer import with two rows: first - all columns filled with dummy content, second - without gender or dob data (example attached).
    test_main.csv.zip
  2. Choose "Customers Main File", "Add/Update Complex Data" options.
  3. Hit "Check Data" button - validation should be OK.
  4. Hit "Import" button.

Expected result

  1. Customer data imported to the shop.

Actual result

  1. Error message appears: "Invalid data for insert".

P. S. Error occurs because data rows which are going to be inserted have different keys (https://github.com/magento/magento2/blob/develop/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php#L1878). It happens because fields with empty values are discarded during data preparation step (https://github.com/magento/magento2/blob/develop/app/code/Magento/CustomerImportExport/Model/Import/Customer.php#L373). I was able to import data just commenting these lines, but obviously it requires more proper fix.

@piotrekkaminski
Copy link
Contributor

@ilol please review

@vkorotun vkorotun removed the CS label Aug 4, 2016
@ilol ilol removed their assignment Aug 18, 2016
@BaDos BaDos self-assigned this Sep 13, 2016
@BaDos
Copy link
Contributor

BaDos commented Sep 13, 2016

Hi @zinittest

Thank you for reporting.
We've created an internal ticket MAGETWO-58316 to resolve this issue.

@BaDos BaDos added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development 2.0.x labels Sep 13, 2016
@BaDos BaDos removed their assignment Sep 13, 2016
@EL-Nazer
Copy link

Hi @BaDos

Any updates - i am facing same issue with importing customers-address data

@BaDos
Copy link
Contributor

BaDos commented Sep 16, 2016

Hi @EL-Nazer

We are working on this issue.

mmansoor-magento pushed a commit that referenced this issue Sep 28, 2016
Fixed issues:
- MAGETWO-58457: Can not install Magento 2.1.1 EE via GUI from composer project
- MAGETWO-58104: If custom text area attribute is created, you can't export bundle product. - for 2.2
- MAGETWO-58394: [Github] magento/framework depends on zendframework/zend-stdlib but it's missing from composer.json #6442
- MAGETWO-58316: [Github] Customer Import - Invalid data for insert #4291
@jvreeken
Copy link

This is still an issue in v2.1.3

@PieterCappelle
Copy link
Contributor

PieterCappelle commented Jan 17, 2017

Please add this fix in v2.1.4. This is critical! Original date reported is 25 Apr 2016. Fix was at 28 Sep 2016. Today 17 Jan 2017... #crying

PS: Fix from @mmansoorebay is working. Edited the core...

@nntoan
Copy link
Contributor

nntoan commented Feb 13, 2017

I'm still facing this issue in v2.1.3 (customer composite).
@PieterCappelle : Which commit you use to fix? 8abf097 or 487ae24

@PieterCappelle
Copy link
Contributor

@nntoan Both.

@nntoan
Copy link
Contributor

nntoan commented Feb 13, 2017

@PieterCappelle You can choose only one commit. Because one of them add new lines to the if statement and the other one will delete the whole if statement...

Both of them mean you add new line, then you delete the whole if => only 487ae24
I tried 487ae24 and it's not working actually.

@pguedesbr
Copy link

Actually 487ae24 (removing the if statement) solved the issue for me. The question is why this commit hasnt been merged with the 2.1 branch. Therefore the fix is not live.

@uTosTan
Copy link

uTosTan commented May 24, 2017

The issue is still there in v2.1.5. Commit 487ae24 fixed the issue for me.

@veloraven
Copy link
Contributor

This issue has already been fixed. Internal ticket for ver. 2.1. - MAGETWO-58760.
Internal ticket for ver. 2.0 - MAGETWO-58392.
These fixes should be available in some of the nearest release.

@orlangur
Copy link
Contributor

@apshahi please check latest stable version before commenting, fix should be present in 2.1.8 due to aaf8503.

@apshahi
Copy link

apshahi commented Aug 22, 2017

@orlangur, I 'm not exactally getting your point. The question is which Section in commenting in code.

@orlangur
Copy link
Contributor

@apshahi I don't see your comment I commented (or I commented in the wrong thread?).

AFAIR, there was something like "still see this on 2.1.7" while 2.1.8 was already released.

@heidiboh
Copy link

heidiboh commented Jan 17, 2018

Using 2.2 This is still a problem. When uploading data matching the format of the sample file, get this error:
Header contains invalid attribute(s): "reward_update_notification", "reward_warning_notification"

M2 provides a sample file in the Import page, however, it provides an invalid file.
Also tried matching my import file to the customer main export in the Export page, but this does not work either (get a columns not matching rows error).

@magento-engcom-team magento-engcom-team added the Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed label Jan 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: ImportExport Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests