Posts Tagged ‘Deploy’

Today while doing a BAM POC to one of my clients, I found a number of problems/errors, some of them unexpected and uncommon, while trying to deploy my BAM definition file.

In order to contextualize the problem, for this POC we are using only one BizTalk Server machine with BAM Portal, one dedicated SQL Server and Analysis Server and Integration Server in another dedicated server. So, more or less a simple Multi-Computer Environment.

In this post I will address the most unusual of them:

Deploying Activity… Done.
Deploying View… ERROR: The BAM deployment failed.
Could not load file or assembly ‘Microsoft.SqlServer.ASTasks, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91’ or one of its dependencies. The system cannot find the file specified.

CAUSE

Well, the cause the cause is quite obvious by its description. Microsoft.SqlServer.ASTasks assembly is missing or some of its dependencies, although, the environment has been installed, configured and functioning correctly, i.e., everything was working properly with exception of BAM deployment.

My first suspicion (which ultimately turned out to be right), and because, as I told before, SQL Server is remote was that not all the SQL Server Client Tools components were installed in the BizTalk Server machine.

This suspicion was confirmed when I open the SQL Server 2014 Management Studio console. Because the machine only had the “Management Tools – Basic” feature installed.

SQL-Server-Management-Tools-Basic-feature

The “differences” between basic and complete are:

  • Management Tools – Basic: includes support for the Database Engine and SQL Server Express, SQL Server command-line utility (SQLCMD) and SQL Server PowerShell provider
  • Management Tools – Complete:  as the name implies, you get it all. It adds support Reporting Services, Analysis Services and Integration Services technologies.

Because support for Analysis Services is required in BizTalk Server machines while deploying the view definition, this error occurs.

SOLUTION

To solve this problem, you must install also, on BizTalk Server machine, the “Management Tools – Complete” shared feature. To do that you need:

  • Clicking in the “Compatibility View” button that appears in the Address bar to display the site in Compatibility View.
  • Run SQL Server 2014 setup program.
  • On the SQL Server Installation Center, click Installation.
  • Click New Installation or Add Features to an Existing Installation.
  • Review the information on the Setup Support Rules screen, and then click OK.
  • On the Product Key screen, enter your product key and click Next.
  • On the License Terms screen, select I accept the license terms, and then click Next.
  • On the Setup Support Files screen, click Install.
  • On the Feature Selection screen, select the following features, and then click Next.
    • Shared Features
      • Management Tools – Basic
      • Management Tools – Complete

Once “Management Tools – Complete” is installed, you will be able to deploy your BAM definition file.

When trying to deploy BAM definition by:

  • Open a command prompt as follows: Click Start, click Run, type cmd, and then click OK.
  • Navigate to the tracking folder by typing “C:\Program Files (x86)\Microsoft BizTalk Server <version>\Tracking” at the command prompt. Press ENTER.
  • Type “bm deploy-all -DefinitionFile:<BAM definition file>”
  • Press ENTER.

I got the following error:

C:\Program Files (x86)\Microsoft BizTalk Server 2013\Tracking>bm.exe deploy-all -DefinitionFile:Tracking.xls
Microsoft (R) Business Activity Monitoring Utility Version 3.10.229.0
Copyright (C) Microsoft Corporation. All rights reserved.

Using ‘BAMPrimaryImport’ BAM Primary Import database on server ‘BIZTALK’…
Deploying Activity… Done.
Deploying View… ERROR: The BAM deployment failed.

Internal error: The operation terminated unsuccessfully.
OLE DB error: OLE DB or ODBC error: Login failed for user ‘Domain\UserAccount’.; 42000.
Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of ‘bam_MessageView’, Name of ‘bam_MessageView’.
Errors in the OLAP storage engine: An error occurred while the dimension, with the ID of ‘MessageView_ProcessDate’, Name of ‘MessageView_ProcessDate’ was being processed.
Errors in the OLAP storage engine: An error occurred while the ‘Hour’ attribute of the ‘MessageView_ProcessDate’ dimension from the ‘BAMAnalysis’ database was being processed.

