Posts Tagged ‘BizTalk’

My last couple of posts I wrote about failures that can happen in the Backup BizTalk Server job for two reason:

  • First because I like to write about Errors, Warnings, Causes and Solutions, this is a good way to understand and have a good documentation of possible issues that can happen.
  • Second to create a TechNet Wiki article to demonstrate the best practices that you can have when you thinking in taking a question posted in BizTalk Server forums: Backup BizTalk Server job failed and convert it to a TechNet Wiki article.

In result I created 6 TechNet Wiki articles that will demonstrate some of the best practices, that I gathered after many conversations along with Steef-Jan Wiggers and Tord Gard Nordahl (some of the "Guardians of the BizTalk TechNet Wiki Articles"), that you can have and that will help you start creating your own articles in the TechNet Wiki:

  • Wiki: Best Practices For Converting a Forum Thread Into a New Wiki Article: This article is intended to be a list of all the best practices that you can have while converting a Forum thread into a new TechNet Wiki article.
  • Wiki: Templates For Converting a Forum Thread Into a New Wiki Article: This article is intended to be a list of all templates that can help TechNet Wiki members to easily create (you can copy the article structure and paste to your new article) and follow common layouts and guidelines when they try to convert a forum thread into a new Wiki article.
  • Wiki: Errors or Troubleshooting Template Format: If you are creating a new article about an Error or Troubleshooting, you can copy the article structure that exist in this article and paste to your new article. This template is intended to provide an initial path (model or pattern) for you to make the final article with a visual presentation of its structure and maybe input fields of data or description of the section that you should use.
  • Wiki: Questions and Solutions Template Format: If you are creating a new article about a solution to a question, you can copy the article structure that exist in this article and paste to your new article. This template is intended to provide an initial path (model or pattern) for you to make the final article with a visual presentation of its structure and maybe input fields of data or description of the section that you should use.
  • BizTalk Server: Backup BizTalk Server job failed Troubleshooting: This article has its origin in a question posted in BizTalk Server forums: Backup BizTalk Server job failed and will provide you with common problems, possible solutions, related solutions and how can you troubleshoot this problems. This article is also a demonstration how you can apply some of the best practices that you should have when taking a BizTalk Server questions from the forums and created a new BizTalk Server Wiki Articles.
  • BizTalk Server: How to map values from a repeating node into a single node using conditions: This article has its origin in a question posted in BizTalk Server forums: Reg BizTalk Mapping and will provide you with common possible solutions and try to explain what’s the best way to address and solve this problem. This article is also a demonstration how you can apply some of the best practices that you should have when taking a BizTalk Server questions from the forums and created a new BizTalk Server Wiki Articles.

In the last couple of months I have also finished many articles about BizTalk Server and Windows Azure BizTalk Services and this is the result!

List of contributions in English:

  • BizTalk Server Best Practices: Create and Configure BizTalk Server Host and Host Instances: BizTalk Server provides great flexibility for addressing high availability, because you can strategically dedicate logical hosts to run specific areas of functionality such as receiving messages, sending messages or processing orchestrations. Although a single BizTalk Host can contain items that receive, send, and process messages, it is considered a best practice to create different hosts for each function to create security boundaries and for easier management and scalability. In particular, we recommend that you use different hosts for processing and for receive/send operations, and that you separate trusted and non-trusted items. This is a list of some of the best practices that you can implement.
  • BizTalk Server: Webcasts and Videos: There are a few number of Web Casts and this article is intended to be a knowledge base of all BizTalk server Webcasts and Videos that are available.
  • List of Service Packs and Cumulative Updates available for BizTalk Server: This article lists all the available service packs and the cumulative updates for Microsoft BizTalk Server and for Microsoft BizTalk Adapter Pack.
  • BizTalk Server: Redistributable CAB Files: BizTalk Server relies on diverse products and technologies to provide essential services and features. If not already present, some software that is required by BizTalk Server is installed on your computer during the BizTalk installation process. This article lists all the available Redistributable CAB Files.
  • Windows Azure BizTalk Services Resources on the TechNet Wiki: This page contains links to all the Windows Azure BizTalk Services resources that are available on the TechNet Wiki.

Windows-Azure-BizTalk-Services-Resources-TechNet-Wiki

  • Windows Azure BizTalk Services: Webcasts and Videos: There are only a limited number of Web Casts and this article is intended to be a knowledge base of all Windows Azure BizTalk Services Webcasts and Videos that are available.
  • Windows Azure BizTalk Services: Code Gallery Samples: The MSDN Code Gallery enables you to download and share sample applications, code snippets, and other resources with the developer community where you can find a wide variety of all kinds of free sample code on different technologies ranging from general c# to advanced solutions. For Windows Azure BizTalk Services you can find a limited amount of sample solutions and code, however, if you got one that involves Windows Azure BizTalk Services, please add it here.
  • Windows Azure BizTalk Services: List of Errors and Warnings, Causes and Solutions: This article is intended to be a knowledge base of all Errors and Warnings, Causes and Solutions documented in all stages/components of Windows Azure BizTalk Services: different stages of development, deployment, runtime, setup and configuration…

List of contributions in Portuguese:

