Error on Production web server only

37 views
Skip to first unread message

br...@jonessolutions.com

unread,
Jul 21, 2017, 3:28:04 PM7/21/17
to RavenDB - 2nd generation document database
I have a new ASP.Net Core MVC application 
I deployed it to a server that currently has a RavenDB application on it, that is working
The new application points to the same database as the existing application

The code works on my development machine when pointing at a local or the remote database.

I am new to deploying Raven so forgive me if I am missing something small

The code:
public IDocumentStore Store
        {
            get
            {
                _logger.LogInformation("URL:\t{0}", _Url);
                _logger.LogInformation("DefaultDatabase:\t{0}", _DefaultDatabase);
                var store = new DocumentStore
                {
                    Url = _Url,
                    DefaultDatabase = _DefaultDatabase
                };

                return store.Initialize();
            }
        }
using (var context = store.Store.OpenSession())
            {
                if (Id!=null)
                {
                    _logger.LogInformation(LoggingEvents.GET_ITEM, "Getting item {ID}", Id);
                    if (!Id.StartsWith("object/"))
                        Id = "object/" + Id;
                    try
                    {
                        var current = context.Load<Models.object>(Id);
                        
                        _logger.LogInformation(LoggingEvents.GET_ITEM, "Got item {ID}", Id);
                        transaction.Add(current);
                    }
                    catch(Exception ex)
                    {
                        _logger.LogInformation("Getting an Exception {ID}", Id);
                        _logger.LogCritical(new EventId(1), ex, "", "");
                    }
                }

The code does not hit the catch, I can not log the exception from the code but this is what I can get from the browser:
  • Raven.Abstractions.Connection.ErrorResponseException: An error occurred while sending the request.
       at Raven.Client.Connection.Implementation.HttpJsonRequest.<>c__DisplayClass36_0.<<SendRequestInternal>b__0>d.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 Raven.Client.Connection.Implementation.HttpJsonRequest.<RunWithAuthRetry>d__38`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 Raven.Client.Connection.Implementation.HttpJsonRequest.<ReadResponseJsonAsync>d__35.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 Raven.Client.Connection.Async.AsyncServerClient.<QueryAsyncAsGet>d__99.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 Raven.Client.Connection.ReplicationInformerBase`1.<TryOperationAsync>d__34`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 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
       at Raven.Client.Connection.ReplicationInformerBase`1.<ExecuteWithReplicationAsync>d__33`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 Raven.Client.Connection.Async.AsyncServerClient.<ExecuteWithReplication>d__164`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 Raven.Abstractions.Util.AsyncHelpers.<>c__DisplayClass1_1`1.<<RunSync>b__0>d.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at Raven.Abstractions.Util.AsyncHelpers.RunSync[T](Func`1 task)
       at Raven.Client.Connection.ServerClient.Query(String index, IndexQuery query, String[] includes, Boolean metadataOnly, Boolean indexEntriesOnly)


Oren Eini (Ayende Rahien)

unread,
Jul 21, 2017, 3:29:33 PM7/21/17
to ravendb
There is typically more information in the inner exception, what do you have there?

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Häfele

unread,
Jul 22, 2017, 5:14:12 AM7/22/17
to RavenDB - 2nd generation document database
You're always creating a new instance of the DocumentStore.
Dont do that, it should be a singleton for your application.

br...@jonessolutions.com

unread,
Jul 24, 2017, 12:35:52 PM7/24/17
to RavenDB - 2nd generation document database
I can not get to an inner exception. This message only displays on the page and with a try catch block it is not being caught. I have tried in debug and in production to log the error.

I have figured it out to being a not Authorized error and this has me perplexed

I am using the same app pool as the other website on the same web server. I can modify the system DB to accept all connections and this works.

When trying to access the debug/user I just get the 403 so I have no more information than this.

The only differences in the sites are one is .net core and the other is not but from IIS perspective this should not matter.

Thanks for your thoughts

To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.

Oren Eini (Ayende Rahien)

unread,
Jul 24, 2017, 2:45:21 PM7/24/17
to ravendb
Are you using windows auth or API Key?
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Brian Jones

unread,
Jul 24, 2017, 3:14:44 PM7/24/17
to rav...@googlegroups.com
windows auth no api key

I am using the same app pool so I expect that I am connecting with the same user


--
You received this message because you are subscribed to a topic in the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ravendb/WikWu38Udso/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ravendb+unsubscribe@googlegroups.com.

Oren Eini (Ayende Rahien)

unread,
Jul 24, 2017, 3:45:04 PM7/24/17
to ravendb
Can you capture the traffic via Fiddler to see what is going on?

br...@jonessolutions.com

unread,
Jul 24, 2017, 5:14:59 PM7/24/17
to RavenDB - 2nd generation document database
Fiddler is not picking up the call to the database server. I have attempted to route the web app through fiddler but have not been successful.

