AWS S3 storage can't start server after install
-
Hi I have just installed the jsreport-aws-s3-storage extension and altered my
jsreport.config.json
to the following -"blobStorage": { "provider": "aws-s3-storage" }, "extensions": { "authentication": { "cookieSession": { "secret": "<your strong secret here>" }, "admin": { "username": "admin", "password": "password" }, "aws-s3-storage": { "accessKeyId": "", "secretAccessKey": "", "bucket": "" }, "enabled": true }, "scripts": { "timeout": 40000, "strategy": "http-server", "allowedModules": ["request", "nodemailer", "nodemailer-ses-transport", "jsreport-proxy"] }, "sample-template": { "createSamples": true } },
Now whenever I start my server using
node server.js
I get the following error -2020-02-05T11:01:23.022Z - error: Error when loading extension aws-s3-storage@1.0.0 Error: accessKeyId must be provided to jsreport-aws-s3-storage at Object.module.exports (/var/www/html/jsreportapp/node_modules/jsreport-aws-s3-storage/lib/main.js:15:11) at Object._useOne (/var/www/html/jsreportapp/node_modules/jsreport-core/lib/extensions/extensionsManager.js:194:75) at Object._useMany (/var/www/html/jsreportapp/node_modules/jsreport-core/lib/extensions/extensionsManager.js:98:20) at process._tickCallback (internal/process/next_tick.js:68:7) 2020-02-05T11:01:23.023Z - error: Error occured during reporter init Error: Error when loading extension aws-s3-storage@1.0.0 Error: accessKeyId must be provided to jsreport-aws-s3-storage at Object.module.exports (/var/www/html/jsreportapp/node_modules/jsreport-aws-s3-storage/lib/main.js:15:11) at Object._useOne (/var/www/html/jsreportapp/node_modules/jsreport-core/lib/extensions/extensionsManager.js:194:75) at Object._useMany (/var/www/html/jsreportapp/node_modules/jsreport-core/lib/extensions/extensionsManager.js:98:20) at process._tickCallback (internal/process/next_tick.js:68:7) at Object._useOne (/var/www/html/jsreportapp/node_modules/jsreport-core/lib/extensions/extensionsManager.js:216:15) at Object._useMany (/var/www/html/jsreportapp/node_modules/jsreport-core/lib/extensions/extensionsManager.js:98:20) at process._tickCallback (internal/process/next_tick.js:68:7) Error: Error when loading extension aws-s3-storage@1.0.0 Error: accessKeyId must be provided to jsreport-aws-s3-storage at Object.module.exports (/var/www/html/jsreportapp/node_modules/jsreport-aws-s3-storage/lib/main.js:15:11) at Object._useOne (/var/www/html/jsreportapp/node_modules/jsreport-core/lib/extensions/extensionsManager.js:194:75) at Object._useMany (/var/www/html/jsreportapp/node_modules/jsreport-core/lib/extensions/extensionsManager.js:98:20) at process._tickCallback (internal/process/next_tick.js:68:7) at Object._useOne (/var/www/html/jsreportapp/node_modules/jsreport-core/lib/extensions/extensionsManager.js:216:15) at Object._useMany (/var/www/html/jsreportapp/node_modules/jsreport-core/lib/extensions/extensionsManager.js:98:20) at process._tickCallback (internal/process/next_tick.js:68:7)
If I change my blob storage back to
fs
instead ofaws-s3-storage
the server starts perfectly but then it isn't using s3.Any help is much appreciated. :)
-
Do you leave "accessKeyId" as an empty string intentionally? Because you are using AWS IAM roles as credentials ?
-
@jan_blaha Yeah sorry i should have mentioned that. All three of those fields have values in my config. If the IAM User doesnt have the correct permission could this be causing that error? I have given the user full access to S3 so I doubt this is the case.
-
It seems you have a "typo" in the config. You have
aws-s3-storage
node insideauthentication
. It should be at the same level insideextensions
.
-
@jan_blaha Thank you, I have no idea how i didnt spot that!