Feel free to edit, change and add content! And I hope you will find these articles useful.

Now I’m playing a little with this topic hehehe… but be with me, this have a final goal that I will reveal soon (probably two weeks from now since next week I will be away in the MVP Summit and BizTalk Summit in Seattle). Until then let’s try to find some of the “basic” possible errors that you can find in the Backup BizTalk Server job.

In my previous posts (here and here), I have explained two possible errors that you can find when trying to run this job, today we will talk about this one:

SQL Server Scheduled Job ‘Backup BizTalk Server (BizTalkMgmtDb)’ (0x4020953E49DEFA43B8FEC18D6AD9B062) – Status: Failed – Invoked on: 2013-11-12 08:50:46 – Message: The job failed. The Job was invoked by User BTS2013LAB01\Administrator. The last step to run was step 3 (MarkAndBackupLog). The job was requested to start at step 1 (Set Compression Option).

 

 

Backup-BizTalk-Server-job-warning-message-MarkAndBackupLog

Although the execution of job ‘Backup BizTalk Server (BizTalkMgmtDb)’ failed, no error is register in the event viewer only the warning showed above. This probably happens because the main task of this job: “BackupFull” responsible for performing a full database backups of the BizTalk Server databases, is properly executed. You can validate this in the tables “adm_BackupSettings” and “adm_BackupHistory”, or on the file system where the backup files are saved.

However, and as the message states, the job was not entirely performed and there is a problem in the third task: MarkAndBackupLog. Again the error message doesn’t help us much, so what you should do is go to the Backup BizTalk Server job history to try so see if you can obtain more information’s. In this case the log history show as much more information:

Log Job History (Backup BizTalk Server (BizTalkMgmtDb))
Step ID 3
Job Name Backup BizTalk Server (BizTalkMgmtDb)
Step Name MarkAndBackupLog
Sql Severity 15
Sql Message ID 105
Message
Executed as user: NT SERVICE\SQLSERVERAGENT. Incorrect syntax near ‘´’. [SQLSTATE 42000] (Error 102) Unclosed quotation mark after the character string ‘ /* location of backup files */ ‘. [SQLSTATE 42000] (Error 105). The step failed.

Backup-BizTalk-Server-job-error-history-MarkAndBackupLog

 

CAUSE

The MarkAndBackupLog step is responsible for marking the logs for backup, and then backing them up. This step execute the “sp_MarkAll” stored procedure that accepts two mandatory parameters:

  • @MarkName: Log mark name is part of the naming convention for backup files
  • @BackupPath:. You must change the destination path this to a valid one. It may be local or a UNC path to another server

And one optional parameter:

  • @UseLocalTime: This is an extra parameter that you can also add that tells the procedure to use local time

The mandatory parameters (MarkName and BackupPath) must be placed between single quotation marks:

  • MarkName: 'BTS', 'BTS2013LAB01' and so on
  • BackupPath: 'c:\backups'

The problem here is that for some reason I’m not using a single quotation mark:

exec [dbo].[sp_MarkAll] ‘BTS’ /* Log mark name */, C ….’ …

SOLUTION

Fix the job to ensure that all the parameters of the sp_MarkAll is between single quotation marks.

 

Another error that you can find in the Job history is:

Log Job History (Backup BizTalk Server (BizTalkMgmtDb))
Step ID 3
Job Name Backup BizTalk Server (BizTalkMgmtDb)
Step Name MarkAndBackupLog
Sql Severity 16
Sql Message ID 3013
Message
Executed as user: NT SERVICE\SQLSERVERAGENT. Cannot open backup device ‘K:\Backups\BizTalk Database\Logs\BTS2013LAB01_BAMAlertsApplication_Log_BTS_2013_11_12_17_51_07_990.bak’. Operating system error 3(The system cannot find the path specified.). [SQLSTATE 42000] (Error 3201) BACKUP LOG is terminating abnormally. [SQLSTATE 42000] (Error 3013). The step failed.

In this case you also get one or several errors in the Event Viewer:

BackupDiskFile::CreateMedia: Backup device ‘K:\Backups\BizTalk Database\Logs\BTS2013LAB01_BAMAlertsApplication_Log_BTS_2013_11_12_17_51_07_990.bak’ failed to create. Operating system error 3(The system cannot find the path specified.).

Backup-BizTalk-Server-job-error-message-MarkAndBackupLog

CAUSE

If you check the parameters of the “sp_MarkAll” stored procedure you will see that the second parameter is the location of backup files and this location must exist in the file system.

SOLUTION

You must remember that you need to ensure that all the paths specified in the BizTalk jobs must exist in the file system. In my case, we create the folder on the file system and run the job again with success.

After writing my last post I remembered that in the past I got a related error to this problem but with a different cause and solution. So I decided to emulate the error in my lab environment and make a second part of this topic.

I remember that on occasion, in order to be faster, I copied all the job configuration text from of my blog and pasted in the BackupFull step job window. However when I try to run I got a similar error:

SQL Server Scheduled Job ‘Backup BizTalk Server (BizTalkMgmtDb)’ (0x4020953E49DEFA43B8FEC18D6AD9B062) – Status: Failed – Invoked on: 2013-11-11 17:45:00 – Message: The job failed. The Job was invoked by Schedule 9 (MarkAndBackupLogSched). The last step to run was step 2 (BackupFull).

