solidusio-contrib / solidus_importer

Solidus importer extension to migrate data from other eCommerce systems
BSD 3-Clause "New" or "Revised" License
15 stars 30 forks source link

Import fails each time (product) #85

Closed keferboeck closed 2 years ago

keferboeck commented 2 years ago

Whether from within the application or console, none of the import works. I used the example file provided by the gem (product.csv). I also used the standard Shopify template (csv). No success.

From with the application this is the error message:

1 error prohibited this record from being saved:
There were problems with the following fields:

File has contents that are not what they are reported to be

The console error message is the following:

[paperclip] Trying to link /Users/georg/Desktop/solidus-importer-example-2.csv to /var/folders/41/yljlyw7s4q54r21bnr_rfby40000gn/T/696d120d4b6ceb12d85c44f8596ed2c420220815-76077-1u85pz2.csv
Command :: file -b --mime '/Users/georg/Desktop/solidus-importer-example-2.csv'
[paperclip] Trying to link /var/folders/41/yljlyw7s4q54r21bnr_rfby40000gn/T/696d120d4b6ceb12d85c44f8596ed2c420220815-76077-1u85pz2.csv to /var/folders/41/yljlyw7s4q54r21bnr_rfby40000gn/T/696d120d4b6ceb12d85c44f8596ed2c420220815-76077-1w61p5r.csv
Command :: file -b --mime '/var/folders/41/yljlyw7s4q54r21bnr_rfby40000gn/T/696d120d4b6ceb12d85c44f8596ed2c420220815-76077-1w61p5r.csv'
[paperclip] Content Type Spoof: Filename solidus-importer-example-2.csv (application/csv from Headers, ["text/csv", "text/comma-separated-values"] from Extension), content type discovered from file command: application/csv. See documentation to allow this combination.
[paperclip] Trying to link /var/folders/41/yljlyw7s4q54r21bnr_rfby40000gn/T/696d120d4b6ceb12d85c44f8596ed2c420220815-76077-1u85pz2.csv to /var/folders/41/yljlyw7s4q54r21bnr_rfby40000gn/T/696d120d4b6ceb12d85c44f8596ed2c420220815-76077-idyp0p.csv
Command :: file -b --mime '/var/folders/41/yljlyw7s4q54r21bnr_rfby40000gn/T/696d120d4b6ceb12d85c44f8596ed2c420220815-76077-idyp0p.csv'
[paperclip] Content Type Spoof: Filename solidus-importer-example-2.csv (application/csv from Headers, ["text/csv", "text/comma-separated-values"] from Extension), content type discovered from file command: application/csv. See documentation to allow this combination.
Traceback (most recent call last):
        2: from (irb):1
        1: from (irb):2:in `rescue in irb_binding'
ActiveRecord::RecordInvalid (Validation failed: File has contents that are not what they are reported to be)
jarednorman commented 2 years ago

This is a Paperclip issue related to the MIME configuration. You'll find solutions over in this issue.