RunningPackages problem
HI, I am using the following code to retreive all running packages on a specific machine. I am referencing and using Dts.Runtime like this: using Microsoft.SqlServer.Dts.Runtime; Here is the code: string MachineName = Dts.Variables["MachineName"].Value.ToString(); Microsoft.SqlServer.Dts.Runtime. Application ssisApplication = new Microsoft.SqlServer.Dts.Runtime.Application(); string thisPackgeName = Dts.Variables["PackageName"].Value.ToString(); RunningPackages Pkgs = ssisApplication.GetRunningPackages(MachineName); My script task fails at the last line of code with the following exception: Description: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.OverflowException: Arithmetic operation resulted in an overflow. at Microsoft.SqlServer.Dts.Server.DtsServer.RunningPackageConvert(RunningPackage package, DTSRunningPackage100& copy) at Microsoft.SqlServer.Dts.Server.DtsServer.GetRunningPackages() at Microsoft.SqlServer.Dts.Runtime.Application.GetRunningPackages(String server) at ST_a2b6c737446e4507800fe8d7f8d49f30.csproj.ScriptMain.Main() --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript() What I do not understand is that code has been running fine for more than a year and since 2-3 weeks, it fails. Is there something I am missing? Thanks, Ccote
July 1st, 2011 4:14pm

Could be several reasons: 1) An update installation that went wrong, 2) A security issue (because checking packages on a remote machine requires a full admin rights), 3) A variable MachineName (check to make sure) contains an incorrect value, and 4) Could be that you need a latest servive pack + CUs (perhaps a KB of some sort was recently applied) To resolve try the following path: a) run regsvr32 dts.dll (this way you address #1), then if does not help b) Apply any missing SPs + CUs, and then c) Use process explorer from SysInternals to figure out what module throws this error then will see what to do if you are still having this nuance.Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
July 2nd, 2011 8:22pm

HI ArthurZ, thank for your help. I noticed that when I try to get the list of running packages while connected to SSIS service in SSMS, I get the Arithmetic operation resulted in an overflow exception.So, the code in the script task is OK. There must be something wrong with the service. Apart that that, all packages run fine. It's only when I try to access the runnung packages that I get an error.Do you think that regsvr32 could help in that case. By the way, I am running this piece of code on locally on the server. Thanks again!Ccote
July 4th, 2011 9:30pm

Hello Ccote, Could you post the entire error message please? I think we are missing a piece of information.Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
July 4th, 2011 10:45pm

Hi, thqns again. Here is the complete message I get from SSMS when en connected to SSIS and trying to retrieve running packages: Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc) ------------------------------ For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476 ------------------------------ Program Location: at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object connectionInfo, Request request) at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.BuildDynamicItemWithQuery(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, String urnQuery, Boolean registerBuilder, Boolean registerBuiltItems) at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.BuildDynamicItem(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, IFilterProvider filter) at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.Build(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, IFilterProvider filter) at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItem.GetChildren(IGetChildrenRequest request) at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ExplorerHierarchyNode.BuildChildren(WaitHandle quitEvent) =================================== Arithmetic operation resulted in an overflow. (MsDtsSrvr) ------------------------------ Program Location: at Microsoft.SqlServer.Dts.Server.DtsServer.RunningPackageConvert(RunningPackage package, DTSRunningPackage100& copy) at Microsoft.SqlServer.Dts.Server.DtsServer.GetRunningPackages() at Microsoft.SqlServer.Dts.Runtime.Application.GetRunningPackages(String server) at Microsoft.SqlServer.Dts.SmoEnum.RunningPackageEnum.GetData(EnumResult erParent) at Microsoft.SqlServer.Management.Sdk.Sfc.Environment.GetData() at Microsoft.SqlServer.Management.Sdk.Sfc.Environment.GetData(Request req, Object ci) at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.GetData(Object connectionInfo, Request request) at Microsoft.SqlServer.Management.Sdk.Sfc.Enumerator.Process(Object connectionInfo, Request request) Ccote
July 5th, 2011 7:16am

Can you see if file MsDtsSrvr.ini.xml in your system drive :\Program Files\Microsoft SQL Server\90\DTS\Binn\ (here \90\ is for SQL Server 2005, see \100\ for SQL 2008) contains an entry for the MSDB as sqlservername\instancename like below and it is correct: MSDBServerName\InstanceNameArthur My Blog
Free Windows Admin Tool Kit Click here and download it now
July 5th, 2011 10:11am

Hi Arthur, yes. I restarted tge service and I still have the sane problem. ThanksCcote
July 5th, 2011 12:47pm

Should not be your service. It must be a component shared by SSMS, etc. e.g. a DLL. How about we do the following: do you have another SSMS to try? My idea is to log remotely this time using another machine.Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
July 5th, 2011 1:49pm

ccote, I was able to reproduce your issue and the error occurs in this line RunningPackages Pkgs = ssisApplication.GetRunningPackages(MachineName); Also I tested it on a bunch of instances and it failed only in few instances. This makes me think that it is an issue on the destination machine and not on the machine that you are running this package. Is it possible for your try this package to connect to a different machine/instance maybe?
July 5th, 2011 4:03pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics