The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The problem is solved by restarting the application in biztalk - sql-server

Consider the following error message:
Timestamp: 9/11/2018 3:09:34 PM
Message: Class: XXX.MW.BackEnds.oTransaccoesSuspeitas Method: Microsoft.XLANGs.Core.StopConditions segment7(Microsoft.XLANGs.Core.StopConditions) : Exception: An error occurred while processing the message, refer to the details section for more information
Message ID: {139DCE33-4627-4103-9B25-1906EBAD14A8}
Instance ID: {1F943998-158C-4357-8E2A-0473B9425CD3}
Error Description: System.Net.WebException: The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The authentication header received from the server was 'NTLM'.
401 UNAUTHORIZED
Stack Microsoft.XLANGs.BizTalk.Engine
Category: Critical
Priority: 4
EventId: 0
Severity: Critical
Title:XXX.MW.BackEnds, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1512f695a673d231
Machine: CORE04
Application Domain: __XDomain_3.0.1.0_0
Process Id: 54889
Process Name: C:\Program Files (x86)\Microsoft BizTalk Server 2013 R2\BTSNTSvc.exe
Win32 Thread Id: 7844
Thread Name:
Extended Properties: Exception - Microsoft.XLANGs.Core.XlangSoapException: An error occurred while processing the message, refer to the details section for more information
Message ID: {139DCE33-4627-4103-9B25-1906EBAD14A8}
Instance ID: {1F943998-158C-4357-8E2A-0473B9425CD3}
Error Description: System.Net.WebException: The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The authentication header received from the server was 'NTLM'.
401 UNAUTHORIZED
at Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase.VerifyTransport(Envelope env, Int32 operationId, Context ctx)
at Microsoft.XLANGs.Core.Subscription.Receive(Segment s, Context ctx, Envelope& env, Boolean topOnly)
at Microsoft.XLANGs.Core.PortBase.GetMessageId(Subscription subscription, Segment currentSegment, Context cxt, Envelope& env, CachedObject location)
at XXX.MW.BackEnds.oTransaccoesSuspeitas.segment2(StopConditions stopOn)
at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)
The error is being thrown by an orchestration during the processing of a message obtained from an SQL table.
The data was obtained successfully because I have a readingIndex that's updated by biztalk.
The problem happens randomly, but I can fix it by restarting the biztalk application.
What could possibly be causing the problem?
Do I reset some identification code by restarting the applications?

Related

Cross-Origin Request Blocked: Authentication issue

ABP version 4.4 APP with identity server with angular EF core
my angular client send the username and password to identity server that is part of my abp application (mean same URL for api and identity server) that returns me token but after very next request for "api/abp/application-configuration" return with CORs error.
same application work for QA local environment with local config.
same call for "api/abp/application-configuration" work on app start because that time token is not attached in request header
i check my app setting CorsOrigins are matching with IdentityServerClientCorsOrigins
no space issue both angular and front end on https but with different port. you can verify with logs. one thing is strange in log no protocol attach # respond. (domain:1000)
I check and confirm that this is Authentication issue. by comment these two line and Authorize attribute from class
My application works fine. no issue for cors
app.UseAuthentication();
app.UseJwtTokenMiddleware();
system log
2021-09-04 10:42:24.731 -04:00 [INF] Request starting HTTP/2 OPTIONS https://domain:1000/.well-known/openid-configuration - -
2021-09-04 10:42:24.745 -04:00 [INF] CORS policy execution successful.
2021-09-04 10:42:24.751 -04:00 [INF] Request finished HTTP/2 OPTIONS https://domain:1000/.well-known/openid-configuration - - - 204 - - 19.7919ms
2021-09-04 10:42:24.793 -04:00 [INF] Request starting HTTP/2 GET https://domain:1000/.well-known/openid-configuration - -
2021-09-04 10:42:24.794 -04:00 [INF] CORS policy execution successful.
2021-09-04 10:42:46.050 -04:00 [ERR] Exception occurred while processing message.
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'System.String'.
System.IO.IOException: IDX20804: Unable to retrieve document from: 'System.String'.
System.Net.Http.HttpRequestException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (domain:1000)
System.Net.Sockets.SocketException (10060): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
It is not a CORS issue, instead it is because your API (the UseJwtTokenMiddleware part) can't reach your IdentityServer over HTTP(s). I guess you got some DNS/Certificate/Network issue to resolve.

How to change solr.jetty.request.header.size in docker

