Index out of range with insert session.store and replication

67 views
Skip to first unread message

Sviluppatori

unread,
Jun 19, 2017, 8:54:49 AM6/19/17
to RavenDB - 2nd generation document database
Hi,
We have problems to save documents in a RavenDB replica configuration (RavenDB Server version 35202)

When we execute session.Store() we recive this error message: "ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"

If we disable replica all works correctly

How can we resolve this problem?

Kind Regards,

Grisha Kotler

unread,
Jun 20, 2017, 6:34:42 AM6/20/17
to rav...@googlegroups.com
Hi,

How do the documents look like?
What is the full stack trace of the error?

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

Grisha Kotler l RavenDB Core Team Developer Mobile: +972-54-586-8647

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

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


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.

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

Sviluppatori

unread,
Jun 21, 2017, 10:47:07 AM6/21/17
to RavenDB - 2nd generation document database
Hi,
this is the stack trace:

   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   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.ExceptionServices.ExceptionDispatchInfo.Throw()
   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.ExceptionServices.ExceptionDispatchInfo.Throw()
   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.Document.HiLoKeyGenerator.GetDocument(IDatabaseCommands databaseCommands)
   at Raven.Client.Document.HiLoKeyGenerator.GetNextRange(IDatabaseCommands databaseCommands)
   at Raven.Client.Document.HiLoKeyGenerator.NextId(IDatabaseCommands commands)
   at Raven.Client.Document.MultiTypeHiLoKeyGenerator.GenerateDocumentKey(IDatabaseCommands databaseCommands, DocumentConvention conventions, Object entity)
   at Raven.Client.Document.DocumentStore.<>c__DisplayClass57_0.<Initialize>b__0(String dbName, IDatabaseCommands databaseCommands, Object entity)
   at Raven.Client.Document.GenerateEntityIdOnTheClient.GetOrGenerateDocumentKey(Object entity)
   at Raven.Client.Document.GenerateEntityIdOnTheClient.GenerateDocumentKeyForStorage(Object entity)
   at Raven.Client.Document.InMemoryDocumentSessionOperations.StoreInternal(Object entity, Etag etag, String id, ConcurrencyCheckMode concurrencyCheckMode)
   at Raven.Client.Document.InMemoryDocumentSessionOperations.Store(Object entity)
   at UserQuery.Main() in C:\Users\sviluppatori\AppData\Local\Temp\LINQPad5\_wxavwlfw\query_lubdgx.cs:line 49
   at LINQPad.ExecutionModel.ClrQueryRunner.Run()
   at LINQPad.ExecutionModel.Server.RunQuery(QueryRunner runner)
   at LINQPad.ExecutionModel.Server.StartQuery(QueryRunner runner)
   at LINQPad.ExecutionModel.Server.<>c__DisplayClass152_0.<ExecuteClrQuery>b__0()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

I've created a class for my document:

class MyDocument
{
public string Id { get; }
public string Test { get; set; }
}

I have instantiated my document:

var myDoc = new MyDocument()
{
Test = "text"
};

And on session.store(myDoc) I receive the error message: "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"

Thanks in advance

Oren Eini (Ayende Rahien)

unread,
Jun 21, 2017, 1:38:30 PM6/21/17
to ravendb
What does your hilo document looks like?

Hibernating Rhinos Ltd  

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

Sviluppatori

unread,
Jun 22, 2017, 2:55:17 AM6/22/17
to RavenDB - 2nd generation document database
Hi, my Raven/Hilo/MyDocuments looks like:

Data
{
    "Max": 32
}

Metadata
{
    "Raven-Replication-Version": 3543576,
    "Raven-Replication-Source": "9d886461-5e4b-4661-b2d5-d651d02d70f6"
}

With replication disabled

Thanks in advance

Oren Eini (Ayende Rahien)

unread,
Jun 22, 2017, 3:12:29 AM6/22/17
to ravendb
Can you show the Fiddler output?

Sviluppatori

unread,
Jun 22, 2017, 3:56:31 AM6/22/17
to RavenDB - 2nd generation document database
Hi,
the only output that I see in Fiddler is:


No other calls to RavenDB occured

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

Oren Eini (Ayende Rahien)

unread,
Jun 22, 2017, 5:48:27 AM6/22/17
to ravendb
You need to setup the application to talk to ravendb via something other than localhost (machine name or localhost.fiddler ) work.
Then you can see your app to ravendb.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Sviluppatori

unread,
Jun 22, 2017, 8:09:51 AM6/22/17
to RavenDB - 2nd generation document database
Hi,
I have moved RavenDB on another server (rather than my machine), I have re-tested the insert but result is the same

I have only one output in Fiddler (one per call)

Oren Eini (Ayende Rahien)

unread,
Jun 22, 2017, 8:12:49 AM6/22/17
to ravendb
Can you send it?

Sviluppatori

unread,
Jun 22, 2017, 8:24:49 AM6/22/17
to RavenDB - 2nd generation document database
GET http://10.3.3.8:8080/databases/test/replication/topology 200 OK (application/json)

Json output:
{
  "ClusterInformation": {
    "IsInCluster": false,
    "IsLeader": false,
    "WithClusterFailoverHeader": false
  },
  "Term": -1,
  "ClusterCommitIndex": -1,
  "Destinations": [
    {
      "ClusterInformation": {
        "IsInCluster": false,
        "IsLeader": false,
        "WithClusterFailoverHeader": false
      },
      "Url": "http://10.3.4.27:8080",
      "Username": null,
      "Password": null,
      "Domain": null,
      "ApiKey": null,
      "Database": "test",
      "TransitiveReplicationBehavior": "Replicate",
      "SkipIndexReplication": false,
      "IgnoredClient": false,
      "Disabled": false,
      "AuthenticationScheme": null,
      "ClientVisibleUrl": null,
      "SpecifiedCollections": {},
      "Humane": "http://10.3.4.27:8080 test"
    }
  ],
  "Id": "Raven/Replication/Destinations",
  "Source": "5c39b6ed-8e87-4063-81d3-3384cdd9e178",
  "ClientConfiguration": {
    "FailoverBehavior": "AllowReadFromSecondariesWhenRequestTimeSlaThresholdIsReached, ReadFromAllServers",
    "RequestTimeSlaThresholdInMilliseconds": 100.0

Oren Eini (Ayende Rahien)

unread,
Jun 22, 2017, 8:30:18 AM6/22/17
to ravendb
Please send the SAZ file

Sviluppatori

unread,
Jun 22, 2017, 8:41:49 AM6/22/17
to RavenDB - 2nd generation document database
Hi,
here the file

Thanks!
ravendb.saz

Oren Eini (Ayende Rahien)

unread,
Jun 22, 2017, 2:49:37 PM6/22/17
to ravendb
Okay, I'm not seeing anything there. Can you send us a repro?

Sviluppatori

unread,
Jun 23, 2017, 3:38:51 AM6/23/17
to RavenDB - 2nd generation document database
Hi,
sorry, how can I do it?

Oren Eini (Ayende Rahien)

unread,
Jun 26, 2017, 5:21:31 AM6/26/17
to ravendb

Sviluppatori

unread,
Jun 30, 2017, 4:05:26 AM6/30/17
to RavenDB - 2nd generation document database
Hi,
thanks for response. We have created all requested files and we have sended its through the support (Request Id: efab30fd-bf78-4fe8-91bb-d515a41a4994)

Best Regards,
Reply all
Reply to author
Forward
0 new messages