RootOptions.store.provider requiring value "Memory"



  • Version: jsreport@2.6.1

    I am getting the following error when attempting to initialize the server:

    error: Error occured during reporter init Error: options contain values that does not match the defined full root schema. schema validation errors: rootOptions.store.provider should be equal to one of the allowed values. allowed values: ["memory"]

    I am probably understanding this incorrectly but isn't it referring to the template store? In the documentation (https://jsreport.net/learn/template-stores) it states that template stores default to "fs".

    In my config file I am finding the error being associated to

    {  
        ...
        "store": {
            "provider":"fs"
        },
        ...
    }
    

    When I remove this, it defaults to using memory



  • This looks like a problem with the installation?
    What steps did you follow when installing?
    Can you try to delete node_modules and package*.json and install again?



  • I tried deleting and recreating, I am still getting the same issue.

    Here is my install instructions. I have installed this on 4 servers with no issues, and then I rebooted three of them which those no longer work properly. Its quite confusing. I might try a clean install.

    install node.js

    sudo curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -
    sudo apt-get install -y nodejs

    install jsreport

    cd /opt
    sudo mkdir jsreport
    sudo chown svc:dev jsreport
    sudo chmod g+w jsreport
    cd jsreport
    mkdir logs
    sudo mkdir /opt/.npm-global
    sudo chown svc:dev /opt/.npm-global
    sudo chmod g+w /opt/.npm-global
    npm config set prefix '/opt/.npm-global'
    export PATH=/opt/.npm-global/bin:$PATH
    source ~/.profile
    sudo npm i -g jsreport-cli
    jsreport init

    chrome dependencies

    sudo apt-get install -y libgconf-2-4
    sudo wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
    sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
    sudo apt-get update
    sudo apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst --no-install-recommends
    sudo rm /etc/apt/sources.list.d/google.list
    node server.js

    start the jsreport server manually on port 5488 (optional)

    node server.js
    --rootDirectory=<rootDirectory>
    --configFile=<configFile>
    --logger.file.filename=<logger>
    --error.file.filename=<error>



  • Looks like its a permission issue on created jsreport files in the temp folder along with a misconfigured supervisord

    Edit 1: Proper permissions in temporary folder with a reboot still causes the error.

    Edit 2: Reboot clears temporary drive which deletes /tmp/jsreport/core/locations.json. I believe it is being caused my supervisord which is creating a location.json file that contains only the following:

    {"/opt/jsreportdev/node_modules/":{"locations":[],"lastSync":1579548899228}}
    

    Edit 3: On my server node server.js only works with parameters after I have initially ran "node server.js" by its self first (and killed it). So running the following commands in the exact order (after reboot) causes jsreport to not throw the original error

    node server.js
    <kill it after it reports "init: reporter initialized">
    node server.js
    --rootDirectory=<rootDirectory>
    --configFile=<configFile>
    --logger.file.filename=<logger>
    --error.file.filename=<error>

    After that point I can run node server.js with parameters whenever I want and there are no issues. Once I remove "/tmp/jsreport/" and try to run it with the parameters, it fails with the original error. To get it working again I have to delete "/tmp/jsreport/" again (since I ran node server.js with parameters and it created a bad file), and then run "node server.js"



  • I will try to follow your install steps when I find some free time.

    In the meantime, you can disable the extension locations cache in locations.json

    node server.js --useExtensionsLocationCache=false



  • I think I solved it. My rootDirectory is pointed to the root directory of my code and not where jsreport is actually installed. Thus when I pass the parameters its looking in different location then where my extensions are installed.



  • Ah ok. Yes, that is how it works.


Log in to reply
 

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