Backup-BizTalk-Server-job-error-message-MarkAndBackupLogSched

Again the error message doesn’t help us much, so what you should do is go to the Backup BizTalk Server job history:

  • Right click in “Backup BizTalk Server (BizTalkMgmtDb)” job and select “View History” option

And try so see if you can obtain more information about the error.

Unlike the event viewer and the error that I put in the previous post, in this case the log history show as much more information:

Date 11/11/2013 17:45:00
Log Job History (Backup BizTalk Server (BizTalkMgmtDb))
Step ID 2
Job Name Backup BizTalk Server (BizTalkMgmtDb)
Step Name BackupFull
Message
Executed as user: NT SERVICE\SQLSERVERAGENT. Incorrect syntax near ‘´’. [SQLSTATE 42000] (Error 102) Unclosed quotation mark after the character string ‘ /* location of backup files */ ‘. [SQLSTATE 42000] (Error 105). The step failed.

Backup-BizTalk-Server-job-error-history-Unclosed-quotation-mark

CAUSE

The copy of the text from my blog brought a wrong ASCII format transforming the single quotation mark character in an accent (´).

All the parameter of the sp_BackupAllFull_Schedule must be placed between single quotation marks:

  • Frequency: 'd', 'w' and so on
  • Name: 'BTS'
  • Location of backup files: 'c:\backups'

SOLUTION

Fix the job to ensure that all the parameters of the sp_BackupAllFull_Schedule is between single quotation marks.

For several years I’ve been setting up dozens of times the Backup BizTalk Server job without any kind of problems… but there’s a first time for everything and when I was trying to help remotely a friend configuring this job, we got stuck with this error when we try to start it:

Log Job History (Backup BizTalk Server (BizTalkMgmtDb))
Step ID 0
Job Name Backup BizTalk Server (BizTalkMgmtDb)
Step Name (Job outcome)
Message
The job failed. The Job was invoked by User domain\user. The last step to run was step 2 (BackupFull). The job was requested to start at step 1 (Set Compression Option).

Backup-BizTalk-Server-job-error-message

I knew that the job was configured correctly but unfortunately I didn’t have access to the SQL Server in order to see if I could find out more information about what was happening… Well, according to the error message we know that the job started in the first task “Set Compression Option” but failed in the second “BackupFull”. Beyond that the error message doesn’t help us much.

By going to the job history (right click in “Backup BizTalk Server (BizTalkMgmtDb)” job and select “View History” option)) we can validate that the problem in the BackupFull task but again the message described there doesn’t help us much.

Backup-BizTalk-Server-job-error-history

CAUSE

Unfortunately this error can happen for several reasons and we need to check what the best option for us is::

  • In Microsoft BizTalk Server 2004 and later, the Backup BizTalk Server job fails, and problems occur that relate to limited disk space. This happens when the backup files accumulate over time. This fills up the disk that houses the backup files.
    • This issue occurs because the SQL Server Agent job that is named “Backup BizTalk Server” does not provide functionality for deleting backup files that have accumulated over time. See: The “Backup BizTalk Server” job fails when backup files accumulate over time in the Microsoft BizTalk Server database server
    • Or you can create a Maintenance Plan to delete BizTalk Database Backups files see more here
    • I found also this great suggestion by Tord Glad Nordahl: “Verify that the compression option for the database is correct, after this open the management database located the table called “adm_BackupSettings” update this column “ForceFull” and set the value to 1. Then manually run the backup job again.” In this forum question.

But none of these suggestions work for me, in fact this was the first time that we were trying to run the job.

However sometimes solutions are simpler than it seems. If you check the parameters of the BackupFull step you will see that the third parameter is the location of backup files and this location must exist in the file system… so because I didn’t have access to the SQL Server machine, I asked to my friend to:

  1. Validate if the folder exist in the file system;
  2. See in the event viewer of the SQL Server if there was more information about the error;

The result was:

  1. The folder didn’t exist… never a good sign
  2. In the event viewer of the SQL Server Machine there was an entry saying the exact problem:

BackupDiskFile::CreateMedia: Backup device ‘K:\Backups\BizTalk Database\Full\BTS2013LAB01_BAMAlertsApplication_Full_BTS_2013_11_11_16_45_25_870.bak’ failed to create. Operating system error 3(The system cannot find the path specified.).

SOLUTION

You must remember that you need to ensure that all the paths specified in the BizTalk jobs must exist in the file system. In my case, we create the folder on the file system and run the job again with success.

Backup-BizTalk-Server-job-success

I have been receiving a few requests to release a new version of BizTalk Scheduled Task Adapter for BizTalk Server 2013. Actually I am planning a new version of this adapter, of course probably will be optimized for BizTalk Server 2013, but in reality this will not be the main focus.

BizTalk Scheduled Task Adapter Feature Roadmap

Here’s what you can expect to see in BizTalk Scheduled Task Adapter in the next few months:

  • Bring 1 or 2 really new features like JSON or REST support
  • Improve the existing features by solving some minor problems
  • Side-by-side installation
  • Improve documentation

 

