jsreport@2.1.0 in development mode using configuration file: none
-
Hi,
I have just migrated my existing jsreport 1.10 project to version 2. I used the migration tool and answered all the questions. I decided to keep phantom recipe for templates that needed it. Everything with the migration went fine. But after starting the server I don' have anything that listens to 5488 port (it is configured in jsreport.config.json file). So I checked in the reporter.log and I have this message while trying to start the server Initializing jsreport@2.1.0 in development mode using configuration file: none In addition: I followed the same steps on my colleague PC and this problem didn't occur. I even tried to checkout the project and migrate again from start, but the same result. My colleague uses node 8.11 while i am using 9.5 if this helps
Where can I apply this configFile=path to specify the jsreport.config.json file?
Thanks
-
hi! can you show the full content of your
jsreport.config.json
file (omit license keys, if you have one there)? can you show the full logs that you get while starting jsreport? in your jsreport 1.10 project, did you were using the default installation? or did you changed something in your project that was making jsreport start different from defaultserver.js
file? have you changed the content of the defaultserver.js
?
-
The project was created from scratch: jsreport init as a start point. The things is that the same project on other person machine doesn't have the same problem after migration steps.
Just for test I tried on my PC to create completely new jsreport and there everything went fine.
This is server.js:
var jsreport = require('jsreport')()if (process.env.JSREPORT_CLI) {
// export jsreport instance to make it possible to use jsreport-cli
module.exports = jsreport
} else {
jsreport.init().then(function () {
// running
}).catch(function (e) {
// error during startup
console.error(e.stack)
process.exit(1)
})
}And this is the jsreport.config.json:
{
"certificate": {
"key": "certificates/jsreport.net.key",
"cert": "certificates/jsreport.net.cert"
},
"httpPort": 5488,
"httpsPort": null,
"logger": {
"console": {
"transport": "console",
"level": "debug"
},
"file": {
"transport": "file",
"level": "info",
"filename": "logs/reporter.log"
},
"error": {
"transport": "file",
"level": "error",
"filename": "logs/error.log"
}
},
"blobStorage": {
"provider": "fs"
},
"phantom": {
"strategy": "dedicated-process",
"timeout": 60000
},
"allowLocalFilesAccess": false,
"store": {
"provider": "fs"
},
"templatingEngines": {
"strategy": "dedicated-process",
"timeout": 10000,
"allowedModules": [
"request",
"globals"
]
},
"extensions": {
"authentication": {
"cookieSession": {
"secret": "<your strong secret>"
},
"admin": {
"username": "admin",
"password": "password"
},
"enabled": false
},
"scripts": {
"allowedModules": "*",
"timeout": 60000
},
"sample-template": {
"createSamples": true
}
}
}And logs
2018-06-04T16:42:19.616Z - info: Initializing jsreport@2.1.0 in development mode using configuration file: none
2018-06-04T16:42:19.616Z - info: Searching for available extensions in D:\Proj\jsReportDev\node_modules\jsreport
2018-06-04T16:42:19.647Z - info: Extensions location cache contains up to date information, skipping crawling in D:\Proj\jsReportDev\node_modules\jsreport\node_modules
2018-06-04T16:42:19.663Z - info: Found 5 extensions
2018-06-04T16:42:19.663Z - debug: Writing extension locations cache to C:\Users\TEODOR~2\AppData\Local\Temp\jsreport\core\locations.json
2018-06-04T16:42:19.663Z - debug: Discovered 5 extensions
2018-06-04T16:42:19.678Z - info: Setting process based strategy for rendering. Please visit http://jsreport.net/learn/configuration for information how to get more performance.
2018-06-04T16:42:19.678Z - info: Using extension cli
2018-06-04T16:42:19.694Z - info: Using extension freeze
2018-06-04T16:42:19.694Z - info: Using extension chrome-pdf
2018-06-04T16:42:19.816Z - info: Using extension pdf-utils
2018-06-04T16:42:20.010Z - info: Using extension version-control
2018-06-04T16:42:20.139Z - info: reporter initialized
-
can you describe how are you starting jsreport? what command are you using?
node server.js
,npm sart
,jsreport start
or something else? are you starting from command line? if yes, are you usingD:\Proj\jsReportDev
as the current working directory of your console when starting jsreport? so far according to your logs for some reason you are starting jsreport withD:\Proj\jsReportDev\node_modules\jsreport
as your current working directory, which is wrong, asumming that your project is located atD:\Proj\jsReportDev
the logs should sayinfo: Searching for available extensions in D:\Proj\jsReportDev
-
jsreport start from D:\Proj\jsReportDev folder and it has been working perfectly fine till I migrated today.
I checkouted the project again from git and migrated it and the same problem occurred. If I stay on 1.10 version it works.
We have a license for single server jsreport and we really want to update production server to version 2
-
hmm not sure why for your case jsreport is starting at
D:\Proj\jsReportDev\node_modules\jsreport
after migration, can you email me a zip of your original project (before migration) at bjrmatos@gmail.com so we can try the migration the same way that you using node 9.5? if your colleague tried a migration with node 8.11 and it worked fine, if you use the same version (8.11) and try the migration again, does it work? (just to discard a problem with nodejs version)
-
Hi, after lot of struggling I think that I manage to fix this. The solution with downgrading node.js didn't work. Then I tried to install empty 1.10.0 jsreport and migrate it. Like that it worked. So I thought that something is breaking the migration on my PC that is not part of jsreport native (strangely this is not the case on my colleague PC). So we have in the project some external js files that are being required from tempalte scripts. Normally this are valid files but when I checkouted the project, removed the helper js files the migration went fine with recognizing jsreport.config.json.
To be sure that this works I did the same steps again. Next time it didn't work. So something is comepletely wrong with execution on my PC.
-
i see, remember that you can email me the project in case your are still curious to know the exact reason of the failure, it can also be another prove that something weird is happening in your machine.