OLE DB error: OLE DB or ODBC error: Login failed for user ‘Domain\UserAccount’.; 42000.
Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of ‘bam_MessageView’, Name of ‘bam_MessageView’.
Errors in the OLAP storage engine: An error occurred while the dimension, with the ID of ‘MessageView_ProcessDate’, Name of ‘MessageView_ProcessDate’ was being processed.
Errors in the OLAP storage engine: An error occurred while the ‘Week’ attribute of the ‘MessageView_ProcessDate’ dimension from the ‘BAMAnalysis’ database was being processed.
OLE DB error: OLE DB or ODBC error: Login failed for user ‘Domain\UserAccount’.; 42000.
Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of ‘bam_MessageView’, Name of ‘bam_MessageView’.
Errors in the OLAP storage engine: An error occurred while the dimension, with the ID of ‘MessageView_DestinationParty’, Name of ‘MessageView_DestinationParty’ was being processed.
Errors in the OLAP storage engine: An error occurred while the ‘DestinationPartyName’ attribute of the ‘MessageView_DestinationParty’ dimension from the ‘BAMAnalysis’ database was being processed.
OLE DB error: OLE DB or ODBC error: Login failed for user ‘Domain\UserAccount’.; 42000.
Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of ‘bam_MessageView’, Name of ‘bam_MessageView’.
Errors in the OLAP storage engine: An error occurred while the dimension, with the ID of ‘MessageView_PipCode’, Name of ‘MessageView_PipCode’ was being processed.
Errors in the OLAP storage engine: An error occurred while the ‘PipCode’ attribute of the ‘MessageView_PipCode’ dimension from the ‘BAMAnalysis’ database was being processed.
Server: The current operation was cancelled because another operation in the transaction failed.
OLE DB error: OLE DB or ODBC error: Login failed for user ‘Domain\UserAccount’.; 42000.
Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of ‘bam_MessageView’, Name of ‘bam_MessageView’.
Errors in the OLAP storage engine: An error occurred while the dimension, with the ID of ‘MessageView_ProcessDate’, Name of ‘MessageView_ProcessDate’ was being processed.
Errors in the OLAP storage engine: An error occurred while the ‘Year’ attributeof the ‘MessageView_ProcessDate’ dimension from the ‘BAMAnalysis’ database was being processed.
OLE DB error: OLE DB or ODBC error: Login failed for user ”Domain\UserAccount’.; 42000.
Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of ‘bam_MessageView’, Name of ‘bam_MessageView’.
Errors in the OLAP storage engine: An error occurred while the dimension, with the ID of ‘MessageView_ActivityName’, Name of ‘MessageView_ActivityName’ was being processed.
Errors in the OLAP storage engine: An error occurred while the ‘ActivityName’ attribute of the ‘MessageView_ActivityName’ dimension from the ‘BAMAnalysis’ database was being processed.
OLE DB error: OLE DB or ODBC error: Login failed for user ‘Domain\UserAccount’.; 42000.
Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of ‘bam_MessageView’, Name of ‘bam_MessageView’.
Errors in the OLAP storage engine: An error occurred while the dimension, with the ID of ‘MessageView_ProcessDate’, Name of ‘MessageView_ProcessDate’ was being processed.
Errors in the OLAP storage engine: An error occurred while the ‘Day’ attribute of the ‘MessageView_ProcessDate’ dimension from the ‘BAMAnalysis’ database was being processed.
OLE DB error: OLE DB or ODBC error: Login failed for user ‘Domain\UserAccount’.; 42000.
Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of ‘bam_MessageView’, Name of ‘bam_MessageView’.
Errors in the OLAP storage engine: An error occurred while the dimension, with the ID of ‘MessageView_SourceParty’, Name of ‘MessageView_SourceParty’ was being processed.
Errors in the OLAP storage engine: An error occurred while the ‘SourcePartyName’  attribute of the ‘MessageView_SourceParty’ dimension from the ‘BAMAnalysis’ database was being processed.
OLE DB error: OLE DB or ODBC error: Login failed for user ‘Domain\UserAccount’.; 42000.
Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of ‘bam_MessageView’, Name of ‘bam_MessageView’.
Errors in the OLAP storage engine: An error occurred while the dimension, with the ID of ‘MessageView_ProcessDate’, Name of ‘MessageView_ProcessDate’ was being processed.
Errors in the OLAP storage engine: An error occurred while the ‘Minute’ attribute of the ‘MessageView_ProcessDate’ dimension from the ‘BAMAnalysis’ database was being processed.