But before I begin to develop a new version, I decided to perform a “battery of tests” with the current version of this adapter in order to know if there was any problem or if it was fully compatibility with latest platforms of Microsoft: BizTalk Server 2013, SQL Server 2012 and Windows Server 2012.

The good news is that for now I didn’t detect any kind of problems:

  • I was able to install and configure the adapter on a BizTalk Server 2013 running in a Windows Server 2012 with SQL Server 2012:

Scheduler-Adapter-running-BTS2013

  • And I was able to create a new receive location and specify a scheduler to run the XmlStringStreamProvider to send an XML message every one hour

Scheduler-Adapter-running-BTS2013-add-receive-locationScheduler-Adapter-running-BTS2013-configure-scheduler-receive-location

Scheduler-Adapter-running-BTS2013-configure-scheduler-receive-location-2

I have not done all the tests possible, but I can say that the bases features tested in the latest version of this adapter are fully compatible with BizTalk Server 2013.

If you found any problem running this version in BizTalk Server 2013 or 2010, feel free to email me with your problem or add a comment.

This weekend after installing .NET Framework 4.0 in a BizTalk Server 2006 R2 environment, the BizTalk Adapter 2.0 for mySAP Business Suite started to throw the following error when he tried to receive data from the SAP system.

“Event Source: BizTalk Adapter v2.0 for mySAP Business Suite
Description: Error in Check Transaction: Failed to load the runtime.
(Exception from HRESULT: 0x80131700)”

BizTalk-Adapter-mySAP-Business-Suite-Transaction-Failed-to-load-the-runtime

CAUSE

This issue occurs after installing .NET Framework 4.0. The registration of the assembly used by mySAP Business Suite does not specify the correct version of the .NET Framework. When .NET Framework 4.0 is installed, the assembly will try to use the newer framework and then raise this error.

SOLUTION

You need to manually reregister the sapreceiver.dll (this DLL is usually in this folder: “C:\Program Files\Microsoft BizTalk Adapter v2.0 for mySAP Business Suite\”). To accomplish that you need to:

  • Execute cmd (Start → cmd)
  • Type “cd C:\Windows\Microsoft.NET\Framework\v1.1.4322”
  • And execute the following command to fixed the problem:
    • regasm.exe “C:\Program Files\Microsoft BizTalk Adapter v2.0 for mySAP Business Suite\sapreceiver.dll”

Note: When you install .NET Framework 4.0 in older versions of BizTalk Server like BizTalk Server 2006 or 2006 R2, normally, you will also have problems with the Enterprise Single Sign-On Service for the exact same reasons and the solution is also to manually reregister the DLL but this time the SSOSQL.dll. To find more about this error check: Fixing BizTalk ENTSSO – Could not create SSOSQL. To fix the problem, reinstall SSO or try ‘regasm SSOSQL.dll’ from a Visual Studio command prompt.

References:

Microsoft just releases two cumulative update packages for BizTalk 2013: Cumulative Update Package 2 for BizTalk Server 2013 and Cumulative Update Package 1 for BizTalk Adapter Pack 2013!

Cumulative update package 2 for BizTalk Server 2013

Cumulative update package 2 for Microsoft BizTalk Server 2013 contains hotfixes for the BizTalk Server 2013 issues that were resolved after the release of BizTalk Server 2013.

Important notes about the cumulative update package

  • It’s recommend that you test hotfixes before you deploy them in a production environment.
  • The cumulative update package is a unified package that contains x86 and x64 files. To install the update, run the Setup.exe file.

List of hotfixes that are included in cumulative update package 2 for BizTalk Server 2013:

  • FIX: The value for the "maxOccurs" attribute is invalid when you validate the BizTalk X12 EDI 835 schema in a BizTalk EDI application in BizTalk Server 2013 (KB 2777584)
  • FIX: The memory that a BizTalk host process consumes increases when there are no messages in the queue in BizTalk Server 2013 (KB 2823757)
  • FIX: Pipeline on receive locations reverts to pass-through after you update the schema assembly in BizTalk Server 2013 (KB 2802453)
  • FIX: "The InnerText property is write only" error message when you use System.Xml.XmlDocument in BizTalk Server 2013 (KB 2835689)
  • FIX: "Could not load file or assembly ‘Microsoft.BizTalk.Interop.SSOClient Version=5.0.1.0" error when you use the ESB configuration tool in BizTalk Server 2013 (KB 2848425)
  • FIX: SQL connection leak when you use WCF-based SQL Adapter one-way send port to return a result set from a database in BizTalk Server 2013 (KB 2855762)
  • FIX: 2-way WCF-BasicHttp receive port does not respond to a WCF client when the "failed message routing" feature is enabled in BizTalk Server 2013 (KB 2813294)
  • FIX: Message is suspended when you try to receive an encrypted AS2 message together with asynchronous MDN in BizTalk Server 2013 (KB 2778133)
  • An update for Message Box Viewer is available in Microsoft BizTalk Server 2013 cumulative update 2 (KB 2885488)
  • FIX: Support for HIX EDI transactions 005010×306 (820) and 005010×220 (834) for BizTalk Server 2013 (KB 2882453)
  • FIX: XpathMutatorStream class does not work as expected when you execute Xpath statements against XmlDocuments in BizTalk Server 2013 (KB 2851429)
  • FIX: BizTalk Server 2013 cannot receive the messages from the view in document library or from the SharePoint online library (KB 2859398)
  • FIX: High CPU usage after you install BizTalk Server 2013 and SQL Server 2012 on a computer (KB 2891320)
  • FIX: "System.ArgumentException" error when you browse WCF services from ESB Toolkit 2.2 in BizTalk Server 2013 (KB 2849475)
  • ESB Toolkit BRE Itinerary Resolver Fails with Exception (KB 2887594)

