2

Given help from this microsoft link, I am aware of many tools related to SSIS diagnostics:

  1. Event Handlers (in particular, "OnError")
  2. Error Outputs
  3. Operations Reports
  4. SSISDB Views
  5. Logging
  6. Debug Dump Files

I just want to know what is the basic, "go to" approach for (non-production) diagnostics setup with SSIS. I am a developer who WILL have access to the QA and UAT servers where I will be performing diagnostics.

In my first attempt to find the source of an error, I used SSMS to view operational reports. All I saw was this:

enter image description here

I followed the instructions shown above, but all it did was lead me in a circle. The overview allows me to see the details, but the details show the above message and ask me to go back to the overview. In short, there is zero error information beyond telling me which task failed within the SSIS package.

I simply want to get to a point where I can at last see SOMETHING about the error(s).

If the answer is that I first need to configure an OnError event in my package, then my next question is: what would the basic, "go to" designer-flow look like for that OnError event?

FYI, this question is similar to "best way of logging in SSIS"

I also noticed an overall strategy for success with SSIS in this answer. The author says:

Instrument your code - have it make log entries, possibly recording diagnostics such as check totals or counts. Without this, troubleshooting is next to impossible. Also, assertion checking is a good way to think of error handling for this (does row count in a equal row count in b, is A:B relationship really 1:1).

Sounds good! But I'd like to have a more concrete example...particularly for feeding me the basics of what specific errors were generated.

I'm trying to avoid learning ALL the SSIS diagnostic approaches, just for the purpose of picking one good "all around" approach.

Update

Per Nick.McDermaid suggestion, in the SSISDB DB I run this:

SELECT * FROM [SSISDB].[catalog].[executions] ORDER BY start_time DESC

This shows to me the packages that I manually executed. The timestamps correctly reflect when I ran them. If anything is unusual(?) it is that the reference_id, reference_type and environment_name columns are null. All the other columns have values.

Update #2

I discovered half the answer I'm looking for. The reason no error information is available, is because by default the SSIS package execution logging level is "none". I had to change the logging level.

Nick.McDermaid gave me the rest of the answering by explaining that I don't need to dive into OnError tooling or SSIS logging provider tooling.

Community
  • 1
  • 1
Brent Arias
  • 29,277
  • 40
  • 133
  • 234
  • Don't pepper your SSIS packages with special OnError handlers. That's for extreme cases and is labour intensive. The only exception is script task errors, which never give you anything useful unless you tap them in the script and explicitly write them out. It's hard to say what has happened in your case. I just viewed the 'all executions' standard report, then I clicked all messages, and it showed me a detailed error there. What kind if task did you have an error in? – Nick.Mc Jun 05 '17 at 23:07
  • I've never ever bothered comparing rowcounts between tables. If the rowcounts don't match then an error occurred and it should already be reported, _or_ the business logic causes there to be different counts _or_ the source has changed since the rowcounts were taken. – Nick.Mc Jun 05 '17 at 23:09
  • @Nick.McDermaid One is a "data flow" task, while another is a sql script task. – Brent Arias Jun 06 '17 at 00:41
  • @Nick.McDermaid. Slight correction: a "data flow" task and a "sql task". The two are unrelated, and are found in different SSIS packages...but both fail with absolutely no information about what the error was. – Brent Arias Jun 06 '17 at 00:53
  • Where did you find the operational reports that you describe? Try this: find the package (deep under the _Integration Services Catalogs_ folder in SSMS) and press Reports / Standard Reports / All Executions. You should find a row in here with 'Failed' as status. Press the _All Messages_ link. You should find your tasks listed in here along with detailed errors. Please describe at which point this fails. – Nick.Mc Jun 06 '17 at 01:14
  • @Nick.McDermaid The steps you described (i.e. reports / all executions) ...are exactly what I did to obtain the screen shot shown in my question. To be clear, there is indeed a row with a failed status. When I click that, instead of an actual error message(s) I get the prior mentioned message about "one or more errors have occurred...". I have updated the screen-shot in my question to make it more clear what I'm seeing. – Brent Arias Jun 06 '17 at 01:33
  • OK yes, normally you would see error messages in that report. Are you certain you are checking the correct SSIS catalog? It looks like no executions have been logged. Did you run a package in the catalog (by right clicking the package / running?) What do you get if you run `SELECT * FROM [SSISDB].[catalog].[executions] ORDER BY start_time DESC` ? – Nick.Mc Jun 06 '17 at 01:43
  • Those three columns are also null in my table. It seems like your package has logged to the SSIS db but the reports are not picking that information up. Double check that you are running reports on the correct instance. The reports just run queries on these tables. – Nick.Mc Jun 06 '17 at 05:17
  • As for nulls at `reference_id`, `reference_type` and `environment_name` columns - this is normal. It means that you started the package without any environment specified; environment is optional. – Ferdipux Jun 06 '17 at 05:23