BAM-Deploy-OLE-DB-error-or-ODBC-error-Login-failed-for-user

CAUSE

The main reason for the error above happen is when the SQL Server service account does not have read access to BAMStarSchema database.

SOLUTION

To fix this issue you have two options.

First option:

  • Open SQL Server Management Studio and expand BAMStarSchema database
  • Expand “Security”, right-click on the “User” option, And select “New User…”
  • Configure the SQL Server service account to have db_datareader Role access as shown below

BAM-BAMStarSchema-database-db_datareader-Role-access

Second Option:

  • Open SQL Server Management Studio and execute the following script (Replacing the SQL Server service account)
USE BAMStarSchema
GO
EXEC sp_addrolemember 'db_datareader', 'Domain\SQL Server service account'
GO

In this last week I’ve been migrating legacy custom adapters from previous BizTalk Versions (2004 and 2006) for recent version of BizTalk Server (2010 and 2013). In this particular case is an Isolated Adapter that in fact is a socket listener that will be listening on one or more TCP ports for a custom and private message format to address and solve an integration problem with legacy platforms of one of my clients. Working and creating custom adapter it’s always a funny task, it makes me remember and come back to my roots of .NET developer and how much I love this job.

Note: It’s also important to remember that recent version of BizTalk Server normally runs under 64-bit and because BizTalk Administration Console runs under 32-bits it’s imperative to register the adapter in both 32-bit and 64-bit versions of the BizTalk Adapter, at least if you want the adapter to run under 64-bit, nevertheless you always need to register under 32-bit.

If you are developing a custom adapter, you can register it with BizTalk Server by modifying and running one of the registry files included with the sample file adapter in the software development kit (SDK). Or, you can use the Adapter Registry Wizard to create a registry file. You can learn more about this topic here: Registering an Adapter.

Although it is a migration of an existing adapter which have worked correctly over several years I decide to optimize the adapter to run on new versions of NET Framework (4.0) and also to support 64-bit. The question and the main reason for this post is: How to properly register this custom BizTalk adapter?

How to properly register a custom BizTalk adapter

Again and this is very important:

  • On a 32-bit machine, the registry (.reg) file generated by the Adapter Registration wizard must be run from the command prompt.
  • On a 64-bit machine, the registry (.reg) file generated by the Adapter Registration wizard must be run both from the 32-bit and 64-bit command prompt.

So if you are in a 32-bit machine you only need to run the adapter registry (.reg) from the command prompt or even double-click in adapter registry (.reg) file.

However if you are in a64-bit machine you need extra steps:

  • If run the adapter registry (.reg) from the command prompt or even double-click in adapter registry (.reg) file – this will register the adapter under 64-bit.

If you try to check and add this new adapter in the BizTalk Administration Console (Adding the Adapter to BizTalk Server) you will notice that the adapter will not be present and referenced in the Adapter drop box.

  • So now you need to force to do the same in 32-bit, to accomplish that you need to open a 32-bit command prompt:
    • Click Start.
    • Type %windir%\SysWoW64\cmd.exe in Start Search box and press Enter
    • Run the same adapter registry (.reg) from this command prompt

Again, if you try to check and add this new adapter in the BizTalk Administration Console you will notice that the adapter now will be present in the drop box.

Today I encountered the following issue when I was trying to install an application into a new BizTalk Server environment:

An error occurred while attempting to install the BizTalk application: World Wide Web service (W3SVC) on host “localhost” not available.

The following Windows component may not be installed: Application Server -> Internet Information Services (IIS) -> Common Files.
Unknown error (0x80005000)
Unknown error (0x80005000)”

World-Wide-Web-service-not-available

Note: This error occurred either if I try to install the application by or the MSI or by the BTSTask tool and this error is also followed by other two errors with no particular or interest information.

CAUSE

On a particular note, when I’m installing or configuring a new BizTalk environment I really prefer to install all features that BizTalk provides like BAM, BRE, … even though I don’t need them , at least for now, since we do not know the challenges of tomorrow and I try to follow all the guidelines provided by Microsoft or community members.

However we sometimes find clients that don’t install all components simply because they don’t need them for now, or even worse, they don’t install all the features necessary like IIS 6 Management Compatibility role services because for them it makes no sense

The problem this time was that IIS 6 Management Compatibility role services was not installed.

The Deployment Framework for BizTalk includes support for deploying application pools and virtual directories in IIS.  Virtual directory and application pool deployment is fully active for server deployments.

Due to IIS 7.0/7.5 includes significant change on the configuration system, on Windows Server 2008 and above, we need to enable IIS 6 Management Compatibility role services: IIS Metabase and IIS 6 configuration compatibility, IIS 6 WMI Compatibility and IIS 6 Scripting Tools to allow System.DirectoryServices code work on modifying IIS configurations on IIS7.x.

This topic is clearly documented in BizTalk 2010 installation guides.

SOLUTION 1

To solve this problem you must enable IIS 6 Management Compatibility role services by following the steps below:

  • Go to Administrative Tools à Server Manager
  • Select “Roles” and under “Web Server (IIS)” select “Add Role Services”
  • On the “Select Role Services” window, check the box next to “IIS 6 Management Compatibility”. Make sure you checked all four options below it.

IIS-Select-Roles-Services

Note: After this steps you need to restart the ISS.

SOLUTION 2

In alternative you can install these features by using PowerShell:

Import-Module ServerManager
@("Web-Server",
"Web-Http-Errors",
"Web-App-Dev",
"Web-Asp-Net",
"Web-Net-Ext",
"Web-ASP",
"Web-CGI",
"Web-ISAPI-Ext",
"Web-ISAPI-Filter",
"Web-Includes",
"Web-Basic-Auth",
"Web-Windows-Auth",
"Web-Mgmt-Compat",
"Web-Metabase",
"Web-WMI",
"Web-Lgcy-Scripting",
"Web-Lgcy-Mgmt-Console"
)| Add-WindowsFeature

You can download this PowerShell script from:

Enable all the requires IIS features for BizTalk Server with PowerShell
Microsoft | TechNet Gallery

I’ve been working on a BizTalk Server 2004 project that had (not any more) between 6 or 8 visual studio solutions each one with a BizTalk Project inside. After a few minutes swapping from a solution to another I decided to add all the project in a single solution.

I notice that all the solution are configure to build the assemblies to a common reference folder shared by all projects:

Visual-studio-2003-build-options

And the other project are referring the assemblies from that folder.

However when trying to compile the project I was getting the following error:

The file ‘MyDLLProject.dll’ cannot be copied to the run directory. The process cannot access the file because it is being used by another process.

But when I open that project isolated from the others projects I could successfully compile.

CAUSE

The cause is easy… the Visual Studio has a lock on the file.

Note: That this lock could be from the Visual Studio instance that you are working on or another Visual Studio instance in another session.

SOLUTION 1

The easy solution to avoid further problems is to change the “Output path” to another location for example the default “bin\Development\”

And then instead of referring the assembly from a folder, chose Add reference from Projects

Visual-studio-2003-add-reference-from-project

Work like a charm!

SOLUTION 2

Close all the Visual Studio solution that reference this assembly or assemblies and build the project.