Restart requirement

You have to restart the computer after you apply this cumulative update package.

Prerequisites

To apply this cumulative update package, you must have BizTalk Server 2013 installed:

  • Microsoft BizTalk Server 2013 Developer
  • Microsoft BizTalk Server 2013 Enterprise
  • Microsoft BizTalk Server 2013 Standard

To know more about and download this CU2 check Microsoft Help and Support.

Cumulative update package 1 for BizTalk Adapter Pack 2013

This cumulative update for BizTalk Adapter Pack 2013 contains hotfixes for BizTalk Adapter Pack 2013 issues that were fixed after the release of BizTalk Adapter Pack 2013.

Important notes about the cumulative update package

  • It’s recommend that you test hotfixes before you deploy them in a production environment.
  • The cumulative update package includes all component updates. However, the cumulative update package updates only those components that are installed on the system.
  • The cumulative update package is a unified package that contains x86 and x64 files.

List of hotfixes that are included in cumulative update package 1 for BizTalk Adapter Pack 20103:

  • FIX: Package variables trigger operations fail when you use BizTalk Adapter for Oracle Database to connect to Oracle Database (KB 2845542)
  • FIX: "Column ‘PROVIDERTYPE’ does not belong to table SchemaTable" exception when you use BizTalk Adapter for Oracle Database to connect to an Oracle database (KB 2845538)
  • FIX: Messages become stuck in SM58 when you use a WCF-based SAP Adapter in BizTalk Server (KB 2845536)
  • FIX: WCF-SAP adapter receive location freezes under heavy load when it works as a tRFC server (KB 2836739)

Restart requirement

You have to restart the computer after you apply this cumulative update package.

Prerequisites

To apply this cumulative update package, you must have BizTalk Adapter Pack 2013 installed.

To know more about this CU2 check Microsoft Help and Support.

 

As previously described, you may have to restart the computer after you apply both cumulative update packages.

Today I want to talk about a very common problem that can occur when we are invoking BizTalk Orchestrations exposed as a synchronous services (Request-Response Receive ports):

"System.Net.WebException: The operation has timed out"

System-Net-WebException-The-operation-has-timed-out-BizTalk-Orchestration

In my case I was trying to invoke an orchestration exposed as a WCF service. And of course this can be very straightforward problem, most of the times easy to detect and probably also to fix… but sometimes BizTalk tries to play with us and throw a few good surprises…

TYPICAL CAUSES AND SOLUTIONS

Typically this problem is usually associated with network problems or lack of Error Handling inside Orchestrations:

  • You are trying to invoke an external system inside the orchestration and it take too much time to respond and naturally we get a time out error.
    • The SOAP.ClientConnectionTimeout property can be used on a Web service that take a long time to return a response to try to solve or address this problem. See more here.
  • You can have a High Volume of request and you can overload the external service with too many concurrent calls or you can have limits of max connections to a certain address and will naturally this can cause affect the performance and provably will take too much time to respond.
  • This error can also occur when the BizTalk performance get degraded and it start responding slow. If the BizTalk jobs are not well configured and running the size of BizTalk Databases can grow extremely and responding very slow and we get stuck with this error.
    • You need to validate the jobs and the database and if necessary you need to configure the jobs and clean the databases with the Terminator tool and provably shrinking also the databases to resolve the problem.
  • Also you can get this error because you don’t want to handler errors inside orchestrations, so for example if you don’t handler WCF Fault messages from your external service or you are invoking a C# code and it raise an exception, and you are note handling this situations in your orchestration, the orchestration will be suspended an you will get a timed out exception.
Nothing fit in the problem. What can it be?

But … and when all this is checked and doesn’t fit in the problem that is happening. What can it be? Before explain let me describe my scenario:

  • I have a simple demo service that receive a small message, invoke an external service and return the message to the source system.
  • Because of API limitation I decide to invoke this external services with C# and control Exception inside orchestrations.
  • I know by using HAT and debugging in DEV environment that the external service was giving me a known error that I was controlling and throwing the error in order to create a response with the error description, inside the orchestration, to be returned to the original system.

So nothing to fancy and very simple stuff. However every time I tried to test the orchestration the orchestration was stuck in the message box in suspended state… the external service was invoked, the error was catch in the code, logged and the exception was raised for the orchestration and after that nothing … the engine seemed unaware and did not understand what was happening, crazy I know.

0XC0C01B52-Orchestration-Engine-Error

When I investigated the Event Viewer to try to find more information I found this description:

xlang/s engine event log entry: Uncaught exception (see the ‘inner exception’ below) has suspended an instance of service ‘MyOrchestration(728766c9-9df2-609b-004e-fa2e7c3079c4)’.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: 4dfd6041-d52f-4110-8d0d-92efc48f0c38
Shape name: InvokeExternalService Shape
ShapeId: eff276fd-f289-4778-ba47-ff66309ae8c6
Exception thrown from: segment 2, progress 8
Inner exception: Fault Response: My Error Description

The first thing I thought was that I incorrectly published some resource (DLL) … but after validating and publishing the solution again, the problem prevailed.

CAUSE

The Orchestration Designer can play some tricks to developers. And be very careful when you copy shapes from one orchestration to others!

What I did was open a similar solution and copy the main scope (body of the orchestration) to a new solution that I had created. This will also copy all the shapes inside the scope… and of course I change the shapes to fit my new requirements, by deleting some shapes and change the code inside others… Why? To be faster and not lose much time creating the main sketch of the orchestration.

But be aware that the Orchestration design don’t like some of this operations (for me it’s a bug inside Orchestration design), and for some reason the designer doesn’t interpret well the shapes (“refactoring” or the “graphical interpretation”). He compile when the solution but in runtime we get stuck with the error “The service instance will remain suspended until administratively resumed or terminated. If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.”

I don’t know if some also detect this behavior before but I already experience this twice.

SOLUTION

To solve this strange behavior you need to redesign the same Orchestration flow by:

  • Dragging new shapes to the Orchestration design and copy the exact same code inside the existing shapes to the new ones… you can also give the same names!
  • At the end delete the existing shapes (which had been copied).
  • Compile and deploy the project again.

Without doing anything more this solved my problem.

And finally the BizTalkCrew 2013 tour is over! Like last year this was a European tour that started in London (UK) with our BizTalk Summit 2013 with an astounding audience of 128 attendees from more than 70 different companies across 16 countries. Then for the first time we held the event in the beautiful city of Oporto (Portugal) – Oporto BizTalk Innovation Day, a very special event for me because I was the host of the event and that for the first time I was able to bring BizTalk product group to Portugal.

And in the last two month the BizTalkCrew has been very active and busy planning and organizing the end of the 2013 European tour with two new BizTalk Innovation Day.

Bouvet BizTalk Innovation Day 2013

The first event, Bouvet BizTalk Innovation Day 2013, was a two day event (26 and 27 of September) held for the second time in Stavanger (Norway) and besides having the usual suspects (the BizTalkCrew: me, Steef-Jan Wiggers, Nino Crudele, Saravana Kumar and Tord G. Nordahl) as speakers, the event had two distinguished special guests: Microsoft Integration MVP Kent Weare and Microsoft Windows Azure Customer Advisory the infamous Paolo Salvatori.

This was the biggest BizTalk event organized in Norway this year with a total of 70 people attended this two days event.

Bouvet-BizTalk Innovation-Days 2013-Attendes

The first day was filled with presentations made by the speakers:

  • The first session was MVP Kent Weare talking about how you can expose Line of Business (LOB) services to mobile devices using BizTalk 2013 and the Azure Service Bus.
  • The second was MVP Steef-Jan Wiggers talking about how you can learn to leverage BizTalk Server 2013 and Windows Azure Service Bus to create hybrid solutions.
  • And in the last session of the morning, Paolo Salvatori took the stage to make the Key Notes about BizTalk 2013.
  • MVP Saravana Kumar took the stage in the first session of the afternoon to talk about Management and Monitoring of BizTalk Server using BizTalk360 and to raise the curtain for the first time in public and show some screens of the new version of the product in HTML5.
  • The fifth session was made by myself talking about BizTalk Mapping Patterns and Best Practices. Because this was a two day event I thought I’d take advantage of the first day just to make a theoretical presentation without demos, trying not only to explain how maps are processed internally by the engine of the product and describe some common mapper problems and solutions, but also try to recall some of the main basic concepts of maps because, most times, over the years and the experience acquired even the most experienced developer begins to carry malpractice and forget to apply the most basic concepts.
  • MVP Tord Nordahl took the stage after my session to talk about Proactivity in BizTalk by addressing some of the most important aspects to be aware in order for the enterprise to maintain a stable BizTalk environment.
  • And the final session was made by MVP Nino Crudele about BizTalk Hostage Situation – a set of good hostage BizTalk scenarios and how you can gain control of the situation and solve problems of bad implementations.

Bouvet-BizTalk Innovation-Days 2013-Nino-CrudeleBouvet-BizTalk Innovation-Days 2013-Paolo-SalvatoriBouvet-BizTalk Innovation-Days 2013-Sandro-Pereira

KentBouvet-BizTalk Innovation-Days 2013-Saravana-KumarBouvet-BizTalk Innovation-Days 2013-Steef-Jan

This day ended up with an awesome dinner with the attendees and the Bouvet staff, but only after a few hours of break with some beers and good talk with the attendees.

Bouvet-BizTalk Innovation-Days 2013-deaner

And like last year the second day was hands on labs, each speaker had his own room and hourly time slots, where the attendees could come in and had the opportunity to meet, discuss their issues, ask questions or share their experience with the speakers. I took this day to show 11 common mapping problems and explain the best way to address day and of course some of the best practices while we are developing maps. It was an amazing day with great conversation between the attendees and good feedback.

After the event has ended, unfortunately Saravana and Paolo Salvatori had to go back home, and Steef-Jan and Kent Weare when to Berlin to run the 40th Berlin Marathon (crazy guys!) but the rest of the team accompanied by Salvatore Pellitteri enjoyed themselves a little, visiting and getting to know Norway.

Bouvet-BizTalk Innovation-Days 2013-bergenBizTalk-Innovation-Day-Italy-2013-viking

You can download my presentation here.

BizTalk Innovation Day 2013 Italy

The second event, BizTalk Innovation Day 2013 Italy, was held in the Microsoft Innovation Campus in Milan (Italy). This was also the second time that the event was made in Italy and which also had the participation of two special guests: Microsoft Windows Azure Customer Advisory Paolo Salvatori and community member Salvatore Pellitteri.

BizTalk-Innovation-Day-Italy-2013-Microsoft

The agenda was very similar to the Norway event:

  • Once gain Steef-Jan had the privilege to start the event with his presentation about hybrid solutions.

BizTalk-Innovation-Day-Italy-2013-Steef-Jan

  • And was followed by Paolo Salvatori with an extension of the first session. This time Paolo talked about how you can use Windows Azure Service Bus, BizTalk Services, Mobile Services and BizTalk Server to create hybrid solutions.

BizTalk-Innovation-Day-Italy-2013-Paolo-Salvatori

  • Third session and to ended up the morning was Saravana Kumar with his presentation about Management and Monitoring of BizTalk Server using BizTalk360. But for the first time in public all of the demos were made in the last version of the product (V7).

BizTalk-Innovation-Day-Italy-2013-Saravana-Kumar

  • It was up to me to start the afternoon with my session about BizTalk Mapping Patterns and Best Practices. I reduced the slides to contain only the essential and most important information in order to be able to make a practice session. And I got it! Having enough time to show my 11 demos!

BizTalk-Innovation-Day-Italy-2013-Sandro-Pereira

  • After my session was once more Tord that took the stage to present his session about Proactivity in BizTalk.

BizTalk-Innovation-Day-Italy-2013-Tord

  • And responsibility to end the event with the final session was in the shoulders of Nino Crudele and Salvatore Pellitteri that held a presentation about real BizTalk environments in which they addressed several topics like new licensing system in BizTalk Server 2013 and productivity.

BizTalk-Innovation-Day-Italy-2013-Nino-and-Salvatori

After the event has ended the team enjoyed a little by visiting and getting to know Italy and eating amazing food.

BizTalk-Innovation-Day-Italy-2013-foodBizTalk-Innovation-Day-Italy-2013-Nino-Family

You can download my presentation here.

The speakers

For the Norway event is the usual group photo, starting from left to right with: Kent Weare, Tord Nordahl, Steef-Jan Wiggers, Saravana Kumar, Nino Crudele, Sandro Pereira (me) and Paolo Salvatori.

Bouvet-BizTalk Innovation-Days 2013-Speakers

And the same group picture in Italy with: Nino Crudele, Salvatore Pellitteri, Sandro Pereira (me), Tord Nordahl, Steef-Jan Wiggers and Saravana Kumar.

BizTalk-Innovation-Day-Italy-2013-speakers

2014?

What about 2014? Yes, we are already planning the 2014 BizTalk Innovation Tour!

Is it this year we make an event out of Europe? For now we are planning some events in Europe that will be announced soon… but It only depend on you :)

One of the principal needs for BizTalk Administrators is the ability to monitor the health of BizTalk environments and react promptly to possible problems, you can accomplished this by using certain tools such as: BizTalk Administration Console; BizTalk360; SCOM and many more… However, unfortunately many times, some of these tools are not available for us but we still need to accomplish this task.

Welcome back to this series of articles about Monitor your BizTalk environment using PowerShell that already have three previous editions:

Today we will talk about monitoring Windows Updates and Pending Restarts on the servers using PowerShell.

For me it’s very important that administrators deploy the latest Microsoft product updates to servers that are running the Windows operating system. By doing this they will address and solved known issues or vulnerabilities in Microsoft products and they will keep the environment constantly updated. However when we are working with several teams (system administrators, network administrator, BizTalk administrators and so on) or sometimes without system administrators teams this task normally are forgotten or postponed several times.

Although there are occasions when updates can cause a new issue to appear, generally speaking they will help solving problems. However, for this reason, you should install and tested this updates in developing or testing environment before you installed in production.

For this reasons I like to monitor and know if the servers that are running on my BizTalk environment has some updates available to install or for some reason they required a restart, so that I take actions without the need of constantly have to check this manually in all the servers.

So how can PowerShell help us?

With this script you can be able to monitoring Windows Updates and Pending Restarts on the servers running on your BizTalk environment using PowerShell. Servers that do not fall under these conditions will not be listed.

This script allows you to set:

  • A range of machines you need to monitor
#########################################################
# List of computers to be monitored
#########################################################
$Servers = Get-Content .\Machines.txt