if I have windows auth on and I have the user in my app pool that is authenticated am I missing another security measure?

--
You received this message because you are subscribed to a topic in the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ravendb/WikWu38Udso/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ravendb+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Tal Weiss

unread,
Jul 24, 2017, 5:43:56 PM7/24/17
to RavenDB - 2nd generation document database
try adding the below to raven.server.exe.config (you will have to reboot the server also assuming fiddler is configured to port 8888)
<defaultProxy>
<proxy  bypassonlocal="False" proxyaddress="http://127.0.0.1:8888" usesystemdefault="True" />
</defaultProxy>

To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Hibernating Rhinos Ltd  cid:image001.png@01CF95E2.8ED1B7D0

Tal Weiss l Core Team Developer Mobile:+972-54-802-4849

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811l Skype: talweiss1982

RavenDB paving the way to "Data Made Simplehttp://ravendb.net/ 

Brian Jones

unread,
Jul 24, 2017, 6:06:02 PM7/24/17
to rav...@googlegroups.com
So this is on the db server and not the web server then?

I will try that

To unsubscribe from this group and all its topics, send an email to ravendb+unsubscribe@googlegroups.com.

Brian Jones

unread,
Jul 24, 2017, 6:33:49 PM7/24/17
to rav...@googlegroups.com
I restarted the service to no effect

I can not reboot the server right now 

i can reboot tonight

On Mon, Jul 24, 2017 at 3:43 PM, Tal Weiss <t...@ayende.com> wrote:
To unsubscribe from this group and all its topics, send an email to ravendb+unsubscribe@googlegroups.com.

Brian Jones

unread,
Jul 24, 2017, 10:53:13 PM7/24/17
to rav...@googlegroups.com
I did a reboot after placing that in the config and nothing logged in fiddler.

This is a service based install not an IIS based install.




Tal Weiss

unread,
Jul 25, 2017, 9:18:59 AM7/25/17
to RavenDB - 2nd generation document database
Do you have skype or some other program we can use?
My skype name is talweiss1982

Brian Jones

unread,
Jul 25, 2017, 12:51:48 PM7/25/17
to rav...@googlegroups.com
I do have Skype and can be available for a session this afternoon

Tal Weiss

unread,
Jul 25, 2017, 2:11:42 PM7/25/17
to RavenDB - 2nd generation document database
I'm already out of the office. 

Brian Jones

unread,
Jul 25, 2017, 2:52:00 PM7/25/17
to rav...@googlegroups.com
When are you in




--

Hibernating Rhinos Ltd  cid:image001.png@01CF95E2.8ED1B7D0

Tal Weiss l Core Team Developer Mobile:+972-54-802-4849

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811l Skype: talweiss1982

RavenDB paving the way to "Data Made Simplehttp://ravendb.net/ 

--
You received this message because you are subscribed to a topic in the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ravendb/WikWu38Udso/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ravendb+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Hibernating Rhinos Ltd  cid:image001.png@01CF95E2.8ED1B7D0

Tal Weiss l Core Team Developer Mobile:+972-54-802-4849

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811l Skype: talweiss1982

RavenDB paving the way to "Data Made Simplehttp://ravendb.net/ 

--
You received this message because you are subscribed to a topic in the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ravendb/WikWu38Udso/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ravendb+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ravendb/WikWu38Udso/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Brian Jones
505-504-4825

Oren Eini (Ayende Rahien)

unread,
Jul 25, 2017, 3:18:44 PM7/25/17
to ravendb
GMT+2
When are you in

To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Hibernating Rhinos Ltd  cid:image001.png@01CF95E2.8ED1B7D0

Tal Weiss l Core Team Developer Mobile:+972-54-802-4849

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811l Skype: talweiss1982

RavenDB paving the way to "Data Made Simplehttp://ravendb.net/ 

--
You received this message because you are subscribed to a topic in the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ravendb/WikWu38Udso/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ravendb+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Hibernating Rhinos Ltd  cid:image001.png@01CF95E2.8ED1B7D0

Tal Weiss l Core Team Developer Mobile:+972-54-802-4849

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811l Skype: talweiss1982

RavenDB paving the way to "Data Made Simplehttp://ravendb.net/ 

--
You received this message because you are subscribed to a topic in the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ravendb/WikWu38Udso/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ravendb+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ravendb/WikWu38Udso/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ravendb+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
Brian Jones
505-504-4825

--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Brian Jones

unread,
Jul 25, 2017, 3:26:08 PM7/25/17
to rav...@googlegroups.com
I can be available at 2-3 GMT+2 which is 6-7 am here


Oren Eini (Ayende Rahien)

unread,
Jul 25, 2017, 3:29:42 PM7/25/17
to ravendb
That will work tomorrow
Reply all
Reply to author
Forward
0 new messages