Not able to create Blob in Azure Blob using jsreport-azure-storage extension
-
Hi Jan,
I have Started a Ubuntu Server VM on Azure Cloud and installed the JsReport on it and then created a Storage Account as well to store the Reports in Azure Storage Account.When I am trying to Generate a report from my .Net core application the generated report should be stored in Storage Blob in Specifed Container as mentioned in Jsreport config.
While generating report the report get's generated successfully and Container is created in Azure Storage Blob Service but the Report/Blob is not stored in Azure Storage. You can see the Jsreport Logs below and the error I am getting.
root@jsreport-server-dev:/var/jsreport# jsreport start
2020-12-09T08:53:46.383Z - info: Initializing jsreport@2.10.0 in development mode using configuration file: jsreport.config.json
2020-12-09T08:53:46.386Z - info: Searching for available extensions in /var/jsreport/
2020-12-09T08:53:46.424Z - info: Extensions location cache not found, crawling directories
2020-12-09T08:53:50.755Z - info: Found 36 extensions
2020-12-09T08:53:51.611Z - debug: Writing extension locations cache to /tmp/jsreport/core/locations.json
2020-12-09T08:53:51.611Z - debug: Discovered 36 extensions
2020-12-09T08:53:51.721Z - warn: "templatingEngines.timeout" configuration is deprecated and will be removed in the future, please use "reportTimeout" instead
2020-12-09T08:53:51.721Z - info: Setting in-process strategy for rendering
2020-12-09T08:53:51.731Z - info: Using extension jsrender@2.1.1
2020-12-09T08:53:51.750Z - info: Using extension tags@2.5.0
2020-12-09T08:53:51.759Z - info: Using extension azure-storage@1.1.1
2020-12-09T08:53:52.873Z - info: Using extension templates@2.4.0
2020-12-09T08:53:52.878Z - debug: Extension authentication@2.6.0 is disabled, skipping
2020-12-09T08:53:52.878Z - info: Using extension import-export@2.1.0
2020-12-09T08:53:53.099Z - info: Using extension handlebars@2.1.0
2020-12-09T08:53:53.104Z - info: Using extension cli@2.2.5
2020-12-09T08:53:53.108Z - info: Using extension freeze@2.0.0
2020-12-09T08:53:53.113Z - info: Using extension debug@2.1.3
2020-12-09T08:53:53.119Z - info: Using extension express@2.8.0
2020-12-09T08:53:53.682Z - info: Using extension pptx@0.7.0
2020-12-09T08:53:53.687Z - info: Using extension docx@2.8.0
2020-12-09T08:53:53.694Z - info: Using extension authorization@2.4.0
2020-12-09T08:53:53.727Z - debug: Extension authorization@2.4.0 was disabled
2020-12-09T08:53:53.727Z - info: Using extension chrome-pdf@1.9.0
2020-12-09T08:53:53.748Z - warn: "chrome.timeout" configuration is deprecated and will be removed in the future, please use "reportTimeout" instead
2020-12-09T08:53:54.037Z - debug: Chrome strategy is dedicated-process
2020-12-09T08:53:54.038Z - debug: Chrome custom launch options are args=[--no-sandbox]
2020-12-09T08:53:54.038Z - info: Using extension child-templates@1.4.0
2020-12-09T08:53:54.058Z - info: Using extension browser-client@2.2.2
2020-12-09T08:53:54.067Z - info: Using extension licensing@2.2.3
2020-12-09T08:53:54.070Z - info: Using extension pdf-utils@1.9.0
2020-12-09T08:53:54.418Z - info: Using extension data@2.4.0
2020-12-09T08:53:54.421Z - info: Using extension version-control@1.5.1
2020-12-09T08:53:54.896Z - info: Using extension reports@2.5.0
2020-12-09T08:53:54.909Z - info: Using extension text@2.0.0
2020-12-09T08:53:54.913Z - info: Using extension base@2.0.2
2020-12-09T08:53:54.920Z - info: Using extension static-pdf@0.4.0
2020-12-09T08:53:54.939Z - info: Using extension studio@2.10.1
2020-12-09T08:53:55.217Z - debug: studio request logs are enabled (flush interval: 2000)
2020-12-09T08:53:55.219Z - info: Using extension fs-store@2.9.0
2020-12-09T08:53:55.724Z - info: Using extension scripts@2.6.0
2020-12-09T08:53:55.730Z - info: Using extension html-to-xlsx@2.8.0
2020-12-09T08:53:57.031Z - info: html-to-xlsx detected chrome as available html engine
2020-12-09T08:53:57.031Z - info: Using extension assets@1.7.0
2020-12-09T08:53:57.062Z - info: Using extension studio-theme-dark@0.3.0
2020-12-09T08:53:57.074Z - info: Using extension scheduling@2.5.0
2020-12-09T08:53:57.206Z - info: Using extension xlsx@2.5.0
2020-12-09T08:53:57.752Z - info: Using extension sample-template@2.6.0
2020-12-09T08:53:57.754Z - info: Using extension resources@2.1.0
2020-12-09T08:53:57.758Z - info: Using extension public-templates@2.2.0
2020-12-09T08:53:57.762Z - debug: Extension public-templates@2.2.0 was disabled
2020-12-09T08:53:57.762Z - info: Using fs provider for template store.
2020-12-09T08:53:57.768Z - info: fs store is persisting using fs
2020-12-09T08:53:57.769Z - info: fs store is synchronizing using fs
2020-12-09T08:53:57.855Z - info: fs store is loading data
2020-12-09T08:53:57.922Z - debug: fs store sync is configured to use polling for files watcher
2020-12-09T08:53:57.942Z - info: fs store is initialized successfully
2020-12-09T08:53:57.948Z - debug: studio default theme is: light
2020-12-09T08:53:58.123Z - info: Creating default express app.
2020-12-09T08:53:58.244Z - info: jsreport server successfully started on http port: 5488
2020-12-09T08:53:58.244Z - info: fs store emits sockets to synchronize underlying changes with studio
2020-12-09T08:53:58.362Z - info: Verifying license key free
2020-12-09T08:53:58.364Z - info: Using free license
2020-12-09T08:53:58.369Z - info: reporter initialized
2020-12-09T08:54:15.174Z - info: Starting rendering request 1 (user: null)
2020-12-09T08:54:15.176Z - info: Rendering anonymous template { recipe: docx, engine: handlebars }
2020-12-09T08:54:15.177Z - debug: Inline data specified.
2020-12-09T08:54:15.177Z - debug: Resources not defined for this template.
2020-12-09T08:54:15.182Z - debug: Base url not specified, skipping its injection.
2020-12-09T08:54:15.183Z - debug: Rendering engine handlebars using in-process strategy
2020-12-09T08:54:15.478Z - debug: Compiled template not found in the cache, compiling
2020-12-09T08:54:15.479Z - debug: Executing recipe docx
2020-12-09T08:54:15.480Z - info: docx generation is starting
2020-12-09T08:54:16.507Z - debug: Starting child request to render docx dynamic parts
2020-12-09T08:54:16.512Z - info: Starting rendering request 2 (user: null)
2020-12-09T08:54:16.513Z - info: Rendering anonymous template { recipe: html, engine: handlebars }
2020-12-09T08:54:16.514Z - debug: Inline data specified.
2020-12-09T08:54:16.514Z - debug: Resources not defined for this template.
2020-12-09T08:54:16.516Z - debug: Base url not specified, skipping its injection.
2020-12-09T08:54:16.517Z - debug: Rendering engine handlebars using in-process strategy
2020-12-09T08:54:16.644Z - debug: Compiled template not found in the cache, compiling
2020-12-09T08:54:16.663Z - debug: Executing recipe html
2020-12-09T08:54:16.664Z - debug: Skipping storing report.
2020-12-09T08:54:16.664Z - info: Rendering request 2 finished in 152 ms
2020-12-09T08:54:16.919Z - debug: docx successfully zipped
2020-12-09T08:54:16.919Z - info: docx generation was finished
2020-12-09T08:54:16.933Z - error: Rendering request 1 finished with error in 1759 ms
2020-12-09T08:54:16.933Z - error: Error when processing render request 1 Required argument streamLength for function _createBlobFromStream is not defined ArgumentNullError: Required argument streamLength for function _createBlobFromStream is not defined
at throwMissingArgument (/var/jsreport/node_modules/azure-storage/lib/common/util/validate.js:476:9)
at ArgumentValidator.value (/var/jsreport/node_modules/azure-storage/lib/common/util/validate.js:519:7)
at /var/jsreport/node_modules/azure-storage/lib/services/blob/blobservice.core.js:4191:7
at Object.validateArgs (/var/jsreport/node_modules/azure-storage/lib/common/util/validate.js:556:3)
at BlobService._createBlobFromStream (/var/jsreport/node_modules/azure-storage/lib/services/blob/blobservice.core.js:4185:12)
at BlobService.createBlockBlobFromStream (/var/jsreport/node_modules/azure-storage/lib/services/blob/blobservice.core.js:3167:15)
at Promise (/var/jsreport/node_modules/jsreport-azure-storage/lib/main.js:40:21)
at new Promise (<anonymous>)
at Object.write (/var/jsreport/node_modules/jsreport-azure-storage/lib/main.js:36:14)
at Object.write (/var/jsreport/node_modules/jsreport-core/lib/blobStorage/blobStorage.js:9:23)
at Reports.handleAfterRender (/var/jsreport/node_modules/jsreport-reports/lib/reports.js:300:55)
at <anonymous>
2020-12-09T08:54:16.934Z - error: Error during processing request at http://xyz:5488/api/reportBelow is my Jsreport config details
{
"store": {
"provider": "fs"
},
"blobStorage": {
"provider": "azure-storage"
},
"extensions": {
"chrome-pdf": {
"timeout": 40000
},
"html-to-xlsx": {
"timeout": 40000
},
"unoconv": {
"command": "python unoconv"
},
"chrome-pdf": {
"launchOptions": {
"args": ["--no-sandbox"]
}
},
"authentication": {
"cookieSession": {
"secret": "<your strong secret here>"
},
"admin": {
"username": "admin",
"password": "password"
},
"enabled": false
},
"scripts": {
"timeout": 40000,
"strategy": "http-server"
},
"sample-template": {
"createSamples": true
},
"azure-storage": {
"accountName": "accountName",
"accountKey": "AccountKey",
"container": "ContainerName"
}
},
"httpPort": 5488,
"express": {
"inputRequestLimit": "200mb"
},
"logger": {
"console": {
"transport": "console",
"level": "debug"
},
"file": {
"transport": "file",
"level": "info",
"filename": "logs/reporter.log"
},
"error": {
"transport": "file",
"level": "error",
"filename": "logs/error.log"
}
},
"allowLocalFilesAccess": true,
"templatingEngines": {
"timeout": 600000,
"strategy": "in-process"
},
"chrome": {
"timeout": 40000
},
"office": {
"preview": {
"enabled": false
}
}
}I am using jsreport-azure-storage extension to store the reports in Azure Storage account.
Kindly help me with this error I am getting.
Thanks,
Zahid
-
This is the error from Studio of Failed Requests:
Required argument streamLength for function _createBlobFromStream is not defined
ArgumentNullError: Required argument streamLength for function _createBlobFromStream is not defined at throwMissingArgument (/var/jsreport/node_modules/azure-storage/lib/common/util/validate.js:476:9) at ArgumentValidator.value (/var/jsreport/node_modules/azure-storage/lib/common/util/validate.js:519:7) at /var/jsreport/node_modules/azure-storage/lib/services/blob/blobservice.core.js:4191:7 at Object.validateArgs (/var/jsreport/node_modules/azure-storage/lib/common/util/validate.js:556:3) at BlobService._createBlobFromStream (/var/jsreport/node_modules/azure-storage/lib/services/blob/blobservice.core.js:4185:12) at BlobService.createBlockBlobFromStream (/var/jsreport/node_modules/azure-storage/lib/services/blob/blobservice.core.js:3167:15) at Promise (/var/jsreport/node_modules/jsreport-azure-storage/lib/main.js:40:21) at new Promise () at Object.write (/var/jsreport/node_modules/jsreport-azure-storage/lib/main.js:36:14) at Object.write (/var/jsreport/node_modules/jsreport-core/lib/blobStorage/blobStorage.js:9:23) at Reports.handleAfterRender (/var/jsreport/node_modules/jsreport-reports/lib/reports.js:300:55) at+0 Starting rendering request 1 (user: null)
+1 Rendering anonymous template { recipe: docx, engine: handlebars }
+1 Inline data specified.
+2 Resources not defined for this template.
+6 Base url not specified, skipping its injection.
+6 Rendering engine handlebars using in-process strategy
+358 Compiled template not found in the cache, compiling
+366 Executing recipe docx
+366 docx generation is starting
+1323 Starting child request to render docx dynamic parts
+1327 Starting rendering request 2 (user: null)
+1329 Rendering anonymous template { recipe: html, engine: handlebars }
+1329 Inline data specified.
+1329 Resources not defined for this template.
+1331 Base url not specified, skipping its injection.
+1331 Rendering engine handlebars using in-process strategy
+1334 Compiled template not found in the cache, compiling
+1446 Executing recipe html
+1447 Skipping storing report.
+1447 Rendering request 2 finished in 120 ms
+1666 docx successfully zipped
+1666 docx generation was finished
-
The problem was that the extension was compatible with node >=10.
I released an update that should fix this and make it working with node 8.Please install using
npm i -S jsreport-azure-storage@1.1.2
-
Sure thanks Jan will try and update you on this
-
Thank you Jan I am able to upload the blobs/reports to Azure Storage Service now.