2 Answers2

1

I'm not sure what the issue with your reports are but in answer to the question "Which SSIS diagnostics should I learn", I suggest the vanilla ones out of the box.

In other words use built in SSIS logging (which does not require any additional code) to log failures. Then use the built in reports (once you get them working) to check those logs.

vanilla functionality requires no maintenance. Custom functionality (i.e. filling your packages up with OnError events) requires a lot more maintenance.

You may find situations where you need to learn some of the SSISDB tricks to troubleshoot but in the first instance, try to get everything you can out of the vanilla reports.

If you need to maintain an SQL 2012 or after existing system, then all of this logging is built in. Manual OnError additions are not guaranteed to be built in

The only other thing to be aware of is that script tasks never yield informative errors. I actually suggest you avoid the use of script tasks in SSIS. I feel that if you have to use a script task, you might be using the wrong tool

Nick.Mc
  • 18,304
  • 6
  • 61
  • 91
  • The SSIS packages I'm working on, resuming the effort started by another developer, did not have any logging providers at all. I have now added the first and only logging provider (logging to SQL Server) and will post news tomorrow if testing shows that I can finally see error information. – Brent Arias Jun 06 '17 at 05:31
  • Don't be confused by logging providers. These aren't necessary in SSIS 2012 onwards, these were only required in prior versions (SQL 2008 and prior), as logging was not "out of the box" in those versions. You shouldn't need to use these at all in SQL 2016 unless you specifically want to log to a file or windows event viewer or some other custom logging repository. Along the lines of my answer here, anything additional just adds complication and maintenance overhead. – Nick.Mc Jun 06 '17 at 05:36
  • Ok, then I'm back to square one. I have a failed "data flow" task. I click on that task and I see the image shown in my question. No error information whatsoever. What now? – Brent Arias Jun 06 '17 at 15:00
  • Check my `Update #2`. – Brent Arias Jun 06 '17 at 16:22
0

Adding to the excellent answer of @Nick.McDermaid.
I use SSIS Catalog error reporting. In most cases, it is sufficient and have the following functionality for error analysis. Emphasis is on the following:

  • Usually the first or second error message contains meaningful information on error. The latter is some error occurred in the dataflow....
  • If you look at the first/second error message at All Messages report at Error Messages section, you will see Error Context hyperlink. Invoking it will show you environment, connection managers and some variables at the moment of package crash.

Good error analysis is more an approach and practice than a mere tool selection. Here are my recommendations:

  • SSIS likes to report error code instead of meaningful explanation. So, Integration Services Error and Message Reference is your friend.
  • SSIS includes in error context (see above) dump those variables which have Include in ErrorDump property set to true.
  • I build SQL commands for SQL Task or DataFlow Source in variables. This allows to display SQL command executed at error in error context, when you set incude in Dump property on these variables.
  • Structure your variables well. If some variable is used only at some task - declare it on this task. Otherwise a mess of dumped variables will hurt you more than do any good.
Ferdipux
  • 5,116
  • 1
  • 19
  • 33
  • I'm not sure what you mean by "SSIS catalog error reporting". However, when you say "all messages report with error context hyperlink" it sounds like the "all executions" report I opened...which contained the screen shot you see in my question. As you can see, it gives no error information whatsoever. It gives instructions to select "view overview" which just lead me back to the list of hyperlinks...I pick the hyperlink with the error and I'm shown no error messages whatever. It is a circular reference to nowhere. – Brent Arias Jun 06 '17 at 15:07
  • @BrentArias, Open _All Executions_ report, then open _All Messages_ report for a failed package. Right after the report header you will see _Error Messages_ section with error messages and _View Context_ hyperlink close to the error record. – Ferdipux Jun 06 '17 at 18:49
  • Like to thank @Ferdipux for the excellent tip on "Include in ErrorDump" and saving the queries in variables. This adds complexity but would offer operations excellent information to operations when trying to solve the error. – Anders Ericsson May 02 '22 at 06:38