Desktop productivity for business analysts and programmers

Unable to create object SASEGObjectModel using Jenkins

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

Unable to create object SASEGObjectModel using Jenkins

[ Edited ]

I've been trying to automate a vbs script (generated by Enterprise Guide 7.1) using Jenkins and am not able to troubleshoot the error. I've read many similar post here on sas community and have tried all the solutions that were suggested, but still having the issue. Please find the detailed explanation of the error below:

 

I'm trying to run the below script using Jenkins' Windows batch execution :

%windir%\System32\cscript.exe "~dir\EGScript1.vbs"

and I'm getting the error:


Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.
~dir\EGScript1.vbs(7, 1) Microsoft VBScript runtime error: Object required

 

 

The vbs script works perfectly using command prompt and even with windows task scheduler.

 

After investigation, I found out that the issue is in creating this object Set app = CreateObject("SASEGObjectModel.Application.7.1"). For testing purpose I verified the line-- Set app = CreateObject("excel.application") which works perfectly fine (even in Jenkins).

I've tried all the options that were suggested including the links below:
https://communities.sas.com/t5/SAS-Enterprise-Guide/schedule-task-in-sas-eg/td-p/212052
https://communities.sas.com/t5/SAS-Enterprise-Guide/VBScript-error-could-not-locate-automation-class...

 

I'm using 64 bit machine and my EG is also 64 bit. I've also tried to run the below statement, but still getting the error of SASEGObjectModel.Application.7.1 using Jenkins.

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm /codebase /tlb "C:\Program Files\SASHome\SASEnterpriseGuide\7.1\SASEGScripting.dll"


Please suggest and let me know if anymore info is required.

 

Thanks in advance.


Accepted Solutions
Solution
‎10-17-2017 06:09 PM
SAS Super FREQ
Posts: 401

Re: Unable to create object SASEGObjectModel using Jenkins

Posted in reply to diwakar_atwal

A couple things to check...

  1. Is Enterprise Guide 7.1 installed on the machine on which your Jenkins job is running?
  2. What user account is your Jenkins job running under?  (add "whoami" command to your Jenkins job to confirm)  Perhaps it is running as a different user than yourself (ex. service account)?

Casey

View solution in original post


All Replies
Solution
‎10-17-2017 06:09 PM
SAS Super FREQ
Posts: 401

Re: Unable to create object SASEGObjectModel using Jenkins

Posted in reply to diwakar_atwal

A couple things to check...

  1. Is Enterprise Guide 7.1 installed on the machine on which your Jenkins job is running?
  2. What user account is your Jenkins job running under?  (add "whoami" command to your Jenkins job to confirm)  Perhaps it is running as a different user than yourself (ex. service account)?

Casey

Occasional Contributor
Posts: 5

Re: Unable to create object SASEGObjectModel using Jenkins

[ Edited ]
Posted in reply to CaseySmith

Thank you Casey for the lead. Issue is resolved now.

 

I checked few things as you suggested:

Jenkins jobs were running under user- NT Authority\system
So I changed the LOG ON information in Jenkins service and restarted it.

 

Then I got a different error:

Failed to open SAS.Shared.DNADecoder. Reason: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception.
LibGit2Sharp
Int32 git_libgit2_init()
at LibGit2Sharp.Core.NativeMethods.git_libgit2_init()
at LibGit2Sharp.Core.NativeMethods.LibraryLifetimeObject..ctor()
at LibGit2Sharp.Core.NativeMethods..cctor()

 

which I resolved using the below link :
https://communities.sas.com/t5/SAS-Enterprise-Guide/Execute-SAS-Program-via-VBA-LibGit2Sharp-Core-Na...

 

Since Jenkins' Windows batch command is invoked in "x86" (checked with 'whoami'). So I called my cscript using SYSNATIVE instead of SYSTEM32
%windir%\Sysnative\cscript.exe "~dir\EGScript1.vbs"

 

And now vbscript is able to create object SASEGObjectModel and entire program is running like a charm.

 

Thank you so much for your help.

SAS Super FREQ
Posts: 401

Re: Unable to create object SASEGObjectModel using Jenkins

Posted in reply to diwakar_atwal

Happy to help.  Glad you got it resolved!

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 770 views
  • 4 likes
  • 2 in conversation