Today while I was playing with BizTalk Server 2006, yes I know very old stuff, but sometimes is needed… and for those who are accustomed to developer BizTalk solutions knows that we need to sign the project with a strong name assembly key file before we deploy them… nothing new.

The funniest part came when I tried to build the solution in Visual Studio, and I ended up getting this odd error:

Cryptographic failure while signing assembly ‘Myproject.dll’ — ‘The key container name ‘MyKey.snk’ does not exist’

At first I thought I had set the path to the key wrong, but I quickly realized that was not the case, and if that was the case, we would have received a different error message:

Cryptographic failure while signing assembly ‘Myproject.dll’ – ‘Error reading key file ‘MyKey.snk’ — The system cannot find the file specified’

CAUSE

You have incorrectly defined a strong name key file!

The process to sign the project in Visual Studio 2010 is very different than in Visual Studio 2005. In 2005 we have 3 properties:

  • Assembly Delay Sign
  • Assembly Key File
  • and Assembly Key Name

And we normally only need to configure the “Assembly Key File”… however, in my case I copied and configure the wrong property without intention which led to me to receive this error message, hehehe

assembly-sign-strong-name

SOLUTION

That easy, you have to properly configure the property "Assembly Key File"

Hehehe… Everyone make mistakes, hehehe lesson learned.

One of my team members that is making some changes to a project that I started, called me saying that he was having problems in deploying the project. Whenever he tried to deploy the project he was stuck in the following error:

Failed to add resource(s). Resource (…) is already in store and is either associated with another application or with another type.

Failed-to-add-resource-associated-with-another-application-or-type

First we have to understand this type of error message…

CAUSE

When this message occurs, usually means that the resource we are trying to deploy is already deployed.

Before you can deploy a solution from Visual Studio (2005, 2008, 2010 …) into a BizTalk application, you must first set project properties. If a solution in Visual Studio contains multiple projects, you must separately configure properties for each project:

  • In Visual Studio Solution Explorer right-click a project for which you want to configure properties, and then click Properties.
  • Click the Deployment tab in Project Designer.
  • and configuring at least the following properties:
    • Application Name: Name of the BizTalk application to which to deploy the assemblies in this project. If the application already exists, the assemblies will be added to it when you deploy the project. If the application does not exist, the application will be created. If this field is blank, the assemblies will be deployed to the default BizTalk application in the current group. Names that include spaces must be enclosed by double quotation marks (").
    • Configuration Database: Name of the BizTalk Management database for the group, BizTalkMgmtDb by default.
    • Server: Name of the SQL Server instance that hosts the BizTalk Management database on the local computer. In a single-computer installation, this is usually the name of the local computer.

Notice: If “Application Name” property is blank, the assemblies will be deployed to the default BizTalk application, i.e., “BizTalk Application 1”.

So if you have this problem, you may:

  • Inadvertently deployed it to another application, most likely to the default “BizTalk Application 1”;
  • Someone have probably removed the previously existing name in “Application Name” property from the project properties.

SOLUTION

If “Application Name” property by mistake is blank, then this resource is already deployed in another application than the default: “BizTalk Application 1”, so we need to:

  • In the BizTalk Administration Console the <All Artifacts> view will tell you in which application the resource is deployed, we need to find were this resource is deployed.
  • We need to fix the "Application Name" property.
  • Redeploy the project

If “Application Name” property isn’t blank, then the resource may inadvertently been deployed in to another application, so we need to:

  • In the BizTalk Administration Console the <All Artifacts> view will tell you in which application the resource is deployed, we need to find were this resource is deployed.
  • When found resource delete it.
  • Redeploy the project
Working with Team Foundation Server 2010

In my case, it was really weird why this error was happening because I had been working on it a few days before and I knew that all settings were correct.

So to help my teammate and to see what was happening, I open Visual Studio get the last version of the project from TFS, because he had changed the solution, and I try to deploy the solution and to my astonishment, or not… everything worked fine, everything deployed successfully!

However my colleague was still unable to properly deploy the solution… and it wasn’t permission problems.

So what happened?

Even though I have added the solution to TFS with the correct settings for Deployment… when another member open this solution for the first time to work on it… the “Application Name” property is set to…. blank!!!!

Deployment-options

We must go to all the projects in the solution and fix this property.

Today after I deploy and configure a new version of an existence solution, I tried to start the application and it gave me the following error:

TITLE: BizTalk Server 2006 Administration Console
——————————
Could not enlist orchestration ‘MyAssembley, Version=1.0.0.0, Culture=neutral, PublicKeyToken=776eb620b83c3d30’. Could not enlist orchestration ‘MyAssembley, Version=1.0.0.0, Culture=neutral, PublicKeyToken=776eb620b83c3d30’. Object reference not set to an instance of an object. (Microsoft.BizTalk.SnapIn.Framework)

This error, “Object reference not set to an instance of an object“, occurs when I went to enlist the new orchestration.

CAUSE

This maybe happens because the DLL’s presents in the GAC are not correct, or they are missing.

SOLUTION
Remove all the DLL’s and then deploy afterward or update them in GAC, normally solves this problem.

SOLUTION 2

Remove all the DLL’s and then change the DLL version (for example 1.0.0.1) and deploy the solution also, normally, solves this problem

But because today I was a little lazy and my lab machine had several windows updates to do, I decided to make a restart to my environment and install all updates and then deal with this error :).

