Showing posts with label packages. Show all posts
Showing posts with label packages. Show all posts

Sunday, March 11, 2012

Custom Logger Doesn't Work in Certain cases

I am testing a set of SSIS packages, In order to test my SSIS packages for errors I have two negative test cases

1) I didn't provide checkpoint file for the checkpoint enabled package.

2) I provide a wrong configuration file

Even though I am using a script task in my "on error" event of my SSIS package. It is not executed. (Perhaps because the package doesn't even execute).

My problem is that SSIS itself puts just a simple one liner in windows event log "Package Failure Error". It does not provide which package failed, why it failed etc. Therefore the admin who gets the ticket to resolve the issue has no clue of what is going wrong and where!

Since my custom logger doesn't even run, I don't know how can I put more details into the windows event log.

How can I resolve this?

regards,

Abhishek.

Sorry to bump so soon, but I am really stuck here.

|||Loggers don't even enter the picture on malformed configuration file warnings/errors. Malformed configurations files are detected at package load time, even before validation. So, if you have a logger ( custom or stock, doesn't matter) defined inside the package, warnings like "invalid xml configuration file" won't be sent there.

The sequence for possible package execution is as follows:
1. Package Load (warnings/errors such as invalid configuration file happen here )
2. Package Validation
3. Package Execution (with validation too)

To trap package load errors, you could capture dtexec's console log output (if you're using that mechanism for package execution).

To implement your own logging; that is, to catch warnings/errors early in the package lifespan without using dtexec's console logger to do so, implement IDTSEvents (by subclassing DefaultsEvents) on package load. See Loading and Running a Local package programmatically (the capturing events from a running package section)

For example, the following will log package load,validate,and execute events, while loggers will get validate and execute events.

Code Snippet

using System;
using System.Diagnostics;
using Microsoft.SqlServer.Dts.Runtime;

namespace IS
{
class PackageRunner
{
static void Main(string[] args)
{
string pkgFileName = args[0];
ISEventsListener eventListener = new ISEventsListener();
// subclass of DefaultEvents

Application isApp = new Application();
// listen for pre-validation errors via LoadPackage
using (Package pkg = isApp.LoadPackage(pkgFileName, eventListener))
{
DTSExecResult validationOutcome = pkg.Validate(null, null, eventListener, null);
if (validationOutcome == DTSExecResult.Success)
{
DTSExecResult executionOutcome = pkg.Execute(null, null, eventListener, null, null);
}
}
Console.WriteLine("Press something...");
Console.ReadKey();
}
}
}

Checkpoint files are a different story, a missing checkpoint file setting will be logged by custom loggers and the package will not execute because of that.

Thursday, March 8, 2012

Custom labels for DTS steps

Hi,
we have DTS packages which call other DTS packages, sometimes a few levels
deep.
In our error logs out DTS steps are labelled like
"DTSStep_DTSExecutePackageTask_4"
Is there a way to give our DTS steps custom labels so that it'll be easier
to work out which dts and which step has failed?
Server 2K
ThanksYes you can, and should do this...
Open your package and right click in the white space, go to Disconnected
Edit... There you can change the names of the Tasks and Steps... Be careful
tho,,, Change the Task name, then you have to go to the step which calls the
task, and change the taskname there to match... While there, you can also
change the Step name...
Save a copy before messing with this... It's easy to mess up..
--
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
I support the Professional Association for SQL Server ( PASS) and it''s
community of SQL Professionals.
"Joe Gass" wrote:

> Hi,
> we have DTS packages which call other DTS packages, sometimes a few levels
> deep.
> In our error logs out DTS steps are labelled like
> "DTSStep_DTSExecutePackageTask_4"
> Is there a way to give our DTS steps custom labels so that it'll be easier
> to work out which dts and which step has failed?
> Server 2K
> Thanks
>
>|||well I had no idea that was there.
Many thanks for you help.
Cheers
Joe
"Wayne Snyder" <wayne.nospam.snyder@.mariner-usa.com> wrote in message
news:324ED758-4CC5-4DB1-A01A-D041548013CD@.microsoft.com...
> Yes you can, and should do this...
> Open your package and right click in the white space, go to Disconnected
> Edit... There you can change the names of the Tasks and Steps... Be
> careful
> tho,,, Change the Task name, then you have to go to the step which calls
> the
> task, and change the taskname there to match... While there, you can also
> change the Step name...
> Save a copy before messing with this... It's easy to mess up..
> --
> Wayne Snyder MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> I support the Professional Association for SQL Server ( PASS) and it''s
> community of SQL Professionals.
>
> "Joe Gass" wrote:
>|||Use "Disconnected Edit" and name your steps...

Wednesday, March 7, 2012

Custom Dataflow Transform in Programmatically Built Package

I'm building packages programmatically and all is well. I have a new custom transform that I developed. It also works fine. Now I'm trying to add my new component to my packages when I programmatically build them, and I'm unable to do that.

Has anyone added their own custom components to a programmatically built package successfully?

I get a COM error on the line that calls ProvideComponentProperties. I've attempted various modifications including not overriding ProvideComponentProperties or just having it do nothing. I always get the same result. What I don't understand is that the custom transform works and handles ProvideComponentProperties fine when it is added to a package in BIDS.

Thanks.

'Add new dataflow task

combitronics = dataFlow.ComponentMetaDataCollection.New()

'Set assembly to my component

combitronics.ComponentClassID = "Ewrap.SSIS.Combitronics"

'Get instance of component

Dim instance As CManagedComponentWrapper = combitronics.Instantiate()

'Initialize component ***Error Occurs Here***

instance.ProvideComponentProperties()

...

Have you tried debugging your custom component. The only other thing I could suggest is where the component is deployed to.|||

Thanks for the response.

It looks like I'm using the wrong name for my assembly when calling it. I found I could specify the GUID instead of the Namespace.Name format and that solved the problem. I got the correct GUID by looking at the .dtsx file after renaming it to .xml so it's easily viewed in IE.