I have created a Solr version 8.1.1 in Azure using a Docker for Sitecore. I get the following error for a large query
ERROR Error during executing a query.
Exception: SolrNet.Exceptions.SolrConnectionException
Message: <h1>Bad Message 431</h1><pre>reason: Request Header Fields Too Large</pre>
Source: SolrNet
at SolrNet.Impl.SolrConnection.Get(String relativeUrl, IEnumerable`1 parameters)
at SolrNet.Impl.SolrQueryExecuter`1.Execute(ISolrQuery q, QueryOptions options)
at Sitecore.ContentSearch.SolrProvider.LinqToSolrIndex`1.ExecuteQuery(SolrCompositeQuery compositeQuery, QueryOptions options)
Nested Exception
Exception: System.Net.WebException
Message: The remote server returned an error: (431) Request Header Fields Too Large.
Source: System
at System.Net.HttpWebRequest.GetResponse()
at HttpWebAdapters.Adapters.HttpWebRequestAdapter.GetResponse()
at SolrNet.Impl.SolrConnection.GetResponse(IHttpWebRequest request)
at SolrNet.Impl.SolrConnection.Get(String relativeUrl, IEnumerable`1 parameters)
I managed to resolve the issue by redeploy the Docker instance by updating the YML file with the following setting under environment section.
- SOLR_OPTS=-Dsolr.jetty.request.header.size=65535

Reliable way to connect to Amazon RDS endpoint

Currently we connect from our app to the RDS endpoint using it's hostname:
xxxx-db.xxxxxxxxxxxxx.eu-west-1.rds.amazonaws.com
It seems the dns service went down for a period of time last night resulting in:
ERROR - 2019-07-11 23:02:46 --> Severity: Warning --> mysqli::real_connect(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution /var/app/current/system/database/drivers/mysqli/mysqli_driver.php 201
ERROR - 2019-07-11 23:02:46 --> Severity: Warning --> mysqli::real_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution /var/app/current/system/database/drivers/mysqli/mysqli_driver.php 201
ERROR - 2019-07-11 23:02:46 --> Unable to connect to the database
Is there a better way to access the DB server skipping the dns?

Failed to connect to the remote extension host server

after port forwarding, the error message shows in the notification center:
Failed to connect to the remote extension host server (Error: Connection error: Unauthorized client refused.)

SQL Server Backup To URL failing intermittently

SQL Server 2014 SP2, Windows Server 2012 R2 (full updates) running on a DS13 Azure VM.
I'm running a full backup to an Azure Storage account, and it's intermittently failing, without much information.
The database in question is just under 100GB uncompressed, and just under 9GB compressed.
With dbcc traceon(3051,-1) I am able to see the log contents. The only signs that anything is wrong are a number of these:
7/12/2016 3:45:16 PM: Result recorded Exception Message: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.
7/12/2016 3:45:16 PM: HTTP status code -1, HTTP Status Message
7/12/2016 3:45:25 PM: Result recorded Exception Message: Unable to read data from the transport connection: The connection was closed.
7/12/2016 3:45:25 PM: HTTP status code -1, HTTP Status Message
7/12/2016 3:45:25 PM: Result recorded Exception Message: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.
7/12/2016 3:45:25 PM: HTTP status code -1, HTTP Status Message
Eventually I see:
7/12/2016 3:45:39 PM: Throttling State Encountered: ParallelThreads allowed 1, Outstanding Ops 16, throttleDelta 1
It stays at 1 ParallelThread for a bit, then slowly start ramping back up with normal results, until the end of log:
7/12/2016 3:49:29 PM: An unexpected exception occurred during communication on VDI Channel.
7/12/2016 3:49:29 PM: Exception Info: Unrecoverable error occurred during Flush operation
7/12/2016 3:49:29 PM: Stack: at Microsoft.SqlServer.VdiInterface.VDI.AsyncIOCompletion(BlobRequestOptions options, List`1 asyncResults, CloudPageBlob pageBlob, Boolean onFlush)
at Microsoft.SqlServer.VdiInterface.VDI.PerformPageDataTransfer(CloudPageBlob pageBlob, AccessCondition leaseCondition, Boolean forBackup)
7/12/2016 3:49:29 PM: The Active queue had 0 requests until we got a clearerror
7/12/2016 3:49:29 PM: A fatal error occurred during Engine Communication, exception information follows
7/12/2016 3:49:29 PM: Exception Info: Unrecoverable error occurred during Flush operation
7/12/2016 3:49:29 PM: Stack: at Microsoft.SqlServer.VdiInterface.VDI.PerformPageDataTransfer(CloudPageBlob pageBlob, AccessCondition leaseCondition, Boolean forBackup)
at BackupToUrl.Program.MainInternal(String[] args)
In Task Manager, I can see BackupToUrl.exe disappear, but the SQL query still executes for a while. The Azure storage account still shows the database as 1TB in size (as it does while it's normally in the process of uploading). Eventually the SQL query returns with the following error, and the Azure storage account is updated to remove the .bak file:
Processed 7056520 pages for database '<removed>', file '<removed>' on file 1.
Processed 3 pages for database '<removed>', file '<removed>_log' on file 1.
Msg 3271, Level 16, State 1, Line 1
A nonrecoverable I/O error occurred on file "https://<removed>.blob.core.windows.net/<removed>/<removed>.bak:" Backup to URL received an exception from the remote endpoint. Exception Message: Unrecoverable error occurred during Flush operation.
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.
Does anyone have any clue what can be done to diagnose and resolve this problem?
Turns out this was due to the Azure VM's Host having IO errors communicating to the storage account. Once the VM was redeployed to new hardware, the problem was resolved. This was allegedly caused by a platform bug.

Resources