Wednesday, October 9, 2013

Resolved : Schema referenced by Map "XX" has been deleted. The local, cached The local, cached version of the BizTalk Server group configuration is out of date. You must refresh the BizTalk Server group configuration before making further changes.

Ok.so you got this error.

 
As the error message says, Map XX is referencing an schema which got removed from database, somehow. 
 
Before, solving the issue I would like to dig little deeper inside the BizTalk administration. Basically, BizTalk Admin console gets the most of the data (not all) from BizTalkMgmtDB. There are few set of tables which you need to know for solving this issue.


bt_MapSpec --> stores the metadata of BizTalk map
bts_Item --> store the items (map, schema, pipelines, orchestration etc) metadata(few not all)
bts_assembly --> stores the metadata of assemblies deployed in Biztalk
bts_sendport_transform --> stores the outbound map metadata, configured at send port
bts_receiveport_transform --> stores the inbound map metadata, configured at receive port.
bts_XMLShare --> store the metadata and content map,schemas etc.
(All the above tables are related with each other using ids,guids and names)
bt_DocumentSpec --> metadata of all type of schemas only

if you notice there are two columns in bt_MapSpec table has 2 special columns
indoc_docspec_name and outdoc_docspec_name, these two columns holds the fully qualified name of source schema and destination schema respectively.

Reason: possibly one of the schema got removed from dbo.bt_DocumentSpec table.

Resolution:
Option 1. Make the map unavailable (by deleting the map from bt_MapSpec, only which is causing the issue
Option 2. Make the missing schema available (by inserting the metadata of schema)
Option 3. Update the indoc_docspec_name/outdoc_docspec_name, whichever is missing, column of with the fully qualified name of document schema which is already available in BizTalkMgmtDb  

Any of the mentioned above option will solve the issue, I personally recommend option 3 as this cause minimum manual changes to the BizTalk database.

In BizTalk 2009, this issue is not much problematic as administrator load the map on when you are trying to reach the map and let you to delete the bztalk application (including problematic map). But in BizTalk 2010 you admin console almost fails at everystep what you are going to perform.

Note: before doing anything like this, there are suggestion or rather warning, do this only if know what exactly you are doing.