Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-15000

Rhino: Handlebars.js is not multithreaded

    XMLWordPrintable

Details

    Description

      Steps to reproduce

       

      1). Install IDM

      2). in the conf directory, replace sync.json, managed.json with the ones attached here and place provisioner<>.json in there as well

      3). replace the openidm/script with the zip file script.zip

      4). replace the onCreateUser.js found in openidm/bin/defaults/script with the one attached here.

      5).  Make sure to place the CSV file in openidm/data directory so everything runs at once

      6).  Start up IDM ./startup.sh

      7).  Set up a local email system(fakeSMTP) and configure it to handle emails

       

      What should happen is when we go to reconcile, users who have test.org will not be sent an email on create.  Those with example.com should be sent emails.  All users should appear in IDM User List.

       

      What actually happens:

      When users are reconciled, not all users in the CSV file will show up in the users list.  What happens is when this code runs:

       

        email.body = template({  email.body = template(

      {                    "object": object               }

      );

       

      It is calling handlebars.  Reconciliation is multithreaded.  When called, we see errors in the logs (take a look at log file attached)

       

      Caused by: org.forgerock.openidm.script.ScriptThrownException:

      {message=Parse error on line 1: .... Your username is ' -----------------------^ Expecting 'EOF', 'COMMENT', 'CONTENT', 'END_RAW_BLOCK', 'OPEN_RAW_BLOCK', 'OPEN_BLOCK', 'OPEN_INVERSE', 'OPEN_INVERSE_CHAIN', 'INVERSE', 'OPEN_ENDBLOCK', 'OPEN', 'OPEN_UNESCAPED', 'OPEN_PARTIAL', 'OPEN_PARTIAL_BLOCK', got '1'}

      {message=Parse error on line 1:
      .... Your username is '
      -----------------------^

       

      Not only that, not all users get reconciled.  The number will vary depending on when the thread fails.  In my example, this will only affect those with example.com

       

      Workaround:

      Set 

      "taskThreads" : 0

      or comment out the code 

      email.body = template({  email.body = template(

      {                    "object": object               }

      );

       

       

      Attachments

        Issue Links

          Activity

            People

              travis.haagen Travis Haagen [X] (Inactive)
              jesse.ontiveros Jesse Ontiveros
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: