question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CONTENT_DOWNLOAD_MISMATCH

See original GitHub issue

Hey, not sure if the bug is in regards to this package. Please close, if its not.

I ran

gsutil -m setmeta -r -h "Cache-control:public, max-age=259200" gs://ari-motors-2-uploads

and get the following error when downloading the images through @google-cloud/storage:

strapi_1    | RequestError: The downloaded data did not match the data from the server. To be sure the content is the same, you should download the file again.
strapi_1    |     at PassThrough.onComplete (/srv/app/node_modules/@google-cloud/storage/build/src/file.js:1044:43)
strapi_1    |     at processTicksAndRejections (internal/process/task_queues.js:95:5) {
strapi_1    |   code: 'CONTENT_DOWNLOAD_MISMATCH'
strapi_1    | }

The file is later passed to sharp, which throw this error:

strapi_1    | [Error: Input buffer contains unsupported image format]

image download code:

  const options = {
    destination: destFilename,
  };

  try {
    await storage.bucket(bucketName).file(filepath).download(options);
  } catch (error) {
    console.log(error);

The exact same code did work before executing the command. The command didn’t cause an error when running it the first time about two months ago.

Example file (public url): https://storage.googleapis.com/ari-motors-2-uploads/05_ARI_145_Seitenansicht_vorn_rechts_00b43df2d0/05_ARI_145_Seitenansicht_vorn_rechts_00b43df2d0.jpg

The downloaded files are safed as images with storage objects as content: image

{
  "kind": "storage#object",
  "id": "ari-motors-2-uploads/ARI_458_Pritsche_L_Titelbilder_ef3149077f/ARI_458_Pritsche_L_Titelbilder_ef3149077f.png/1628772205883389",
  "selfLink": "https://www.googleapis.com/storage/v1/b/ari-motors-2-uploads/o/ARI_458_Pritsche_L_Titelbilder_ef3149077f%2FARI_458_Pritsche_L_Titelbilder_ef3149077f.png",
  "mediaLink": "https://storage.googleapis.com/download/storage/v1/b/ari-motors-2-uploads/o/ARI_458_Pritsche_L_Titelbilder_ef3149077f%2FARI_458_Pritsche_L_Titelbilder_ef3149077f.png?generation=1628772205883389&alt=media",
  "name": "ARI_458_Pritsche_L_Titelbilder_ef3149077f/ARI_458_Pritsche_L_Titelbilder_ef3149077f.png",
  "bucket": "ari-motors-2-uploads",
  "generation": "1628772205883389",
  "metageneration": "3",
  "contentType": "image/png",
  "storageClass": "STANDARD",
  "size": "607105",
  "md5Hash": "y+ng2GK1Oh03UNcXQuxi8g==",
  "contentDisposition": "inline; filename=\"ARI 458 Pritsche LTitelbilder.png\"",
  "cacheControl": "public, max-age=259200",
  "crc32c": "H1fSVw==",
  "etag": "CP3fgabBq/ICEAM=",
  "timeCreated": "2021-08-12T12:43:25.885Z",
  "updated": "2021-09-21T07:22:12.574Z",
  "timeStorageClassUpdated": "2021-08-12T12:43:25.885Z"
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:9
  • Comments:15

github_iconTop GitHub Comments

1reaction
puzdrowcommented, Sep 21, 2021

Also getting failure as of this morning when using file upload from stream. Even the Google example itself (https://cloud.google.com/storage/docs/streaming#storage-stream-upload-object-nodejs) is not working.

I get the error: { “message”: “Required”, “domain”: “global”, “reason”: “required” }

Btw, some old code, non updated project still works, using version 5.1.1. However, pulling this same version fresh still doesn’t work

0reactions
tw1t611commented, Sep 21, 2021

guess I can close this now. Ty guys. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

CONTENT_DOWNLOAD_MISM...
Correct decompressed file is downloaded AND exception is thrown: code=CONTENT_DOWNLOAD_MISMATCH message=The downloaded data did not match the ...
Read more >
Program failed (download failed - content mismatch) Error
The download failed because the content downloaded to the client does not match the content specified in the content source. Possible causes: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found