Then came the best part, I decided to make one more shot, without changing anything, just application start J and IT WORKS!!

SOLUTION 3

Restart your machine!

Tags: BizTalk | Deploy | Errors and Warnings, Causes and Solutions

When building BizTalk Project it gives the following error:

Unable to copy file "…\Pipeline Components\MyPipelineComponent.dll" to "bin\Debug\ MyPipelineComponent.dll". The process cannot access the file "bin\Debug\ MyPipelineComponent.dll" because it is being used by another process

More details in MSDN Forum, Thread Title: custom pipeline error

In the past I posted an article regarding to a similar problem:

CAUSE

  • Visual Studio has a lock on the file in order to show the pipeline components in the toolbox.

Or

  • Some BizTalk process is running BizTalk host and have a lock on the file

These two errors have basically the same solution, and to solve them, you can try two approaches:

SOLUTION 1

  • Close Visual Studio and restart host instance to make sure the pipeline component
    DLL get released.
  • And then deploy pipeline component.

SOLUTION 2

  • Rename file (it is much faster).
  • Restart host instance
  • Deploy pipeline component
  • And then delete old DLL’s

Tags: BizTalk | Pipeline | Deploy | Errors and Warnings, Causes and Solutions

When trying to deploy BAM activity into a new BizTalk Environment:

  • “C:\Program Files (x86)\Microsoft BizTalk Server …\Tracking>bm.exe deploy-all -DefinitionFile:BAM.SMSExpress.xls”

It happened to me the following error:

“Microsoft (R) Business Activity Monitoring Utility Version 3.9.469.0
Copyright (C) Microsoft Corporation. All rights reserved.
Using ‘BAMPrimaryImport’ BAM Primary Import database on server ‘BTS2010LAB01’…
Deploying Activity… Done.
Deploying View… ERROR: The BAM deployment failed.
The BAM Star Schema database has not been configured. Run bm.exe setup-databases to configure the database.

CAUSE

  • One of the possible causes of the problem is that Analysis Services form BAM aggregations was not configured.

SOLUTION

  • Open BizTalk Server Configuration Console. (All Programs → Microsoft BizTalk Server … → BizTalk Server Configuration)
  • Select the option “BAM Tools” in the left menu and check the option “Enable Analysis Services for BAM Aggregations”
  • Configure “BAM Analysis Database” and “BAM Star Schema Database”
    BAM-Tools-Configuration
  • Click in “Apply Configuration”
  • On the Summary screen, Click “Next”
    BAM-Tools-Configuration-summary
  • On the completed screen, click “Finish”

Tags: BizTalk | BAM | Deploy | Errors and Warnings, Causes and Solutions