jsreport Windows service: does it read dev.config.json config file?



  • Hello,
    I have Windows Server 2012 R2.
    I have installed node.js, then jsreport from Command Prompt:

    npm install jsreport-cli -g
    jsreport init
    jsreport start

    I have edited "dev.config.json" file, to allow localFileAccess under phantom.

    If I start the server via command line (npm start or jsreport start) everything works fine. The dev.config.json file is loaded, and the system loads resources correctly.

    Then, I decided to install the windows service:

    jsreport win-install

    The service is up and fine, but when I start the report, I have noticed that every local file is not loaded. I get the following error:

    warn: Unable to load resource (#2URL:file:///K:/css/test.css) [...]
    warn: Error code: 203. Description: Error opening K:/css/test.css: Unable to find the specified file. [...]

    I have edited the prod.config.json file, too, then stopped and restarted the service, but the problem is always there.

    So, my question is:
    Does the service reads the dev.config.json file, too, or it needs another config file?

    Thank you



  • you should see in the logs what config file is applied

    if you have made the changes in both dev.config.json and prod.config.json, then the problem is likely somewhere else

    isn't the problem in windows permissions? Can you check which user/group the service runs and add permissions to the css folder to that particular user/group?



  • Hello jan_blaha,
    thank you for your answer.
    Solved: the problem was the user that started the service. Since there was access to network files, a local user doesn't have access to those files.
    I solved by setting the service's user to a network user (and changed the reference to the files using UNC full path, instead of shares).
    Now it works fine. Really fine.
    Thank you.



  • Great, thank you for sharing your final solution.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.