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

[BUG] Not specifying STORAGE_XYZ env vars causes HTTP 500 server error #920

Closed
1 of 2 tasks
michael-robbins opened this issue Jun 18, 2022 · 2 comments
Closed
1 of 2 tasks
Labels
bug Something isn't working

Comments

@michael-robbins
Copy link

michael-robbins commented Jun 18, 2022

Describe the bug
When you do not specify the STORAGE_{BUCKET|REGION|etc} env vars and attempt to upload a photo the server throws a HTTP 500 error and the client does not provide any error message, it just silently ignores the error and the user is left confused.

Server log:

[Nest] 42  - 06/18/2022, 9:16:33 PM   ERROR [ExceptionsHandler] Region is missing
Error: Region is missing
    at default (/app/node_modules/.pnpm/@aws-sdk+config-resolver@3.80.0/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/config.js:10:15)
    at /app/node_modules/.pnpm/@aws-sdk+node-config-provider@3.80.0/node_modules/@aws-sdk/node-config-provider/dist-cjs/fromStatic.js:6:83
    at /app/node_modules/.pnpm/@aws-sdk+property-provider@3.78.0/node_modules/@aws-sdk/property-provider/dist-cjs/chain.js:11:28
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async coalesceProvider (/app/node_modules/.pnpm/@aws-sdk+property-provider@3.78.0/node_modules/@aws-sdk/property-provider/dist-cjs/memoize.js:14:24)
    at async /app/node_modules/.pnpm/@aws-sdk+property-provider@3.78.0/node_modules/@aws-sdk/property-provider/dist-cjs/memoize.js:26:28
    at async Object.region (/app/node_modules/.pnpm/@aws-sdk+config-resolver@3.80.0/node_modules/@aws-sdk/config-resolver/dist-cjs/regionConfig/resolveRegionConfig.js:17:36)
    at async getEndpointFromRegion (/app/node_modules/.pnpm/@aws-sdk+config-resolver@3.80.0/node_modules/@aws-sdk/config-resolver/dist-cjs/endpointsConfig/utils/getEndpointFromRegion.js:7:20)
    at async serializeAws_restXmlPutObjectCommand (/app/node_modules/.pnpm/@aws-sdk+client-s3@3.81.0/node_modules/@aws-sdk/client-s3/dist-cjs/protocols/Aws_restXml.js:3525:68)
    at async /app/node_modules/.pnpm/@aws-sdk+middleware-serde@3.78.0/node_modules/@aws-sdk/middleware-serde/dist-cjs/serializerMiddleware.js:5:21
    at async /app/node_modules/.pnpm/@aws-sdk+middleware-logger@3.78.0/node_modules/@aws-sdk/middleware-logger/dist-cjs/loggerMiddleware.js:6:22
    at async ResumeService.uploadPhoto (/app/server/dist/resume/resume.service.js:164:9)

Product Flavor

To Reproduce

  1. Start the self hosted container
  2. Do not specify any STORAGE_ env vars
  3. Attempt to upload a profile photo image
  4. Look at the container logs see error from above
  5. Look at Dev Tools in browser and see HTTP 500 thrown and JS errors

Expected behavior
User is presented an error message saying something like 'profile photo upload failed, please try later or contact the admin'
Server logs something like: 'STORAGE_XYZ' env vars missing, disabled photo upload, returning client failure or something like that :)

Desktop (please complete the following information):
Firefox browser, but shouldn't matter really.

@michael-robbins michael-robbins added the bug Something isn't working label Jun 18, 2022
@michael-robbins
Copy link
Author

Looks like this will be closed with #906

@michael-robbins
Copy link
Author

There's other issues tracking this so will close off this to have less clutter :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant