@svijay77 and I spent a while tracking an issue concerning two stories uploaded through the admin-upload page. This stories did appear in the admin pages and were successfully approved, however, they aren't showing up in the US Covid Atlas map.
After digging around, we found a few things:
- In the S3 /uploads folder, the proper files were present, but had a number of extra spaces on the end (also MP4 was capitalized). For example:
/uploads/<uuid>/<storyid>_meta.json
/uploads/<uuid>/<storyid>.MP4
- In the S3 /public folder, the MP4 file also had the extra spaces
- In the S3 /meta folder, the
survey.json
file also had the extra spaces, and no <storyid>.json
had been created
We manually removed all of these spaces (and changed .MP4
to .mp4
) and then ran the Update CDN Github action. This seems to have fixed part of the problem, as the S3 bucket's /public/info.json
now contains references to the new stories (we had confirmed before that it didn't, and that's why they weren't on the map). Once CloudFront refreshes that file cache, hopefully these stories will appear on the map.
The survey metadata file is still not created, but we think that may be related to #28.
One interesting thing to note: Before removing the spaces from the file names as described above, the Update CDN workflow was failing with this message:
https://***.s3.***.amazonaws.com/uploads/9d2a8e7b6da6fe1bdede9014a8d31f8637bacfc4/t6xQiL2FOrKtNzB3IerT3_meta.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=***%2F20230417%2F***%2Fs3%2Faws4_request&X-Amz-Date=20230417T015241Z&X-Amz-Expires=300&X-Amz-Signature=7e010d27eb4ecf371fec783a48f39558cbffa07b57ba31ae19f818027e096afb&X-Amz-SignedHeaders=host&x-id=GetObject
(node:1822) UnhandledPromiseRejectionWarning: Error: No value provided for input HTTP label: DistributionId.
at serializeAws_restXmlCreateInvalidationCommand (/home/runner/work/covid-histories/covid-histories/node_modules/@aws-sdk/client-cloudfront/dist-cjs/protocols/Aws_restXml.js:271:15)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async /home/runner/work/covid-histories/covid-histories/node_modules/@aws-sdk/middleware-serde/dist-cjs/serializerMiddleware.js:5:21
at async /home/runner/work/covid-histories/covid-histories/node_modules/@aws-sdk/middleware-logger/dist-cjs/loggerMiddleware.js:6:22
The number of url params in that expected /uploads/ url is 8, which, we should have counted but didn't, was about the same number of spaces at the end of the files. I have a hunch that something with the pre-signed url generation during this admin-upload process failed, and missing url params were converted into spaces and appended to the new file names.