Error: options contain values that does not match the defined full root schema.
-
I deployed jsreport using docker & i am facing this issue
2024-10-22T16:04:12.622Z - error: Error occurred during reporter init: Error: options contain values that does not match the defined full root schema. schema validation errors: rootOptions.blobStorage.provider should be equal to one of the allowed values. allowed values: ["memory", "fs"] at MainReporter.extensionsLoad (/usr/src/app/node_modules/@jsreport/jsreport-core/lib/main/reporter.js:130:13) at async MainReporter.init (/usr/src/app/node_modules/@jsreport/jsreport-core/lib/main/reporter.js:178:7)Error: options contain values that does not match the defined full root schema. schema validation errors: rootOptions.blobStorage.provider should be equal to one of the allowed values. allowed values: ["memory", "fs"] at MainReporter.extensionsLoad (/usr/src/app/node_modules/@jsreport/jsreport-core/lib/main/reporter.js:130:13) at async MainReporter.init (/usr/src/app/node_modules/@jsreport/jsreport-core/lib/main/reporter.js:178:7)
this is my jsreport-config.json
"store": { "provider": "fs" }, "blobStorage": { "provider": "aws-s3-storage" },
in the below config i was config the credentials for aws-s3-storage that i cant share it in here.
{ "blobStorage": { "provider": "aws-s3-storage" }, "extensions": { "aws-s3-storage": { "accessKeyId": "...", "secretAccessKey": "...", "bucket": "...", "s3Options": {...} } } }
-
What does your dockerfile look like? The
@jsreport/jsreport-aws-s3-storage
is a custom extension that must be explicitly installed. You can either add something like this to your dockerfileRUN npm install @jsreport/jsreport-aws-s3-storage
or use jsreport full image
jsreport/jsreport:4.6.0-full
-
this is my dockerfile look like
# Use jsreport full image as the base image FROM jsreport/jsreport:4.6.0-full # Set the working directory inside the container WORKDIR /usr/src/app # Set correct ownership for jsreport user COPY --chown=jsreport:jsreport package*.json ./ # Install dependencies (implicitly as root since it's the default user) RUN npm install # Copy the rest of the application code COPY . . # List contents of /usr/src/app/data (this will run as root) RUN ls -al /usr/src/app/data # Expose the port the app runs on EXPOSE 5488 # Start the application (implicitly as root) CMD [ "npm", "start" ]
-
Running
RUN npm install
will reinstall all the dependencies. The@jsreport/jsreport-aws-s3-storage
dep will get removed If you don't have it in yourpackage.json
even when it is installed in the full image. So you need to add this dep to yourpackage.json