The Machine.txt is a simple text file with the list of all machine names you want to monitor:
servername1.domain.local
servername2.domain.local
servername3.domain.local

  • And configure your email notification settings
#########################################################
# List of users who will receive the report
#########################################################
$mailto = "mail1@mail.net, mail2@mail.net"

#########################################################
# SMTP properties
#########################################################
$emailFrom = "suport@mail.net"
$smtpServer = "mySMTPServer" #SMTP Server.
$smtpUsername = "myUsername"
$smtpPassword = "myPassword"

The script will monitor all the servers with Windows Updates ready to be installed, Windows Updates configured to be checked manually or servers that required a reboot. Servers that do not fall under these conditions will not be listed.

$results = foreach ($Computer in $Servers)
{
	try
  	{
	  	$service = Get-WmiObject Win32_Service -Filter 'Name="wuauserv"' -ComputerName $Computer -Ea 0
		$WUStartMode = $service.StartMode
		$WUState = $service.State
		$WUStatus = $service.Status

		try{
			if (Test-Connection -ComputerName $Computer -Count 1 -Quiet)
			{
				#check if the server is the same where this script is running
				if($Computer -eq "$env:computername.$env:userdnsdomain")
				{
					$UpdateSession = New-Object -ComObject Microsoft.Update.Session
				}
				else { $UpdateSession = [activator]::CreateInstance([type]::GetTypeFromProgID("Microsoft.Update.Session",$Computer)) }
				$UpdateSearcher = $UpdateSession.CreateUpdateSearcher()
				$SearchResult = $UpdateSearcher.Search("IsAssigned=1 and IsHidden=0 and IsInstalled=0")
				$Critical = $SearchResult.updates | where { $_.MsrcSeverity -eq "Critical" }
				$important = $SearchResult.updates | where { $_.MsrcSeverity -eq "Important" }
				$other = $SearchResult.updates | where { $_.MsrcSeverity -eq $null }
				# Get windows updates counters
				$totalUpdates = $($SearchResult.updates.count)
				$totalCriticalUp = $($Critical.count)
				$totalImportantUp = $($Important.count)

				if($totalUpdates -gt 0)
				{
					$updatesToInstall = $true
				}
				else { $updatesToInstall = $false }
			}
			else
			{
				# if cannot connected to the server the updates are listed as not defined
				$totalUpdates = "nd"
				$totalCriticalUp = "nd"
				$totalImportantUp = "nd"
			}
		}
		catch
        {
			# if an error occurs the updates are listed as not defined
        	Write-Warning "$Computer`: $_"
         	$totalUpdates = "nd"
			$totalCriticalUp = "nd"
			$totalImportantUp = "nd"
			$updatesToInstall = $false
        }

        # Querying WMI for build version
        $WMI_OS = Get-WmiObject -Class Win32_OperatingSystem -Property BuildNumber, CSName -ComputerName $Computer -Authentication PacketPrivacy -Impersonation Impersonate

        # Making registry connection to the local/remote computer
        $RegCon = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]"LocalMachine",$Computer)

        # If Vista/2008 & Above query the CBS Reg Key
        if ($WMI_OS.BuildNumber -ge 6001)
        {
            $RegSubKeysCBS = $RegCon.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\").GetSubKeyNames()
            $CBSRebootPend = $RegSubKeysCBS -contains "RebootPending"
        }
		else{
			$CBSRebootPend = $false
		}

        # Query WUAU from the registry
        $RegWUAU = $RegCon.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\")
        $RegSubKeysWUAU = $RegWUAU.GetSubKeyNames()
        $WUAURebootReq = $RegSubKeysWUAU -contains "RebootRequired"

		if($CBSRebootPend –OR $WUAURebootReq)
		{
			$machineNeedsRestart = $true
		}
		else
		{
			$machineNeedsRestart = $false
		}

        # Closing registry connection
        $RegCon.Close()

		if($machineNeedsRestart -or $updatesToInstall -or ($WUStartMode -eq "Manual") -or ($totalUpdates -eq "nd"))
		{
			New-Object PSObject -Property @{
	           	Computer = $WMI_OS.CSName
                WindowsUpdateStatus = $WUStartMode + "/" + $WUState + "/" + $WUStatus
                UpdatesToInstall = $updatesToInstall
                TotalOfUpdates = $totalUpdates
                TotalOfCriticalUpdates = $totalCriticalUp
				TotalOfImportantUpdates = $totalImportantUp
                RebootPending = $machineNeedsRestart
        	}
		}
  	}
	catch
 	{
    	Write-Warning "$Computer`: $_"
  	}
}

Report sample:

Windows-Updates-and-Pending-Restarts-Report

Note: This type of script must be viewed as a complement to the tools mentioned above or used in the absence of them.

You have also to understand that I’m not PowerShell expert but I like to try things and play a little with PowerShell, so for me this script serves my purposes and has given me the chance to learn a little more. However you should also reuse other resources available in the community and use modules like Get-PendingReboot – Query Computer(s) For Pending Reboot State from Brian Wilhite

The script can be found and download on Microsoft TechNet Gallery:
Monitoring Windows Updates and Pending Restarts on the servers using PowerShell (13.1 KB)
Microsoft TechNet Gallery