I'm having an issue trying to create indexes on RavenDB 3.5
When creating more than 3 indexes the application just dies, getting a
Unable to connect to the remote server Status Code: ConnectFailure
The index creation code is farely straight forward:
private static void CreateIndexes(IDocumentStore documentStore)
{
new PurchaseOrder_QueryByExternalReference().Execute(documentStore);
new SupplierDocument_QueryBySupplierName().Execute(documentStore);
new ProductDocument_QueryByProductIdAndName().Execute(documentStore);
new PurchaseOrderLine_QueryableIndex().Execute(documentStore);
new PurchaseOrderLine_ForPurchaseOrderIndex().Execute(documentStore);
}
But the same happens if the
IndexCreation.CreateIndexes(typeof(MyIndexClass).Assembly, store);
method is called. This happens with any 3 indexes from the list on any order.
Full stack-trace is this:
exception
{"A task was canceled."}
Data: {System.Collections.ListDictionaryInternal}
Etag: null
HResult: -2146233088
HelpLink: null
InnerException: null
Message: "A task was canceled."
Response: {StatusCode: 503, ReasonPhrase: 'Service Unavailable', Version: 1.1, Content: , Headers:
{
}}
ResponseString: "Unable to connect to the remote server Status Code: ConnectFailure"
Source: "Raven.Client.Lightweight"
StackTrace: " at Raven.Client.Connection.Implementation.HttpJsonRequest.<>c__DisplayClass36_0.<b__0>d.MoveNext() in C:\Builds\RavenDB-Stable-3.5\Raven.Client.Lightweight\Connection\Implementation\HttpJsonRequest.cs:line 258
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Raven.Client.Connection.Implementation.HttpJsonRequest.d__381.MoveNext() in C:\\Builds\\RavenDB-Stable-3.5\\Raven.Client.Lightweight\\Connection\\Implementation\\HttpJsonRequest.cs:line 312
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Raven.Client.Connection.Implementation.HttpJsonRequest.<ReadResponseJsonAsync>d__35.MoveNext() in C:\\Builds\\RavenDB-Stable-3.5\\Raven.Client.Lightweight\\Connection\\Implementation\\HttpJsonRequest.cs:line 221
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Raven.Client.Connection.Async.AsyncServerClient.<>c__DisplayClass69_0.<<GetIndexAsync>b__0>d.MoveNext() in C:\\Builds\\RavenDB-Stable-3.5\\Raven.Client.Lightweight\\Connection\\Async\\AsyncServerClient.cs:line 726
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Raven.Client.Connection.ReplicationInformerBase1.d__341.MoveNext() in C:\\Builds\\RavenDB-Stable-3.5\\Raven.Client.Lightweight\\Connection\\ReplicationInformerBase.cs:line 417
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Raven.Client.Connection.ReplicationInformerBase1.d__331.MoveNext() in C:\\Builds\\RavenDB-Stable-3.5\\Raven.Client.Lightweight\\Connection\\ReplicationInformerBase.cs:line 316
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Raven.Client.Connection.Async.AsyncServerClient.<ExecuteWithReplication>d__1641.MoveNext() in C:\Builds\RavenDB-Stable-3.5\Raven.Client.Lightweight\Connection\Async\AsyncServerClient.cs:line 0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Raven.Abstractions.Util.AsyncHelpers.<>c__DisplayClass1_11.<<RunSync>b__0>d.MoveNext() in C:\\Builds\\RavenDB-Stable-3.5\\Raven.Abstractions\\Util\\AsyncHelpers.cs:line 75
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Raven.Abstractions.Util.AsyncHelpers.RunSync[T](Func1 task) in C:\Builds\RavenDB-Stable-3.5\Raven.Abstractions\Util\AsyncHelpers.cs:line 89
at Raven.Client.Connection.ServerClient.GetIndex(String name) in C:\Builds\RavenDB-Stable-3.5\Raven.Client.Lightweight\Connection\ServerClient.cs:line 222\
at Raven.Client.Indexes.AbstractIndexCreationTask.Execute(IDatabaseCommands databaseCommands, DocumentConvention documentConvention) in C:\Builds\RavenDB-Stable-3.5\Raven.Client.Lightweight\Indexes\AbstractIndexCreationTask.cs:line 304
at Raven.Client.DocumentStoreBase.ExecuteIndex(AbstractIndexCreationTask indexCreationTask) in C:\Builds\RavenDB-Stable-3.5\Raven.Client.Lightweight\DocumentStoreBase.cs:line 102
at Raven.Client.Indexes.AbstractIndexCreationTask.Execute(IDocumentStore store) in C:\Builds\RavenDB-Stable-3.5\Raven.Client.Lightweight\Indexes\AbstractIndexCreationTask.cs:line 221
at Persistence.Database.Adapter.RavenDb.RavenDbDocumentStoreFactory.CreateIndexes(IDocumentStore documentStore) in \my\route\Persistence.Database.Adapter\RavenDb\RavenDbDocumentStoreFactory.cs:line 50
at Persistence.Database.Adapter.RavenDb.RavenDbDocumentStoreFactory.ConfigureDocumentStore(IDocumentStore documentStore) in \my\route\Persistence.Database.Adapter\RavenDb\RavenDbDocumentStoreFactory.cs:line 38
at Persistence.Database.Adapter.RavenDb.RavenDbDocumentStoreFactory.Create(String ravenDbLocation, String ravenDbDatabase) in \my\route\Persistence.Database.Adapter\RavenDb\RavenDbDocumentStoreFactory.cs:line 22
at Persistence.Database.Adapter.PersistenceAdapter.<.ctor>b__8_0() in \my\route\Persistence.Database.Adapter\PersistenceAdapter.cs:line 53
at Persistence.Database.Adapter.PersistenceAdapter.RegisterRavenDbUtilities() in \my\route\Persistence.Database.Adapter\PersistenceAdapter.cs:line 175
at Persistence.Database.Adapter.PersistenceAdapter.RegisterRavenLogic() in \my\route\Persistence.Database.Adapter\PersistenceAdapter.cs:line 86
at Persistence.Database.Adapter.PersistenceAdapter.Initialize() in \my\route\Persistence.Database.Adapter\PersistenceAdapter.cs:line 74
at My-Program.ConfigurePersistentAdapter(Settings settings) in \my\route\MessageQueueListener\MessageQueueListenerService.cs:line 153
at My-Program.AddBootstrapperExtension() in \my\route\net-stock-purchasing-service.MessageQueueListener\MessageQueueListenerService.cs:line 118
at My-Program.Startup() in \my\route\net-stock-purchasing-service.MessageQueueListener\MessageQueueListenerService.cs:line 78"
StatusCode: ServiceUnavailable
TargetSite: {Void MoveNext()}
When RavenDB 3.5 was release, something broke in the client package.
If you are running RavenDB.Client from 3.0.30000 to 3.0.30179, then it should work.
If you are running a higher version, then you will encounter (in certain conditions) this exception. To resolve that, you can use an alternate API: store.DatabaseCommands.PutIndexes.
var indexes = new List<AbstractIndexCreationTask>();
indexes.Add(new MyIndex1());
indexes.Add(new MyIndex2());
indexes.Add(new MyIndex....());
var transfos = new List<AbstractTransformerCreationTask>();
transfos.Add(new MyTransformer1());
transfos.Add(new MyTransformer2());
transfos.Add(new MyTransformer...());
// put indexes in 1 command
var indexesToPut = IndexCreation.CreateIndexesToAdd(indexes, documentStore.Conventions);
documentStore.DatabaseCommands.PutIndexes(indexesToPut);
// don't forget transformers
foreach (var item in transfos)
{
item.Execute(Store);
}
This should solve your problem.
I was encountering this problem after upgrading my client package. Note that the exception occurred only in console applications and not in my web applications.
That solved the issue for me:
var indexes = IndexCreation.CreateIndexesToAdd(new List<AbstractIndexCreationTask> {...}, store.Conventions);
var alreadyExisting = store.DatabaseCommands.GetIndexes(0, 128)
.ToDictionary(i => i.Name);
foreach (var index in indexes.Where(i => !alreadyExisting.ContainsKey(i.Name)))
store.DatabaseCommands.PutIndex(index.Name, index.Definition);
store.DatabaseCommands.PutIndexes(indexes);
In my case it turned out to be due to a mismatch of ravendb client library and the installed server. My application was running the latest version of the RavenDB client and the server is using version 3.0
Related
We are receiving an error for a single user when using the Graph API. We are not receiving this error for other user accounts. The process is going through e-mail subjects looking for subjects that begin with certain phrases. If they begin with these phrases it marks their calendars as "On Leave" for those appointments.
Has anyone run into an error like this or have some tips for troubleshooting?
Thank you,
Brian Aldridge
LeaveExchangeSync Errored -- System.AggregateException: One or more errors occurred. ---> System.Exception: Exception while invoking Graph API URL https://graph.microsoft.com/beta/Users/aankrah#resdat.com/calendar/calendarView?startDateTime=2019-11-17T19:04:41&endDateTime=2021-11-17T19:04:41&top=100 ---> Microsoft.Graph.ServiceException: Code: UnknownError
Inner error
at Microsoft.Graph.HttpProvider.d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at RDI.Core.Azure.GraphServiceClientExtensions.d__0.MoveNext() in C:\code\Intranet\RDI.Core\Azure\GraphServiceClientExtensions.cs:line 48
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at RDI.Service.Plugins.LeaveExchangeSync.Office365Layer.d__3.MoveNext() in C:\code\Intranet\RDI.Service.Plugins.LeaveExchangeSync\Office365Layer.cs:line 55
--- End of inner exception stack trace ---
at RDI.Service.Plugins.LeaveExchangeSync.Office365Layer.d__3.MoveNext() in C:\code\Intranet\RDI.Service.Plugins.LeaveExchangeSync\Office365Layer.cs:line 87
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at RDI.Service.Plugins.LeaveExchangeSync.CalendarService.<>c__DisplayClass21_0.<b__0>d.MoveNext() in C:\code\Intranet\RDI.Service.Plugins.LeaveExchangeSync\CalendarService.cs:line 168
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at RDI.Service.Plugins.LeaveExchangeSync.CalendarService.GetUserEvents(String user) in C:\code\Intranet\RDI.Service.Plugins.LeaveExchangeSync\CalendarService.cs:line 168
at RDI.Service.Plugins.LeaveExchangeSync.CalendarService.GetVacationEvents(String user) in C:\code\Intranet\RDI.Service.Plugins.LeaveExchangeSync\CalendarService.cs:line 152
at RDI.Service.Plugins.LeaveExchangeSync.CalendarService.SyncAutomatedAppointments(List1 users, List`1 appointments, String eventType) in C:\code\Intranet\RDI.Service.Plugins.LeaveExchangeSync\CalendarService.cs:line 67
at RDI.Service.Plugins.LeaveExchangeSync.LeaveExchangeSync.OnTimer(Object sender, ElapsedEventArgs e) in C:\code\Intranet\RDI.Service.Plugins.LeaveExchangeSync\LeaveExchangeSync.cs:line 109
---> (Inner Exception #0) System.Exception: Exception while invoking Graph API URL https://graph.microsoft.com/beta/Users/aankrah#resdat.com/calendar/calendarView?startDateTime=2019-11-17T19:04:41&endDateTime=2021-11-17T19:04:41&top=100 ---> Microsoft.Graph.ServiceException: Code: UnknownError
Inner error
at Microsoft.Graph.HttpProvider.d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at RDI.Core.Azure.GraphServiceClientExtensions.d__0.MoveNext() in C:\code\Intranet\RDI.Core\Azure\GraphServiceClientExtensions.cs:line 48
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at RDI.Service.Plugins.LeaveExchangeSync.Office365Layer.d__3.MoveNext() in C:\code\Intranet\RDI.Service.Plugins.LeaveExchangeSync\Office365Layer.cs:line 55
--- End of inner exception stack trace ---
at RDI.Service.Plugins.LeaveExchangeSync.Office365Layer.d__3.MoveNext() in C:\code\Intranet\RDI.Service.Plugins.LeaveExchangeSync\Office365Layer.cs:line 87
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at RDI.Service.Plugins.LeaveExchangeSync.CalendarService.<>c__DisplayClass21_0.<b__0>d.MoveNext() in C:\code\Intranet\RDI.Service.Plugins.LeaveExchangeSync\CalendarService.cs:line 168<---
My best debugging tip would be to make that call with a tool such as postman. Inspect what's different about it from other users, or if the graph service is returning a valid HTTP code. It looks like the actual error is being buried beneath the libraries.
I have some scenarios where I need to send messages with body:
""
When I try to do that using the following code:
var sqsClient= new AmazonSQSClient(new BasicAWSCredentials("accessKeyId","SecretKey"), new AmazonSQSConfig()
{
ServiceURL ="https://sqs.eu-west-1.amazonaws.com/"
});
//obj value is "" and provided from user
var result = sqsClient.SendMessageAsync("queueURL", obj.ToString()).Result;
I get:
{Amazon.SQS.AmazonSQSException: The request must contain the parameter
MessageBody. ---> Amazon.Runtime.Internal.HttpErrorResponseException:
Exception of type 'Amazon.Runtime.Internal.HttpErrorResponseException'
was thrown. at
Amazon.Runtime.HttpWebRequestMessage.d__20.MoveNext()
in
E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\HttpHandler_mobile\HttpRequestMessageFactory.cs:line
539
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Amazon.Runtime.Internal.HttpHandler1.<InvokeAsync>d__91.MoveNext()
in
E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\HttpHandler\HttpHandler.cs:line
175
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Amazon.Runtime.Internal.Unmarshaller.d__31.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Amazon.SQS.Internal.ValidationResponseHandler.<InvokeAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Amazon.Runtime.Internal.ErrorHandler.d__51.MoveNext()
--- End of inner exception stack trace --- at Amazon.Runtime.Internal.HttpErrorResponseExceptionHandler.HandleException(IExecutionContext
executionContext, HttpErrorResponseException exception) in
E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\ErrorHandler\HttpErrorResponseExceptionHandler.cs:line
60 at
Amazon.Runtime.Internal.ErrorHandler.ProcessException(IExecutionContext
executionContext, Exception exception) in
E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\ErrorHandler\ErrorHandler.cs:line
212 at
Amazon.Runtime.Internal.ErrorHandler.<InvokeAsync>d__51.MoveNext() in
E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\ErrorHandler\ErrorHandler.cs:line
104
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Amazon.Runtime.Internal.CallbackHandler.d__91.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Amazon.Runtime.Internal.EndpointDiscoveryHandler.<InvokeAsync>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
Amazon.Runtime.Internal.EndpointDiscoveryHandler.d__21.MoveNext()
in
E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\Handlers\EndpointDiscoveryHandler.cs:line
79
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Amazon.Runtime.Internal.CredentialsRetriever.<InvokeAsync>d__71.MoveNext()
in
E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\Handlers\CredentialsRetriever.cs:line
98
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Amazon.Runtime.Internal.RetryHandler.d__101.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
Amazon.Runtime.Internal.RetryHandler.<InvokeAsync>d__101.MoveNext()
in
E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\RetryHandler\RetryHandler.cs:line
153
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Amazon.Runtime.Internal.CallbackHandler.d__91.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Amazon.Runtime.Internal.CallbackHandler.<InvokeAsync>d__91.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Amazon.Runtime.Internal.ErrorCallbackHandler.d__51.MoveNext()
in
E:\JenkinsWorkspaces\v3-trebuchet-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Pipeline\Handlers\ErrorCallbackHandler.cs:line
58
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Amazon.Runtime.Internal.MetricsHandler.<InvokeAsync>d__11.MoveNext()}
However sending:
" "
Works well!
Is there any workarrounds to send only
""
You say you are trying to set the body to "" but what you are actually doing is setting the body to the 0 byte empty string between the two ". A string literal does not actually contain the quotes that surround it. If empty string is what you actually want to send, that is not valid in SQS.
the message body must not be empty or null.
https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html
However, if you're actually trying to send two bytes of ASCII 0x22 " quote characters, those would need to appear and be escaped inside your string literal.
var result = sqsClient.SendMessageAsync("queueURL", "\"\"").Result;
(Note that the citation from the SQS developer guide comes from a page concerned primarily with message atttibutes, but it does refer to the actual message body, not the message attributes, whose content is referred to as Value, not "body," and is mentioned separately as also not supporting empty or null.)
I'm getting the following error in logs for WebAPI
System.Web.HttpException (0x800703E3): The client disconnected. at
System.Web.Hosting.IIS7WorkerRequest.EndRead(IAsyncResult asyncResult)
at System.Web.HttpBufferlessInputStream.EndRead(IAsyncResult
asyncResult) at System.Threading.Tasks.TaskFactory
1.FromAsyncTrimPromise 1.Complete(TInstance thisRef, Func 3 endMethod, IAsyncResult asyncResult, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at System.IO.StreamReader.d__97.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
System.IO.StreamReader.d__62.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at Microsoft.Owin.OwinRequest.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Microsoft.Owin.Security.OAuth.OAuthAuthorizationServerHandler.d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Microsoft.Owin.Security.OAuth.OAuthAuthorizationServerHandler.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware
1.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at Web.API.Middleware.OwinMiddleware.d__1.MoveNext()
in D:\UAT\Web.API\Middleware\OwinMiddleware.cs:line 49
How can I handle and ignore these exceptions by exception filter? Why this error occurs and how can I reproduce that? I wanna catch and ignore only The client disconnected but not all HttpException
I saw this similar question but how can I do that in exception filter?
You can ignore these exceptions.
The exception says what the problem is: "The client disconnected". It means that the client initiated a request but then disconnected before it bothered to read all of the response.
There are any numbers of reasons why that might be the case, but (unless you have a dodgy internet connection at your server end) it is almost certainly an issue at the client end. I regularly see these myself and mostly it seems to be related to a bot. So I filter them out and ignore them.
try
{
// Open Connection
// Do stuff
}
catch (HttpException ex)
{
// Log it?
// Ignore it?
// Do what you want with it?
}
finally
{
// Close connection
}
when I try to install grandnode, it gives me this error.
A timeout occured after 30000ms selecting a server using
CompositeServerSelector{ Selectors = ReadPreferenceServerSelector{
ReadPreference = { Mode : Primary } }, LatencyLimitingServerSelector{
AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster
state is { ClusterId : "1", ConnectionMode : "Automatic", Type :
"Unknown", State : "Disconnected", Servers : [{ ServerId: "{ ClusterId
: 1, EndPoint : "123.223.223.11:27111" }", EndPoint:
"123.223.223.11:27111", State: "Disconnected", Type: "Unknown",
HeartbeatException: "MongoDB.Driver.MongoConnectionException: An
exception occurred while opening a connection to the server. --->
MongoDB.Driver.MongoAuthenticationException: Unable to authenticate
username 'testing' on database 'grandnodetest'. --->
MongoDB.Driver.MongoCommandException: Command authenticate failed:
auth fails. at
MongoDB.Driver.Core.WireProtocol.CommandWireProtocol1.ProcessReply(ConnectionId
connectionId, ReplyMessage1 reply) at
MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1.d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
MongoDB.Driver.Core.Authentication.MongoDBCRAuthenticator.d__7.MoveNext()
--- End of inner exception stack trace --- at MongoDB.Driver.Core.Authentication.MongoDBCRAuthenticator.d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
MongoDB.Driver.Core.Authentication.AuthenticationHelper.d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
MongoDB.Driver.Core.Connections.ConnectionInitializer.d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
MongoDB.Driver.Core.Connections.BinaryConnection.d__48.MoveNext()
--- End of inner exception stack trace --- at MongoDB.Driver.Core.Connections.BinaryConnection.d__48.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task
task) at
MongoDB.Driver.Core.Servers.ServerMonitor.d__27.MoveNext()"
}] }
can anyone help me with this? I am running the project from local.
Please and Thank you.
You are using an older version of MongoDB than is supported by your application. Please use MongoDB version 3.0 or higher and try again. If the problem happens again, please reach out to me on our support.
I have deployed a Telerik Report (v9.1.15.731) on a machine, and the report itself works great. But when I try to “Export” the report, or click the "Print" icon on it, after the “Save As” window appears and I save, the file doesn't get saved.
It eventually does get saved, but once in every 10-15 tries. But it is random. And this issue occurs only in Telerik's Reporting.
I have checked the EventViewer Log and found that the following exception appeared every time this issue was faced.
"Server cannot append header after HTTP headers have been sent."
Here is the full log:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 12-Dec-16 11:03:18 AM
Event time (UTC): 12-Dec-16 8:03:18 AM
Event ID: 3d4f8afcdaba4ed5bc5786c27a4311ee
Event sequence: 40
Event occurrence: 1
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/4/ROOT-7-131260033658791910
Trust level: Full
Application Virtual Path: /
Application Path: C:\Kit\CCB-GP-Reports\
Machine name: CCBSQL
Process information:
Process ID: 1384
Process name: w3wp.exe
Account name: CONSCRT\administrator
Exception information:
Exception type: HttpException
Exception message: Server cannot append header after HTTP headers have been sent.
at System.Web.HttpHeaderCollection.SetHeader(String name, String value, Boolean replace)
at Microsoft.Owin.Host.SystemWeb.CallHeaders.AspNetResponseHeaders.Set(String key, String[] values)
at Microsoft.Owin.Infrastructure.OwinHelpers.AppendHeaderUnmodified(IDictionary''2 headers, String key, String[] values)
at Microsoft.Owin.Infrastructure.ChunkingCookieManager.AppendResponseCookie(IOwinContext context, String key, String value, CookieOptions options)
at Microsoft.Owin.Security.Cookies.CookieAuthenticationHandler.d__f.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Owin.Security.Infrastructure.AuthenticationHandler.d__b.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Owin.Security.Infrastructure.AuthenticationHandler.d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Owin.Security.Infrastructure.AuthenticationHandler.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware''1.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware''1.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork(IAsyncResult ar)
at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Request information:
Request URL: http://ccbsql:1010/api/reports/clients/110315-5a11/instances/103714-54ba/documents/110316-df3e110316-3e23/resources/f6a8312b165f4639a029ba42c07f56bc/
Request path: /api/reports/clients/110315-5a11/instances/103714-54ba/documents/110316-df3e110316-3e23/resources/f6a8312b165f4639a029ba42c07f56bc/
User host address: 192.168.5.8
User: admin
Is authenticated: True
Authentication Type: ApplicationCookie
Thread account name: CONSCRT\administrator
Thread information:
Thread ID: 13
Thread account name: CONSCRT\administrator
Is impersonating: False
Stack trace: at System.Web.HttpHeaderCollection.SetHeader(String name, String value, Boolean replace)
at Microsoft.Owin.Host.SystemWeb.CallHeaders.AspNetResponseHeaders.Set(String key, String[] values)
at Microsoft.Owin.Infrastructure.OwinHelpers.AppendHeaderUnmodified(IDictionary''2 headers, String key, String[] values)
at Microsoft.Owin.Infrastructure.ChunkingCookieManager.AppendResponseCookie(IOwinContext context, String key, String value, CookieOptions options)
at Microsoft.Owin.Security.Cookies.CookieAuthenticationHandler.d__f.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Owin.Security.Infrastructure.AuthenticationHandler.d__b.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Owin.Security.Infrastructure.AuthenticationHandler.d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Owin.Security.Infrastructure.AuthenticationHandler.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware''1.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware''1.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork(IAsyncResult ar)
at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Custom event details:
I have been stuck on this issue for about a month now, and I would really appreciate any help, suggestions or ideas to find a fix for this.
Thank You!
Best Regards,
veggiedude