Report content removed on server restart



  • I am evaluating jsreport on-prem (free license). I've got everything installed and configured. I am using the "getting started" tutorial. I can use studio, the report renders, and I can call the API externally to retrieve the report. Everything works perfectly fine... until I restart the VM.

    When the VM comes back up, the window services starts back up fine, but the content of the reports is gone. There is no js, no function, even the sample data association and rest of the "properties" are gone. The files are still physically there, but they are entirely empty.

    Has anyone experienced this? Is it a strange limitation with being a free license? Is there something in the installation/configuration that I missed or isn't defined? We really like what we have seen with jsreport so far, but obviously this is a major showstopper for our company to proceed further with purchasing an enterprise license.



  • This has nothing to do with the licensing.
    It is about configuring jsreport to persist data.

    Have you run the jsreport configure after installing jsreport?
    One of the wizard's question is about configuring jsreport to persist data.

    You can also configure jsreport by hand using jsreport.config.json and adding this in particular.

    "store": {
        "provider": "fs"
    }
    

    The data/template stores documentation...
    https://jsreport.net/learn/template-stores



  • Thank you jan. Yes, I did run jsreport configure, though I just ran the defaults on all of the prompts.

    For the sake of this issue, I ran it again and paid closer attention. I again chose the defaults.
    0_1572730739474_upload-905e0fec-a42c-4d4b-ac97-e917ecff2d6a

    I then checked the jsreport.config.json file and made sure I had the "store" entry as you have shown
    0_1572730847305_upload-8f7e8fe9-0467-40b8-b1f8-04306b5607d8

    Next, I went to Studio and recreated the invoice-sample report, clicked on 'Save All', and then 'Run' to make sure it rendered.
    0_1572730967030_upload-36ce2c7d-4b13-4fe8-9444-058b67e97e48

    I then hit the API externally via Postman to confirm that the report was downloaded and all good (which it was).

    I then restarted the VM. The problem still presents.

    I checked the jsreport.config.json to make sure it was still set to store, which it is
    0_1572731495974_upload-81ee804d-9128-4055-9d2b-c754635efcbd

    However, my report is empty again
    0_1572731550496_upload-18ac3b46-fee1-40c2-b3da-ac546af13ace

    Could this have anything to do with how I have the report structured? Perhaps it could be permission based on my VM (which I will check in the meantime). Any other ideas?



  • Another observation I just made. I checked the actual content.handlebars file for my invoice-template. The code is still in the file. It's just not getting "seen" by Studio.
    0_1572733722564_upload-1a30ec58-f8f7-47d9-97cd-75512d99cb02

    EDIT
    Here's a full screenshot showing the file content and what Studio is [not] showing
    0_1572734084370_upload-97fdff6e-1d1f-477d-9c1b-ad06561dd69c



  • Hm. Nothing comes to my mind. It seems your configuration is fine. Please try to isolate the problem.

    What if you just restart the jsreport. Do you also lose the content?
    What if you create just "hello" template in the root, do you also lose it after restart?
    Can you try it also in a fresh install outside the VM on your dev machine?
    Are there some errors in the jsreport log (logs folder) or if you open F12 browser console?

    Thanks for your help with isolating the problem.



  • Sorry for the delay jan.

    • What if you just restart the jsreport. Do you also lose the content?
      Yes. I tried stopping then starting the service, as well as restarting the service. Content loss both times in invoice-template.

    • What if you create just "hello" template in the root, do you also lose it after restart?
      This is what happened when I created a "hello" template in the root with a simple text of 'hello' and clicked on SaveAll
      0_1572797405047_upload-c5e98372-cb18-4641-9677-683d92a3ee66
      But once I clicked off the message, the save seemed to have completed and I could render the report. I bounced the server and checked Studio. The "hello" content is still there.

    • Can you try it also in a fresh install outside the VM on your dev machine?
      I'll check this one later, if I need to. This is just a test VM with nothing but jsreport on it so I can completely blow it away and start fresh 100% if I need to.

    • Are there some errors in the jsreport log (logs folder) or if you open F12 browser console?
      Nothing in the console/dev tools for either IE nor Chrome.

    • This is the content of error.log:
      2019-11-03T16:08:15.233Z - error: Error when processing OData PATCH: /odata/templates(Ohv7KTEF68ZB6e7a) Error: EBUSY: resource busy or locked, rmdir 'C:\jsreportapp\data\templates\invoice-template'
      at Object.remove (C:\jsreportapp\node_modules\jsreport-fs-store\lib\fileSystem.js:93:11)
      at persist (C:\jsreportapp\node_modules\jsreport-fs-store\lib\persistence.js:215:14)
      at async lock (C:\jsreportapp\node_modules\jsreport-fs-store\lib\persistence.js:294:12)
      at async Object.fn (C:\jsreportapp\node_modules\jsreport-fs-store\lib\provider.js:163:9)

    • And in reporter.log, there are a lot of info entries about Using extension, rs store, and being initialized. However, this error entry looks problematic and associated with the error.log entry:
      2019-11-03T16:13:00.604Z - error: Error occured during reporter init Error: EBUSY: resource busy or locked, rmdir 'C:\jsreportapp\data\templates\invoice-template'
      at Object.remove (C:\jsreportapp\node_modules\jsreport-fs-store\lib\fileSystem.js:93:11)
      at load (C:\jsreportapp\node_modules\jsreport-fs-store\lib\persistence.js:144:14)

    With all of the above findings, it looks like the issue is isolated to my specific invoice-template somehow. To test the theory out, I recreated the "Getting Started" example entirely. From root, I created a new "invoice" folder and created new template/sample data according to the guide. I made sure the report rendered and then bounced the server to see what happens on restart. As soon as the server came up, I checked Studio, and my new invoice report was all still there and functional.

    I'm not sure what could have happened with my original invoice-template, but being that it was my first experience with jsreport I'm sure it's possible I did something along the way to impact it. Now that I have a much better understanding of the platform and what to look for, I'll keep an eye on it.

    Thank you for taking the time to help out a free license evaluation jan; and quite rapidly at that! Much appreciated!


Log in to reply
 

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