Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-39332

ApiSlRuntimeErrors.UnsafeCode error during analysis

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Blocker Blocker

      Receiving the following error when running the plugin. The scenario completes, but the analysis fails. I'm using version 4.5.0 of the plugin.

      starting analysis launcher
      creating analysis COM object
      creating analysis session
      Loader Manager initialization failed.
      at Analysis.ApiSL.ApiSlRuntimeErrors.Throw(Int32 aErrorCode, ApiException aException)
      at Analysis.ApiSL.ApiSlRuntimeErrors.UnsafeCode(UnsafeCodeHandlerBool aHandler, Int32 aLraErrorCode)
      at Analysis.Api.Session.CreateWithTemplateFile(String aSessionName, String aResultFileName, String aTemplateFileName)
      at LRAnalysisLauncher.Program.Main(String[] args)
      time passed: 00::00:00:01
      Error: Error during Analysis run. See output console for details
      analysis report generator finished
      Error(s) summary:
      0 ignored , 0 errors

      This same Jenkins job worked on a different LR controller host (as a Jenkins slave), but is failing on this host. I get the same error when running at the command prompt.

      After the error occurs, the LRA and LRR dirs get created, but the HTML does not. Here are the contents:

          9eb25c\
              LRA\
                  LRA.mdb
              LRR\
                  log\
                      validate_10.log
                  sum_data\
                      graph_0-5.dat
                      sum_dat.ini
          9eb25c\
              LRA\
                  LRA.mdb
              LRR\
                  log\
                      validate_10.log
                  sum_data\
                      graph_0-5.dat
                      sum_dat.ini
                  _t_rep.eve             1 KB
                  api1_script_1.cfg      3 KB  <- "api1_script" is the name
                  api1_script_1.cfg.bak  3 KB     of my LR script.
                  api1_script_1.usp      4 KB
                  collate.txt            1 KB
                  collateLog.txt         1 KB
                  crossvusertrans_error_report.txt  0 KB
                  ei669vwin_1.eve.gzl    4 KB  <- "ei669vwin" is the name 
                  ei669vwin.map          4 KB      of the load generator host.
                  LRR.lrr                1 KB
                  offline.dat            0 KB
                  output.mdb           528 KB
                  read_eve.log           1 KB
                  remote_results.txt     1 KB
                  SLAConfiguration.xml   4 KB
      

        1. build.xml
          0.9 kB
        2. changelog.xml
          0.0 kB
        3. config.xml
          2 kB
        4. jenkins_master_config.zip
          4 kB
        5. junitResult.xml
          0.2 kB
        6. log
          3 kB
        7. lrr_reports.png
          lrr_reports.png
          67 kB
        8. lrr_templates.png
          lrr_templates.png
          84 kB
        9. props23022017071217048.txt
          6 kB
        10. screenshot-1.png
          screenshot-1.png
          11 kB
        11. screenshot-2.png
          screenshot-2.png
          14 kB
        12. screenshot-3.png
          screenshot-3.png
          22 kB
        13. screenshot-4.png
          screenshot-4.png
          210 kB
        14. screenshot-5.png
          screenshot-5.png
          211 kB
        15. SS1.JPG
          SS1.JPG
          190 kB
        16. SS2.JPG
          SS2.JPG
          58 kB
        17. SS3.JPG
          SS3.JPG
          18 kB
        18. SS4.JPG
          SS4.JPG
          93 kB
        19. System Information [Jenkins].pdf
          91 kB
        20. UncheckAllBoxesInResult.JPG
          UncheckAllBoxesInResult.JPG
          27 kB

          [JENKINS-39332] ApiSlRuntimeErrors.UnsafeCode error during analysis

          Yafim Kazak added a comment - - edited
          • Could you please try to uncheck the second checkbox in the option menu and try to run again?
            It's not necessary when running using Jenkins - since the plugin tries to create new directory regardless of this option.
          • Did the first host (the one without the issue) was of the same version of LR?
            I will try to reproduce it on the same LR version you have ( the plugin is constantly tested on the latest versions of LR) to see if it's LR 12.02 specific issue or a plugin issue.

          Yafim Kazak added a comment - - edited Could you please try to uncheck the second checkbox in the option menu and try to run again? It's not necessary when running using Jenkins - since the plugin tries to create new directory regardless of this option. Did the first host (the one without the issue) was of the same version of LR? I will try to reproduce it on the same LR version you have ( the plugin is constantly tested on the latest versions of LR) to see if it's LR 12.02 specific issue or a plugin issue.

          Ethan Vaughn added a comment -

          Could you please try to uncheck the second checkbox in the option menu and try to run again?

          Unchecked and still got the error.

          Did the first host (the one without the issue) was of the same version of LR?

          Yes. The original slave host was also running 12.02.0.0.

          Ethan Vaughn added a comment - Could you please try to uncheck the second checkbox in the option menu and try to run again? Unchecked and still got the error. Did the first host (the one without the issue) was of the same version of LR? Yes. The original slave host was also running 12.02.0.0.

          Yafim Kazak added a comment - - edited

          Could please try to open the LRR scenario (from the 9eb25C folder) in analysis and see if it's able to create a session successfully?

          And under "Tools"->"Templates":

          Make sure that there is at least one default template like here:

          By looking more into the code - it seems that your missing the default report template for analysis (the third screenshot).

          Just to be on the safe side:
          Could you please see if there are listing of report templates in the following menu:

          Yafim Kazak added a comment - - edited Could please try to open the LRR scenario (from the 9eb25C folder) in analysis and see if it's able to create a session successfully? And under "Tools"->"Templates": Make sure that there is at least one default template like here: By looking more into the code - it seems that your missing the default report template for analysis (the third screenshot). Just to be on the safe side: Could you please see if there are listing of report templates in the following menu:

          Ethan Vaughn added a comment -

          The tools->Templates and Reports->Report Templates look like they are set to factory defaults:

          Ethan Vaughn added a comment - The tools->Templates and Reports->Report Templates look like they are set to factory defaults:

          Yafim Kazak added a comment - - edited

          Yes they seem fine.
          It seems that for some reason that analysis can't create a session from you LRR - did you succeed doing that manually with that LRR?

          Which windows version does the node use?
          What's the user Jenkins has been using?

          Can you please follow this instruction on our plugin page and change the setting of your jenkins user - it shouldn't be set on local system account -
          https://wiki.jenkins-ci.org/display/JENKINS/HP+Application+Automation+Tools#HPApplicationAutomationTools-SlavesandTestingToolsInstallation

          Yafim Kazak added a comment - - edited Yes they seem fine. It seems that for some reason that analysis can't create a session from you LRR - did you succeed doing that manually with that LRR? Which windows version does the node use? What's the user Jenkins has been using? Can you please follow this instruction on our plugin page and change the setting of your jenkins user - it shouldn't be set on local system account - https://wiki.jenkins-ci.org/display/JENKINS/HP+Application+Automation+Tools#HPApplicationAutomationTools-SlavesandTestingToolsInstallation

          Gary Chen added a comment -

          I have the same problem too.
          Windows 7 Pro 64-bit
          Jenkins ver. 2.32.1
          LoadRunner 12.53

          It will create the LRA.mdb only. I compare the LRA.mdb created by Jenkins and Analysis. the one Jenkins created have missed many tables. I also created a VS 2015 project and can reproduce this problem.

          Regards,
          Gary

          Gary Chen added a comment - I have the same problem too. Windows 7 Pro 64-bit Jenkins ver. 2.32.1 LoadRunner 12.53 It will create the LRA.mdb only. I compare the LRA.mdb created by Jenkins and Analysis. the one Jenkins created have missed many tables. I also created a VS 2015 project and can reproduce this problem. Regards, Gary

          Yafim Kazak added a comment - - edited

          Hi,
          Which plugin version do you use?
          Do you use any of the LR 12.53 patches?

          Please also try the following -
          In your scenario, under results, results settings, do not set the 'automatically create a results directory for each scenario execution'.
          save and run again.

          Please make sure you're following guidelines for setting Jenkins slave on the LR node - https://wiki.jenkins-ci.org/display/JENKINS/HP+Application+Automation+Tools#HPApplicationAutomationTools-SlavesandTestingToolsInstallation.

          Could you please upload the configuration -
          Jenkins configuration files - build.xml, Log, Config.xml - all obtainable from Jenkins folder on master- for example:
          C:\Jenkins\jjobs\<Job Name>\config.xml, c:\Jenkins\jobs\<job name>\builds\<failed build id>\log,build.xml.

          And any information possible on your configuration - i.e.:

          • Jenkins master and slave on same machine?
          • does the script and scenario reside on the same machine as the Jenkins node or you use UNC path?
          • Did you follow the above guidelines and verified there is no change in LR default configuration or analysis? (especially - result menu under
          • LoadRunner 12.53 without any patches?

          You can also send it to: kazak- at- hpe - dot - com.

          I will try to reproduce again and update.

          Thanks ahead

          Yafim Kazak added a comment - - edited Hi, Which plugin version do you use? Do you use any of the LR 12.53 patches? Please also try the following - In your scenario, under results, results settings, do not set the 'automatically create a results directory for each scenario execution'. save and run again. Please make sure you're following guidelines for setting Jenkins slave on the LR node - https://wiki.jenkins-ci.org/display/JENKINS/HP+Application+Automation+Tools#HPApplicationAutomationTools-SlavesandTestingToolsInstallation . Could you please upload the configuration - Jenkins configuration files - build.xml, Log, Config.xml - all obtainable from Jenkins folder on master- for example: C:\Jenkins\jjobs\<Job Name>\config.xml, c:\Jenkins\jobs\<job name>\builds\<failed build id>\log,build.xml. And any information possible on your configuration - i.e.: Jenkins master and slave on same machine? does the script and scenario reside on the same machine as the Jenkins node or you use UNC path? Did you follow the above guidelines and verified there is no change in LR default configuration or analysis? (especially - result menu under LoadRunner 12.53 without any patches? You can also send it to: kazak- at- hpe - dot - com. I will try to reproduce again and update. Thanks ahead

          Ed B added a comment - - edited

          Hi,

          I have the same issue, "The scenario completes, but the analysis fails", and I've tried all the solutions mentioned in the above threads:

          Windows 7 Enterprise,
          Jenkins version 2.7.1,
          LoadRunner 12.53 No patches,
          Post Build Actions: Do not archive HP test reports,
          The .lrs scenario and all components of Loadrunner are installed on the Jenkins server,
          Not using the Jenkins Local System Account User Type,
          No boxes are checked under Set Results Directory dialog,
          The tools->Templates and Reports->Report Templates are set to factory default just like in the pictures Ethan provided,
          Running the scenario outside of Jenkins then viewing the results in Analysis works fine

          The Analyzing results... section of the Console Output states that:

          The Analysis launcher gets passed the arguments: "C:\Jenkins\workspace\EclipseLR_Scenario\4ecd5c\LRR\LRR.lrr" "C:\Jenkins\workspace\EclipseLR_Scenario\4ecd5c\LRA\LRA.lra" "C:\Jenkins\workspace\EclipseLR_Scenario\4ecd5c\HTML\HTML.html"

          However the Directory HTML and all of its contents under 4ecd5c is missing on my machine. How/when does the path and the HTML.HTML file get created and what could prevent it's creation? Subsequently, the Analyzing results... sections states:

          Loader Manager initialization failed.
          at Analysis.ApiSL.ApiSlRuntimeErrors.Throw(Int32 aErrorCode, ApiException aException)
          at Analysis.ApiSL.ApiSlRuntimeErrors.UnsafeCode(UnsafeCodeHandlerBool aHandler, Int32 aLraErrorCode)
          at Analysis.Api.Session.CreateWithTemplateFile(String aSessionName, String aResultFileName, String aTemplateFileName)
          at LRAnalysisLauncher.Program.Main(String[] args)

          and reports that an error occurred during the Analysis run.

          Jenknis Console Output:

          log props23022017071217048.txt build.xml config.xml junitResult.xml changelog.xml

          Started by user EB <http://ComputerName:8080/user/EB>

          Building in workspace C:\Jenkins\workspace\EclipseLR_Scenario

          [EclipseLR_Scenario] $ C:\Jenkins\workspace\EclipseLR_Scenario\HpToolsLauncher.exe -paramfile props23022017071217048.txt

          "Started..."

          Launcher timeout is 00::00:10:00

          reading PerScenarioTimeout: 600

          PerScenarioTimeout: 10:00:00 minutes

          PerScenarioTimeout: 00::10:00:00 minutes FileSystemTestRunner timeout is 00:10:00 Mc connection info is - Mc HostAddress: , McPort: 8080, Username: , UseSSL: 0, UseProxy: 0, ProxyType: 0, ProxyAddress: , ProxyPort: 0, ProxyAuth: 0, ProxyUser:

          1 tests found:

          C:\2-16-17\LR_Selenium_N__Net_Scenario_2-16-17.lrs

          ============================================================================

          23/02/2017 07:12:17 Running: C:\2-16-17\LR_Selenium_N__Net_Scenario_2-16-17.lrs

          Cleaning up the environment...

          wlrun killed

          Preparing scenario C:\2-16-17\LR_Selenium_N__Net_Scenario_2-16-17.lrs for execution.

          Load Generator localhost connected

          setting scenario result folder to C:\Jenkins\workspace\EclipseLR_Scenario\4ecd5c\LRR

          scenario result folder: C:\Jenkins\workspace\EclipseLR_Scenario\4ecd5c\LRR

          Starting scenario...

          Scenario C:\2-16-17\LR_Selenium_N__Net_Scenario_2-16-17.lrs ended after 0:0:30.

          ============================================================================

          Analyzing results...

          closing Controller

          Controller closed

          calling analysis report generator

          executing Analysis launcher with arguments : "C:\Jenkins\workspace\EclipseLR_Scenario\4ecd5c\LRR\LRR.lrr" "C:\Jenkins\workspace\EclipseLR_Scenario\4ecd5c\LRA\LRA.lra" "C:\Jenkins\workspace\EclipseLR_Scenario\4ecd5c\HTML\HTML.html"

          time for analysis: 00::10:00:00

          starting analysis launcher

          creating analysis COM object

          creating analysis session

          Loader Manager initialization failed.

          at Analysis.ApiSL.ApiSlRuntimeErrors.Throw(Int32 aErrorCode, ApiException aException)

          at Analysis.ApiSL.ApiSlRuntimeErrors.UnsafeCode(UnsafeCodeHandlerBool aHandler, Int32 aLraErrorCode)

          at Analysis.Api.Session.CreateWithTemplateFile(String aSessionName, String aResultFileName, String aTemplateFileName)

          at LRAnalysisLauncher.Program.Main(String[] args) time passed: 00::00:00:03

          Error: Error during Analysis run. See output console for details analysis report generator finished

          Error(s) summary:

          0 ignored , 0 errors

          Test PASSED

          Test result: Error

          23/02/2017 07:13:42 Test complete: C:\2-16-17\LR_Selenium_N__Net_Scenario_2-16-17.lrs

          -------------------------------------------------------------------------------------------------------

          Cleaning up the environment...

          ================================================

          Run status: Job failed, total tests: 1, succeeded: 0, failures: 0, errors: 1 Error : C:\2-16-17\LR_Selenium_N__Net_Scenario_2-16-17.lrs

          ================================================

          Build step 'Execute HP tests from file system' changed build result to FAILURE

          Finished: FAILURE

          Ed B added a comment - - edited Hi, I have the same issue, "The scenario completes, but the analysis fails", and I've tried all the solutions mentioned in the above threads: Windows 7 Enterprise, Jenkins version 2.7.1, LoadRunner 12.53 No patches, Post Build Actions: Do not archive HP test reports, The .lrs scenario and all components of Loadrunner are installed on the Jenkins server, Not using the Jenkins Local System Account User Type, No boxes are checked under Set Results Directory dialog, The tools->Templates and Reports->Report Templates are set to factory default just like in the pictures Ethan provided, Running the scenario outside of Jenkins then viewing the results in Analysis works fine The Analyzing results... section of the Console Output states that: The Analysis launcher gets passed the arguments: "C:\Jenkins\workspace\EclipseLR_Scenario\4ecd5c\LRR\LRR.lrr" "C:\Jenkins\workspace\EclipseLR_Scenario\4ecd5c\LRA\LRA.lra" "C:\Jenkins\workspace\EclipseLR_Scenario\4ecd5c\HTML\HTML.html" However the Directory HTML and all of its contents under 4ecd5c is missing on my machine. How/when does the path and the HTML.HTML file get created and what could prevent it's creation? Subsequently, the Analyzing results... sections states: Loader Manager initialization failed. at Analysis.ApiSL.ApiSlRuntimeErrors.Throw(Int32 aErrorCode, ApiException aException) at Analysis.ApiSL.ApiSlRuntimeErrors.UnsafeCode(UnsafeCodeHandlerBool aHandler, Int32 aLraErrorCode) at Analysis.Api.Session.CreateWithTemplateFile(String aSessionName, String aResultFileName, String aTemplateFileName) at LRAnalysisLauncher.Program.Main(String[] args) and reports that an error occurred during the Analysis run. Jenknis Console Output: log props23022017071217048.txt build.xml config.xml junitResult.xml changelog.xml Started by user EB < http://ComputerName:8080/user/EB > Building in workspace C:\Jenkins\workspace\EclipseLR_Scenario [EclipseLR_Scenario] $ C:\Jenkins\workspace\EclipseLR_Scenario\HpToolsLauncher.exe -paramfile props23022017071217048.txt "Started..." Launcher timeout is 00::00:10:00 reading PerScenarioTimeout: 600 PerScenarioTimeout: 10:00:00 minutes PerScenarioTimeout: 00::10:00:00 minutes FileSystemTestRunner timeout is 00:10:00 Mc connection info is - Mc HostAddress: , McPort: 8080, Username: , UseSSL: 0, UseProxy: 0, ProxyType: 0, ProxyAddress: , ProxyPort: 0, ProxyAuth: 0, ProxyUser: 1 tests found: C:\2-16-17\LR_Selenium_N__Net_Scenario_2-16-17.lrs ============================================================================ 23/02/2017 07:12:17 Running: C:\2-16-17\LR_Selenium_N__Net_Scenario_2-16-17.lrs Cleaning up the environment... wlrun killed Preparing scenario C:\2-16-17\LR_Selenium_N__Net_Scenario_2-16-17.lrs for execution. Load Generator localhost connected setting scenario result folder to C:\Jenkins\workspace\EclipseLR_Scenario\4ecd5c\LRR scenario result folder: C:\Jenkins\workspace\EclipseLR_Scenario\4ecd5c\LRR Starting scenario... Scenario C:\2-16-17\LR_Selenium_N__Net_Scenario_2-16-17.lrs ended after 0:0:30. ============================================================================ Analyzing results... closing Controller Controller closed calling analysis report generator executing Analysis launcher with arguments : "C:\Jenkins\workspace\EclipseLR_Scenario\4ecd5c\LRR\LRR.lrr" "C:\Jenkins\workspace\EclipseLR_Scenario\4ecd5c\LRA\LRA.lra" "C:\Jenkins\workspace\EclipseLR_Scenario\4ecd5c\HTML\HTML.html" time for analysis: 00::10:00:00 starting analysis launcher creating analysis COM object creating analysis session Loader Manager initialization failed. at Analysis.ApiSL.ApiSlRuntimeErrors.Throw(Int32 aErrorCode, ApiException aException) at Analysis.ApiSL.ApiSlRuntimeErrors.UnsafeCode(UnsafeCodeHandlerBool aHandler, Int32 aLraErrorCode) at Analysis.Api.Session.CreateWithTemplateFile(String aSessionName, String aResultFileName, String aTemplateFileName) at LRAnalysisLauncher.Program.Main(String[] args) time passed: 00::00:00:03 Error: Error during Analysis run. See output console for details analysis report generator finished Error(s) summary: 0 ignored , 0 errors Test PASSED Test result: Error 23/02/2017 07:13:42 Test complete: C:\2-16-17\LR_Selenium_N__Net_Scenario_2-16-17.lrs ------------------------------------------------------------------------------------------------------- Cleaning up the environment... ================================================ Run status: Job failed, total tests: 1, succeeded: 0, failures: 0, errors: 1 Error : C:\2-16-17\LR_Selenium_N__Net_Scenario_2-16-17.lrs ================================================ Build step 'Execute HP tests from file system' changed build result to FAILURE Finished: FAILURE

          Yafim Kazak added a comment -

          Hi,

          after long investigation - we have discovered that currently, you shouldn't install LeanFT and LoadRunner on same machine.

          Yafim Kazak added a comment - Hi, after long investigation - we have discovered that currently, you shouldn't install LeanFT and LoadRunner on same machine.

          Yafim Kazak added a comment -

          Currently,

          to solve this - please do not install LeanFT and LoadRunner on the same machine.

          Yafim Kazak added a comment - Currently, to solve this - please do not install LeanFT and LoadRunner on the same machine.

            yafim_kazak Yafim Kazak
            ethanvaughn Ethan Vaughn
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: