I figured it out. I was using site.localhost which meant everything pointed to 127.0.0.1
Posts made by MrGiga
-
RE: Docker Image and JSReport
-
Docker Image and JSReport
TLDR; I am unable to get jsreport docker image to resolve the assets even after updating the hosts file in the container.
My setup is the following (all docker images):
- JSReport Server
- Apache Server
- PHP-FPM with Source Code
Requests come in the following way
Apache Server -> PHP-FPM through a proxy setup in site configuration file.My end goal is this
Apache Server -> PHP-FPM -> JSReport Server -> Apache Server (when needing to resolve assets)I update the host file in the container to contain the proper url and the ip. I have the url set in "extensions_base_url" and "extentions_asset_rootUrlForLinks" (might be overkill). My reports load fine through html but pdf does not.
Logs return:debug: Failed to load resource: net::ERR_CONNECTION_REFUSED
If I access the container, install curl and put in the asset urls, the CSS returns fine. How can I debug this further?
I am interesting in doing extremely minimal deployment so I am avoiding loading the assets as volumes at this time.
-
RE: Rendering Parent and Child Templates With No Local Storage
There is no solution if I only want to output html, correct?
-
RE: Rendering Parent and Child Templates With No Local Storage
Can I merge more then one template? I am trying to see if I can implement a standalone jsreport server that only generates reports through API.
In this example: https://playground.jsreport.net/w/admin/dI2_fUqZ Are items saved in a template store?
Edit: Nevermind looks like the documentation answers my question.
-
Rendering Parent and Child Templates With No Local Storage
If I am sending the template solely through template['content'], how do I send any child template that it references?
Using the example: https://playground.jsreport.net/w/admin/hG7mEoll
I can see the contents "Orders" being sent over http but I don't see the contents of "OrdersHeader".
-
RE: RootOptions.store.provider requiring value "Memory"
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.
-
RE: RootOptions.store.provider requiring value "Memory"
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"
-
RE: RootOptions.store.provider requiring value "Memory"
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 nodejsinstall 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 initchrome 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.jsstart the jsreport server manually on port 5488 (optional)
node server.js
--rootDirectory=<rootDirectory>
--configFile=<configFile>
--logger.file.filename=<logger>
--error.file.filename=<error> -
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