Monday, May 22, 2017

JSON Decoder : Unexpected character encountered while parsing value

After fixing an error with JSON decoder -Property not specified in JSON decoder, got one more error from JSON decoder-



 



From the error it is clear that the data in response from the api is not valid JSON, thus the decoder throws error.


Why it happened


I went through the tracked service instance and checked what exactly is received, and as can be seen in below snap - it was HTML and no JSON message. 




And as the returned message starts with <  , the decoder was not able to parse it as valid JSON message is like:

{
   "company": "Maruti",
   "name": "Swift",
   "price": 800000
}

Note: The RestApi has not implemented the required functionality, only instance of webapi is provisioned in Azure - thus the HTML is returned.

What to do 


Here, we can't do anything except get the functionality implemented in Rest Api and let it return valid message. This error can also be encountered in case you are using JSON decoder and you receive XML.

Sunday, May 21, 2017

Error xxxx not specified in JSON decoder properties

Am working on a POC where I have to invoke a Rest Api, collect the response and do futher processing on it. So to accept JSON data coming in response, I created a custom pipeline having JSON decoder at decode stage. After deploying the project and configuring it, dropped the test instance at receive location and watching for output in OUT folder(configured to archive API response).

As no output was generated - means some error was encountered, visited event log and found below error:









Why this happened


It was my bad, missed to set couple of properties which are required by JSON decoder to convert JSON message in corresponding XML message i.e. Root Node Name and Namespace.







Above error is in situation where you do not specify Root Node Name and Namespace both or if only Namespace is set.
Out of curiosity wanted to check what JSON decoder says if I set Root Node Name only and leave Namespace as Blank - It says, I want it to build XML message for you ;)


What to do


When using JSON decoder it is mandatory to provide this two properties.It is because the Key is converted into element and Value as element value.

e.g.,

JSON Message:

{
   "company": "Maruti",
   "name": "Swift",
   "price": 800000
}

Corresponding XML:

   <company>Maruti</company>
   <name>Swift</name>
   <price>800000</price>



But a valid XML has a Root Node, thus that needs to be provided explicitly to JSON decoder to attach the converted XML structure under Root Node 

Friday, May 19, 2017

Installing BizTalk 2016 feature pack 1

Microsoft recently released feature pack 1 for BizTalk server 2016, this is first time such feature pack is presented and off course it is for enriching customers experience that too without breaking existing functionality.

Organizations can only use Feature Pack 1 with BizTalk Server 2016 if they have the Enterprise or Developer editions of the product, plus Software Assurance. No other editions are eligible. It's also possible to use Feature Pack 1 if BizTalk Server is run in Azure with an Enterprise Agreement, the MSDN article explained

So thought of installing it and exploring it, installation is quite straight forward - steps below


2. Run the installer 









This installation requires to restart the server to reflect the installed features.

Microsoft claims Feature Pack 1 is production ready and provides only non-breaking features (Off course we need to verify this before thinking of Production). Is there anything noticeable thing(after installation) supporting below features - there saw few things


Deployment:

1. Deploy with VSTS – Enable Continuous Integration to automatically deploy and update applications using Visual Studio Team Services (VSTS)
2.New management APIs – Manage your environment remotely using the new REST APIs with full Swagger support


Analytics:

1.Application Insights – Tap into the power of Azure for tracking valuable application performance and to better understand your workflow 

To support this there is an option provided in tracking section wherein we can Enable Analytics. What is Application insights - After creating Application Insight, capture the instrumentation Key, as this is needed when enabling Analytics on BizTalk group and it is passed as connection parameters









2.Leverage operational data – View operational data from anywhere and with any device using Power BI



Runtime:

1.Support for Always Encrypted – Use the WCF-SQL adapter to connect to SQL Server secure Always Encrypted columns



SQL Server 2016 introduced a feature that enables client applications to read/write encrypted data within a SQL table without actually providing the encryption keys to SQL Server and that's been included in WCF SQL adapter as a property, by default it is Disabled.



2.Advanced Scheduling – Set up advanced schedules using the new capabilities with Feature Pack 1 

If you would have used Scheduled task adapter, this was on developers wanted list for long time to have scheduling capability on granular level. Including Time zone is really thoughtful





Tuesday, May 16, 2017

The Login is from an untrusted domain and cannot be used with Windows authentication

During daily routine checkup, we found following warning and error in event viewer.

At first it might appear from the error that BizTalk Server machine and SQL server machine are in different domain or the user account used for configuring the BizTalk service is from a different domain than from SQl server's domain  -- None is the case 



The Login is from an untrusted domain and cannot be used with Windows authentication  warning


The Login is from an untrusted domain and cannot be used with Windows authentication error


Why it happened


It is known issue and this errors are result of restart of Domain controller(A domain controller is the centerpiece of the Windows Active Directory service. It authenticates users, stores user account information and enforces security policy for a Windows domain) or unavailability of same over the network,thus the BizTalk applications cannot authenticate users until the Domain Controller(s) is not up.And it is because SQL is not able to find the authenticated domain user (as domain controller is not available at moment) and thus throws error. 


What to do


There were no more errors as soon as Domain controller was up but there can be other reasons too, refer following link: https://blogs.msdn.microsoft.com/dataaccesstechnologies/2012/12/19/error-message-login-failed-the-login-is-from-an-untrusted-domain-and-cannot-be-used-with-windows-authentication/

Saturday, May 13, 2017

BizTalk host BizTalkServerApplication throttled because DatabaseSize exceeded the configured throttling limit

On one of the BizTalk servers were many of  BizTalk WCF service are published started giving  Timeout issue (it was working absolutely fine before that).

The first thought after seeing timeout error is to check the WCF timeout settings, but it couldn't be the reason as those were already configured while deployment, also it worked fine in load scenario too. So it was something else which was to look upon.

Upon visiting the event viewer, found a warning - BizTalkIsolatedHost throttled because DatabaseSize exceeded the configured throttling limit



Learning - Never ignore Warnings ;)



Why it happened

The most probable reason for increase in database size is due to misbehavior of the jobs which are intended to keep everything flowing smoothly in SQL(BizTalk). Thus it needs to be validated  that the jobs are configured properly and also if required clean/shrink the database. 

So it was MessageBox_Message_ManageRefCountLog_BizTalkMsgBoxDb which was failing continuously with below error.
Message
Executed as user: xxx\xxxx. The SELECT permission was denied on the object 'sysjobs', database 'msdb', schema 'dbo'. [SQLSTATE 42000] (Error 229).  The step failed


MessageBox_Message_ManageRefCountLog_BizTalkMsgBoxDb calls the MessageBox_Message_Cleanup_BizTalkMsgBoxDb which deletes the message which have fulfilled the subscription . Whenever message is published in Message box, subscribers get copy of the message and not the actual message as messages in BizTalk are immutable. Upon fulfilling the subscriptions messages are marked for deletion.

Thus messages were getting piled up.


What to do

Somehow there was access issue for the account, which was granted and the job MessageBox_Message_ManageRefCountLog_BizTalkMsgBoxDb was enabled. By default MessageBox_Message_Cleanup_BizTalkMsgBoxDb  is disabled and should not be run manually.