Strange behavior with Index creation

121 views
Skip to first unread message

Riccardo Villa

unread,
Mar 22, 2017, 12:34:14 PM3/22/17
to RavenDB - 2nd generation document database
Hi,

I'm running into a frustrating issue with index creation.

Build: #35187 / Raven installed as a service (no IIS).

My document store is like this:

        public static DocumentStore GetDocumentStore(RavenDbConfiguration config)
       
{
           
var store = new DocumentStore()
           
{
               
Url = config.RavenDbUrl,
               
DefaultDatabase = config.RavenDbDatabase
           
};

            store
.Conventions.FindTypeTagName = type => type.IsSubclassOf(typeof(Sheet)) ? DocumentConvention.DefaultTypeTagName(typeof(Sheet)) : DocumentConvention.DefaultTypeTagName(type);

            store
.Conventions.RegisterIdConvention<IDocument>((dbname, commands, document) => document.GetId());
            store
.Conventions.RegisterAsyncIdConvention<IDocument>((dbname, commands, document) => new CompletedTask<string>(document.GetId()));

            store
.Initialize();

           
//Indexes
           
new AttachmentItemsByOriginalDocumentSourceAndOriginalId().Execute(store);
           
new SheetForSearch().Execute(store);

           
return store;
       
}


The first time I execute this it's all ok and my indexes are created correctly, but then if I restart my application the first query I execute it give me error 503 with a timeout message.

Message: Unable to connect to the remote server. Status Code: ConnectFailure
StackTrace: 
   at Raven.Client.Connection.Implementation.HttpJsonRequest.<>c__DisplayClass36_0.<<SendRequestInternal>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.<RunWithAuthRetry>d__38`1.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 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Raven.Client.Connection.Async.AsyncServerClient.<DirectGetAsync>d__71.MoveNext() in C:\Builds\RavenDB-Stable-3.5\Raven.Client.Lightweight\Connection\Async\AsyncServerClient.cs:line 798
--- 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() 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.ReplicationInformerBase`1.<ExecuteWithReplicationAsync>d__33`1.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__164`1.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.Client.Document.Async.AsyncDocumentSession.<CompleteLoadAsync>d__60`1.MoveNext() in C:\Builds\RavenDB-Stable-3.5\Raven.Client.Lightweight\Document\Async\AsyncDocumentSession.cs:line 743
--- 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.Document.Async.AsyncDocumentSession.<LoadAsync>d__59`1.MoveNext() in C:\Builds\RavenDB-Stable-3.5\Raven.Client.Lightweight\Document\Async\AsyncDocumentSession.cs:line 0


The strange thing is that, if i remove those 2 line of Index().Execute, everything works fine.

Any suggestion?


Thanks

Oren Eini (Ayende Rahien)

unread,
Mar 22, 2017, 3:40:36 PM3/22/17
to ravendb
Can you enable fiddler and show what requests are being generated?

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.

v.ar...@astalegale.net

unread,
Jun 17, 2017, 4:54:23 AM6/17/17
to RavenDB - 2nd generation document database
Hi, in addiction on what written before by Riccardo, here is the trace generated by fiddler and what the indexes and transformers we expect to be created.

var store = new DocumentStore()
           
{

               
ConnectionStringName = connectionStringName
           
};



            store
.Conventions.FindTypeTagName = type => type.IsSubclassOf(typeof(Sheet)) ? DocumentConvention.DefaultTypeTagName(typeof(Sheet)) : DocumentConvention.DefaultTypeTagName(type);


            store
.Conventions.RegisterIdConvention<IDocument>((dbname, commands, document) => document.GetId());
            store
.Conventions.RegisterAsyncIdConvention<IDocument>((dbname, commands, document) => new CompletedTask<string>(document.GetId()));



            store
.Conventions.MaxNumberOfRequestsPerSession = 100;


            store
.Initialize();
           
           
new SheetId().Execute(store);
           
new SheetPin().Execute(store);
           
           
new AgentToSend().Execute(store);
           
new AttachmentItemsByOriginalDocumentSourceAndOriginalId().Execute(store);
           
new PoiByDescAndCoordinates().Execute(store);
           
new SheetByLottoIdAndSource().Execute(store);
           
new SheetForSearch().Execute(store);
           
new SheetsByIdInserzioneAndSourceId().Execute(store);


    The application hangs on 
new PoiByDescAndCoordinates().Execute(store);
and the error and the stack trace are the same as Riccardo's.

Thanks
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.


Reparto Sviluppo Software


Astalegale.net S.p.a.

Piazza Risorgimento, 1

20841 Carate Brianza (MB)

Tel. 0362 907601

Fax 039 3309896


Legal Disclaimer:

Il presente messaggio (inclusi gli allegati) contiene informazioni riservate esclusivamente al destinatario/ai destinatari indicati nel messaggio, ed è protetto dalla legge. La diffusione, distribuzione e/o la copia del contenuto del presente messaggio da parte di qualsiasi soggetto diverso dal destinatario è severamente vietata, sia ai sensi dell’art. 616 c.p., sia ai sensi del D.Lgs. n. 196/2003. Se non siete il destinatario del presente messaggio, vi preghiamo di distruggerlo e di darcene immediata comunicazione inviando un messaggio di ritorno all’indirizzo e-mail del mittente.

This message (including any attachments) contains confidential information intended only for the recipient(s) named above, and is protected by law. Any disclosure, distribution and/or copying of this message by any subject different from the named recipient(s) is strictly prohibited by law. If you are not the intended recipient, delete this message and inform us immediately about the deletion by sending a message to the e-mail address of the sender.
19_Full.txt

Oren Eini (Ayende Rahien)

unread,
Jun 17, 2017, 5:13:21 AM6/17/17
to ravendb
Can you send a sample test case that reproduces this?
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Enzmann Christoph

unread,
Aug 30, 2017, 7:52:10 AM8/30/17
to RavenDB - 2nd generation document database
Did you find a solution yet? I'm having the same issue after upgrading from 3.0 to 3.5 (#35215).
Reply all
Reply to author
Forward
0 new messages