webiny / webiny-js

Open-source serverless enterprise CMS. Includes a headless CMS, page builder, form builder, and file manager. Easy to customize and expand. Deploys to AWS.
https://www.webiny.com
Other
7.24k stars 590 forks source link

Cloudfront distribution 404 after update #4134

Open LeoDeJaneiro opened 2 months ago

LeoDeJaneiro commented 2 months ago

Version

5.39.6

Operating System

all

Browser

all

What are the steps to reproduce this bug?

  1. uploaded png / gif assets
  2. updated webiny (env prod) 5.38.2 -> 5.39.6 according update document
  3. trying to fetch any asset.

What is the expected behavior?

Assets should remain usable.

What do you see instead?

Assets are not found by Cloudfront: 404. The S3 bucket seems still filled, a random choice of assets shows that they are available there.

Additional information

I had a partly broken Webiny instance for some time due to the Node 16 Lambda runtime deprecation.

Possible solution

No response

LeoDeJaneiro commented 2 months ago

I traced the issue down to the lambda which cannot resolve the metadata file. I can confirm, that the *.metadata file does not exist for us for assets which have been uploaded with the 5.38.2 webiny version but for uploads with the updated version.

  1. Should this file exist for 5.38 uploads?
  2. How can we hotfix this? Is there any way to recreate them? Are these files AWS or Webiny specific?

from the Logstream:

45fadc43-31dd-4f35-bedb-25058de88219    INFO    Reading metadata 66263a76634da70008716c01/{filename}.png.metadata
2024-05-15T10:46:58.195Z    45fadc43-31dd-4f35-bedb-25058de88219    INFO    S3AssetResolver failed to read metadata: The specified key does not exist.