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

Assets corrupted on export #2873

Open
Guyda opened this issue Dec 13, 2024 · 2 comments
Open

Assets corrupted on export #2873

Guyda opened this issue Dec 13, 2024 · 2 comments

Comments

@Guyda
Copy link

Guyda commented Dec 13, 2024

All the downloaded image and video files from the export are corrupted. I've tried this on two different spaces with the same issue.

Expected Behavior

Content and assets exported from Contentful to my local machine.

Actual Behavior

Assets turn out to be corrupted on cli export

Steps to Reproduce

Running my command

contentful space export 
    --space-id <space_id>
    --management-token <cma_token> 
    --environment-id master 
    --export-dir contentful_exports/test 
    --save-file 
    --max-allowed-limit 1000 
    --download-assets

Returns this

 ✔ Initialize client (1s)
  ✔ Fetching data from space
    ✔ Connecting to space (1s)
    ✔ Fetching content types data (1s)
    ✔ Fetching tags data (1s)
    ✔ Fetching editor interfaces data (4s)
    ✔ Fetching content entries data (1s)
    ✔ Fetching assets data (1s)
    ✔ Fetching locales data (1s)
    ✔ Fetching webhooks data (1s)
    ✔ Fetching roles data (1s)
  ✔ Download assets (34s)
  ✔ Write export log file
    ✔ Lookup directory to store the logs
    ✔ Create log directory
    ✔ Writing data to file
┌──────────────────────────┐
│ Exported entities        │
├───────────────────┬──────┤
│ Content Types     │ 25   │
├───────────────────┼──────┤
│ Tags              │ 47   │
├───────────────────┼──────┤
│ Editor Interfaces │ 25   │
├───────────────────┼──────┤
│ Entries           │ 1204 │
├───────────────────┼──────┤
│ Assets            │ 378  │
├───────────────────┼──────┤
│ Locales           │ 1    │
├───────────────────┼──────┤
│ Webhooks          │ 3    │
├───────────────────┼──────┤
│ Roles             │ 3    │
└───────────────────┴──────┘
┌─────────────────────────────┐
│ Asset file download results │
├──────────────────┬──────────┤
│ Successful       │ 378      │
├──────────────────┼──────────┤
│ Warnings         │ 0        │
├──────────────────┼──────────┤
│ Errors           │ 0        │
└──────────────────┴──────────┘
The export took 1 minute (42s)

Opening any files from the export with the preview app in OSX:
Screenshot 2024-12-13 at 12 42 21 PM

Tested with ImageMagick

magick 96.jpg -strip fixed-96.jpg
magick: Not a JPEG file: starts with 0xef 0xbf `96.jpg' @ error/jpeg.c/JPEGErrorHandler/356.

One thing I noticed in the export is when it's downloading the assets it says unknown in the terminal see sample here. Is it not detecting the file format?

downloaded unknown (//images.ctfassets.net/<space_id>/<uid>/96.jpg etc...

Environment

Node: 20.17.0
Npm: 10.9.0
Contentful: 3.7.1
Operating System: OSX 15.2

@lfriel
Copy link

lfriel commented Dec 13, 2024

I have also experienced this! Version 3.7.0 works as expected but bumping to 3.7.1 caused issues.

@Guyda
Copy link
Author

Guyda commented Dec 13, 2024

Confirming going back to v3.7.0 fixes removes my problem. Thank you.

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

No branches or pull requests

2 participants