1

From times to times I receive an exception that looks to be appearing when my NServiceBus console shows the following message:

NServiceBus.Timeout.Hosting.Windows.TimeoutPersisterReceiver [(null)] <(null)> - Polling next retrieval is at 11/19/2015 11:20:49.

.

Exception:
A first chance exception of type 'System.Net.WebException' occurred in System.dll

Additional information: The remote server returned an error: (404) Not Found.

Callstack:
    [External Code] 
    Raven.Client.Lightweight!Raven.Client.Connection.HttpJsonRequest.ReadJsonInternal(System.Func<System.Net.WebResponse> getResponse) Line 332 C#
    Raven.Client.Lightweight!Raven.Client.Connection.HttpJsonRequest.ReadResponseJson() Line 225    C#
    Raven.Client.Lightweight!Raven.Client.Connection.ServerClient.DirectGet(string serverUrl, string key) Line 203  C#
    Raven.Client.Lightweight!Raven.Client.Connection.ReplicationInformer.RefreshReplicationInformation(Raven.Client.Connection.ServerClient commands) Line 351  C#

Raven.Client.Lightweight!Raven.Client.Connection.ReplicationInformer.UpdateReplicationInformationIfNeeded.AnonymousMethod__6() Line 134 C#
    [External Code]

It's an exception that it's thrown and caught inside RavenDB code it self, so I suspect this doesn't interfere with my own code. But I might be hiding a problem.

So I'm wondering why is this exception happening and how can I avoid it?

Miguel
  • 53
  • 7

1 Answers1

0

That is fine, 404 error is raised when you are trying to load a non existant document. This is expected and part of how this works.

Ayende Rahien
  • 22,925
  • 1
  • 36
  • 41
  • That's not fine for me because I'm seeing that exception stoping my Visual Studio while debugging and that's annoying. That's why I believe an Exception should be raised only on an exceptional case and caused by external interference and not by your own code. If it's normal for RavenDB code then they should be returning an error code instead of raising exceptions – Miguel Nov 19 '15 at 15:27
  • You need to take that with Microsoft. That exception is being raised by the WebRequest class, and we didn't write that. – Ayende Rahien Nov 20 '15 at 17:11
  • No, Microsoft doesn't throw exceptions without a good reason! If they're throwing that Exception is because you're requesting a Web object that doesn't exist, when you shouldn't. – Miguel Nov 21 '15 at 12:44
  • Are you starting this endpoint with elevated permissions (as admin)? – Sean Farmar Nov 21 '15 at 14:48
  • Miguel, you are trying to load a document that doesn't exist, so we return 404. Client side, that 404 is turned into exception – Ayende Rahien Nov 22 '15 at 12:48