unable to find specified template or user doesnt have permissions to view



  • the code I'm porting is client side code, in the browser that does the calling of the report server. I'm confident that my calls are set up ok, given that the same recipes haven't changed.

    what's new, is on the server side, where i have a completely new jsreportapp folder with current jsreport files.



  • meant to say, none of my templates have been ported. what's in the jsreportapp folder is just the samples.


  • administrators

    hmm that looks strange, since authentication is not enabled i guess there is no users created.

    can you please share the jsreport configuration that you are using? also maybe it is worth to see the client side part that does the request to the jsreport server, just to verify it, and finally can you share the logs that you get when starting jsreport and also when rendering the template that has the error?



  • I'd be more than happy to open up my gitlab repo if you'd like to see it in context.

    code for call to jsreport (typescript)
    '// this.dataSpecification.reportTemplate will be the template name in jsreport editor
    // recipe is html-with-browser-client


    // --- this is called when the data has been gathered for use in the report tool
    onDataReady(data: any) {
    const self = this ;
    console.log(ReportContainer.${self.dataSpecification.reportId}.OnDataReady, data);

    if (data.err) {
      self.errorMessage = data.err ;
      self.hasError = true ;
      console.log(`ReportContainer.${self.dataSpecification.reportId}.ERROR`, data);
      return ;
    }
    
    // build up params
    const requestParms = {
      "template": {
        name: this.dataSpecification.reportTemplate,
        recipe: this.recipe
      },
      "data": data
    };
    console.log('parms to rptserver', requestParms);
    // send API call to server
    this.appInfo.jsreport.renderAsync(requestParms)
      .then(function (res) {
        // goood response, attach to the innerHtml of the div (angular's way of grabbing the html element)
        const mydiv2 = self.rptsection.nativeElement;
        while (mydiv2.firstChild) {
          mydiv2.removeChild(mydiv2.firstChild);
        }
    
        // a way to get .innerHTML to have executable script tags
        const fragment = document.createRange().createContextualFragment(res.toString());
        mydiv2.appendChild(fragment);
    
      }).catch(function(err){
        console.log("Error in jsReport.renderAsync:", err) ;
    });
    

    }

    reporter.log - startup, 1 call to request report

    2019-03-09T00:36:58.130Z - info: Initializing jsreport@2.4.0 in development mode using configuration file: jsreport.config.json
    2019-03-09T00:36:58.131Z - info: Searching for available extensions in /Users/jeffreyj/_source/SpireDashboard/jsreportapp/
    2019-03-09T00:36:58.139Z - info: Extensions location cache contains up to date information, skipping crawling in /Users/jeffreyj/_source/SpireDashboard/jsreportapp/
    2019-03-09T00:36:58.145Z - info: Found 31 extensions
    2019-03-09T00:36:58.162Z - debug: Writing extension locations cache to /var/folders/gd/ddfpm4xx4gb4rnfl_jr7cyxw0000gn/T/jsreport/core/locations.json
    2019-03-09T00:36:58.164Z - debug: Discovered 31 extensions
    2019-03-09T00:36:58.438Z - debug: Extension authentication is disabled, skipping
    2019-03-09T00:36:58.438Z - info: Using extension cli
    2019-03-09T00:36:58.442Z - info: Using extension debug
    2019-03-09T00:36:58.444Z - info: Using extension express
    2019-03-09T00:36:58.565Z - info: Using extension freeze
    2019-03-09T00:36:58.566Z - info: Using extension handlebars
    2019-03-09T00:36:58.568Z - info: Using extension import-export
    2019-03-09T00:36:58.725Z - info: Using extension jsrender
    2019-03-09T00:36:58.725Z - info: Using extension tags
    2019-03-09T00:36:58.727Z - info: Using extension templates
    2019-03-09T00:36:58.729Z - info: Using extension authorization
    2019-03-09T00:36:58.732Z - debug: Extension authorization was disabled
    2019-03-09T00:36:58.732Z - info: Using extension base
    2019-03-09T00:36:58.733Z - info: Using extension browser-client
    2019-03-09T00:36:58.735Z - info: Using extension child-templates
    2019-03-09T00:36:58.741Z - info: Using extension chrome-pdf
    2019-03-09T00:36:58.814Z - debug: Chrome strategy is dedicated-process
    2019-03-09T00:36:58.814Z - info: Using extension data
    2019-03-09T00:36:58.815Z - info: Using extension fs-store
    2019-03-09T00:36:59.126Z - info: Using extension licensing
    2019-03-09T00:36:59.131Z - info: Using extension pdf-utils
    2019-03-09T00:36:59.199Z - info: Using extension reports
    2019-03-09T00:36:59.203Z - info: Using extension studio
    2019-03-09T00:36:59.215Z - debug: studio request logs are enabled (flush interval: 2000)
    2019-03-09T00:36:59.215Z - info: Using extension text
    2019-03-09T00:36:59.216Z - info: Using extension version-control
    2019-03-09T00:36:59.313Z - info: Using extension assets
    2019-03-09T00:36:59.320Z - info: Using extension html-to-xlsx
    2019-03-09T00:36:59.451Z - info: html-to-xlsx detected chrome as available html engine
    2019-03-09T00:36:59.451Z - info: Using extension scheduling
    2019-03-09T00:36:59.489Z - info: Using extension scripts
    2019-03-09T00:36:59.492Z - info: Using extension xlsx
    2019-03-09T00:36:59.582Z - info: Using extension public-templates
    2019-03-09T00:36:59.582Z - debug: Extension public-templates was disabled
    2019-03-09T00:36:59.583Z - info: Using extension resources
    2019-03-09T00:36:59.583Z - info: Using extension sample-template
    2019-03-09T00:36:59.588Z - info: fs store is persisting using fs
    2019-03-09T00:36:59.588Z - info: fs store is synchronizing using fs
    2019-03-09T00:36:59.589Z - info: fs store is loading data
    2019-03-09T00:36:59.605Z - debug: fs store sync is configured to use polling for files watcher
    2019-03-09T00:36:59.649Z - info: fs store is initialized successfully
    2019-03-09T00:36:59.667Z - info: Creating default express app.
    2019-03-09T00:36:59.689Z - info: jsreport server successfully started on http port: 5488
    2019-03-09T00:36:59.689Z - info: fs store emits sockets to synchronize underlying changes with studio
    2019-03-09T00:36:59.706Z - info: Verifying license key free
    2019-03-09T00:37:00.174Z - info: Using enterprise trial license
    2019-03-09T00:37:00.181Z - info: reporter initialized
    2019-03-09T00:37:51.529Z - info: Starting rendering request 1 (user: null)
    2019-03-09T00:37:51.532Z - warn: Error when processing render request Unable to find specified template or user doesnt have permissions to read it: R01GitLabIssues Error: Unable to find specified template or user doesnt have permissions to read it: R01GitLabIssues
    at module.exports (/Users/jeffreyj/_source/SpireDashboard/jsreportapp/node_modules/jsreport-core/lib/util/createError.js:11:13)
    at Reporter.createError (/Users/jeffreyj/_source/SpireDashboard/jsreportapp/node_modules/jsreport-core/lib/reporter.js:265:12)
    at AsyncFunction.<anonymous> (/Users/jeffreyj/_source/SpireDashboard/jsreportapp/node_modules/jsreport-templates/lib/templates.js:134:20)
    2019-03-09T00:37:51.533Z - warn: Error during processing request at http://localhost:5488/api/report



  • any thoughts on this? I'd really like to get this into my application.


  • administrators

    sorry, i forgot about this. it will be much easier for me if i can run the example and check what can be wrong so yes, if you can share your gitlab repository that will help, however if the project is too complex it will take me a while to check it, so make sure to add there the steps needed to run the project and to reproduce it.



  • it's on gitlab. if you want to share or gitlab id or provide an email, i'll get you an invite.

    you can DM me at jeff dot jarrell AT gmail.com



  • i found your email. i've granted you rights to repo. https://gitlab.com/OldProgrammer.io/PepsiCo/SpireDashboard

    in client folder and jsreport app folders run npm install. for client, you need to install angular cli global npm install @angular/cli -g the report is at http://localhost:4200/issues. it's hello world at this point.

    if you have any problems getting set up to run, please let me help.


  • administrators

    sorry if my replies are a bit late but we are a little bit busy working on some other features.

    i'm not sure if i'll get to review this today, but in any case i'll let you know if i have some problem or i can find the solution to your problem


  • administrators

    hi! i was able to run the client and the jsreport normally, however i open http://localhost:4200/issues but i get an error in browser:

    http://localhost:3000/api/gitlab/getissues net::ERR_CONNECTION_REFUSED 
    

    i guess i need to start the server too, right? do you have the needed steps to do it? i tried to run with gulp setenv --env=site (which is listed in your README) but i just got error

    [11:00:00] Using gulpfile /Volumes/DATA/workspace/SpireDashboard/server/gulpfile.js
    [11:00:00] Starting 'setenv'...
    setenvironment.argv { _: [ 'setenv' ], env: 'site' }
    =>sourceFile1: ./src/environments/environment.site.ts targetFile ./src/environments/environment.ts
    sourceFile2: ./src/environments/server.site.ts targetFile ./src/environments/server.env.ts
    
    

    additionally, can you tell me what is the file in which you do the jsreport http call to the server? i'm not well familiar with angular so if you can point the file in which is the ajax request it will help



  • yes, you do need to run the server part; although, there isn't much there. at this point, the report template is basically hello world. If necessary I could hack it . so you don't need server.

    so in the server folder --- npm install, then gulp serve.
    net you'll have three processes, client$ ng server, server$ gulp server, and jsreportapp$ node server.js

    keep me posted if you need anything. this worked great on a previous gig. i think it will work great here. ;)



  • Oops. Never mind. Found a typo in my template name. Sorry for the confusion.


  • administrators

    ah yes, i see it too, the real template is R01GitLabIsues not R01GitLabIssues. sometimes happens 😄


Log in to reply
 

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