Unable to create a new InMemory Document Store (for my tests)

65 views
Skip to first unread message

Justin A

unread,
Mar 17, 2017, 2:38:09 AM3/17/17
to RavenDB - 2nd generation document database
Hi - not sure if this is a weird issue with using the latest version...

but I'm trying to use the Test Helpers to create an in memory Document Store.

When I do, I get a weird exception:





But, if i use my same code and point to a localhost version, tests run and pass.


if (isInMemory)
{
    var vsdfsfds = NewDocumentStore(); // Just messing around..
    Store = NewDocumentStore(noStaleQueries: true); // My normal DocStore.
}
else
{
    // Use a local one so I can easily use the Raven Management Studio to 
    // see all my documents, indexs and TERMS in my indexes, etc :) :)
    Store = new DocumentStore
    {
        Url = "http://localhost:8080",
        DefaultDatabase = "UnitTests",
    };
    Store.Initialize();
}


this is from my packages...

  <package id="RavenDB.Client" version="3.5.3" targetFramework="net451" />
  <package id="RavenDB.Database" version="3.5.3" targetFramework="net451" />
  <package id="RavenDB.Embedded" version="3.5.3" targetFramework="net451" />
  <package id="RavenDB.Tests.Helpers" version="3.5.3" targetFramework="net451" />

So  - i'm not too sure how to debug this :(

-J-

Jahmai Lay

unread,
Mar 17, 2017, 3:05:51 AM3/17/17
to RavenDB - 2nd generation document database

That message is Raven's version of ¯\_(ツ)_/¯

Justin A

unread,
Mar 17, 2017, 3:15:43 AM3/17/17
to RavenDB - 2nd generation document database
Oh noes :( i hope i'm not dead cause of this :(

Oren Eini (Ayende Rahien)

unread,
Mar 17, 2017, 7:38:29 AM3/17/17
to ravendb
Look at what index is causing this, and post it here.

Hibernating Rhinos Ltd  

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

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

 


On Fri, Mar 17, 2017 at 9:15 AM, Justin A <jus...@adler.com.au> wrote:
Oh noes :( i hope i'm not dead cause of this :(

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

Justin A

unread,
Mar 17, 2017, 9:18:18 AM3/17/17
to RavenDB - 2nd generation document database
This is what I don't understand Oren : does it auto find indexes? How can i know which index, etc?

also - why does this work when i target my raven.server.exe that's running on localhost (which suggests my 2x indexes and transformer are ok?)

Oren Eini (Ayende Rahien)

unread,
Mar 19, 2017, 2:37:38 AM3/19/17
to ravendb
It shouldn't auto find indexes, no. I can't tell from the stack trace, though, what it is doing.

Hibernating Rhinos Ltd  

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

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

 


On Fri, Mar 17, 2017 at 3:18 PM, Justin A <jus...@adler.com.au> wrote:
This is what I don't understand Oren : does it auto find indexes? How can i know which index, etc?

also - why does this work when i target my raven.server.exe that's running on localhost (which suggests my 2x indexes and transformer are ok?)

--

Justin A

unread,
Mar 19, 2017, 3:17:01 AM3/19/17
to RavenDB - 2nd generation document database
So .... this means I need to download the source from GitHub, extract the zip .. then run build.cmd ... and then reference the dll for the RavenDB.Tests.Helpers project (in my project) and try and 'step into' the code .. to see what's going on?

Jahmai Lay

unread,
Mar 19, 2017, 4:27:54 AM3/19/17
to RavenDB - 2nd generation document database
Or install dotPeek and enable the built-in pdb server and add the server the visual studio pdb server list and then step into raven code (or any 3rd party code) that way.
Not quite as good as a debug built dll, but good enough for most things.

Justin A

unread,
Mar 19, 2017, 5:10:13 AM3/19/17
to RavenDB - 2nd generation document database
Gotta love this :(

It's trying to PUT the default index .. then boom :(  (btw, i just hit F10 (step over)) on the last line before boomski )





Oren Eini (Ayende Rahien)

unread,
Mar 19, 2017, 9:18:30 AM3/19/17
to ravendb
I meant, just give us the full stack trace of the error :-)

Hibernating Rhinos Ltd  

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

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

 


Justin A

unread,
Mar 19, 2017, 10:01:12 AM3/19/17
to RavenDB - 2nd generation document database

not sure if this helps...


   at Raven.Client.Connection.Implementation.HttpJsonRequest.<CheckForErrorsAndReturnCachedResultIfAnyAsync>d__41.MoveNext() in C:\Projects\Temp\ravendb-3.5\Raven.Client.Lightweight\Connection\Implementation\HttpJsonRequest.cs:line 470
--- 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.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Raven.Client.Connection.Implementation.HttpJsonRequest.<>c__DisplayClass36_0.<<SendRequestInternal>b__0>d.MoveNext() in C:\Projects\Temp\ravendb-3.5\Raven.Client.Lightweight\Connection\Implementation\HttpJsonRequest.cs:line 268
--- 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.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Raven.Client.Connection.Implementation.HttpJsonRequest.<RunWithAuthRetry>d__38`1.MoveNext() in C:\Projects\Temp\ravendb-3.5\Raven.Client.Lightweight\Connection\Implementation\HttpJsonRequest.cs:line 318
--- 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.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
   at Raven.Client.Connection.Async.AsyncServerClient.<DirectPutIndexAsync>d__38.MoveNext() in C:\Projects\Temp\ravendb-3.5\Raven.Client.Lightweight\Connection\Async\AsyncServerClient.cs:line 327
--- 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.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Raven.Client.Connection.ReplicationInformerBase`1.<TryOperationAsync>d__34`1.MoveNext() in C:\Projects\Temp\ravendb-3.5\Raven.Client.Lightweight\Connection\ReplicationInformerBase.cs:line 421
--- 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.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Raven.Client.Connection.ReplicationInformerBase`1.<ExecuteWithReplicationAsync>d__33`1.MoveNext() in C:\Projects\Temp\ravendb-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 System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Raven.Client.Connection.Async.AsyncServerClient.<ExecuteWithReplication>d__164`1.MoveNext() in C:\Projects\Temp\ravendb-3.5\Raven.Client.Lightweight\Connection\Async\AsyncServerClient.cs:line 2800
--- 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() 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](Func`1 task) in C:\Builds\RavenDB-Stable-3.5\Raven.Abstractions\Util\AsyncHelpers.cs:line 89
   at Raven.Client.Connection.ServerClient.PutIndex(String name, IndexDefinition definition, Boolean overwrite) in C:\Projects\Temp\ravendb-3.5\Raven.Client.Lightweight\Connection\ServerClient.cs:line 262
   at Raven.Client.Indexes.AbstractIndexCreationTask.Execute(IDatabaseCommands databaseCommands, DocumentConvention documentConvention) in C:\Projects\Temp\ravendb-3.5\Raven.Client.Lightweight\Indexes\AbstractIndexCreationTask.cs:line 316
   at Raven.Tests.Helpers.RavenTestBase.CreateDefaultIndexes(IDocumentStore documentStore) in C:\Projects\Temp\ravendb-3.5\Raven.Tests.Helpers\RavenTestBase.cs:line 552
   at Raven.Tests.Helpers.RavenTestBase.NewDocumentStore(Boolean runInMemory, String requestedStorage, ComposablePartCatalog catalog, String dataDir, Boolean enableAuthentication, String activeBundles, Nullable`1 port, AnonymousUserAccessMode anonymousUserAccessMode, Action`1 configureStore, String databaseName, IEnumerable`1 indexes, IEnumerable`1 transformers, IEnumerable`1 seedData, Boolean noStaleQueries, DocumentConvention conventions) in C:\Projects\Temp\ravendb-3.5\Raven.Tests.Helpers\RavenTestBase.cs:line 279
   at AppianMedia.XWing.Tests.UnitTests.RavenDb.RavenDb.TestBase..ctor(Boolean isEmbedded) in C:\Projects\Work\Homely\XWing\Code\Tests\AppianMedia.XWing.Tests.UnitTests.RavenDb\RavenDb\TestBase.cs:line 32
   at AppianMedia.XWing.Tests.UnitTests.RavenDb.RavenDb.Locations_AutoCompleteFacts.SuggestsFacts..ctor()

Oren Eini (Ayende Rahien)

unread,
Mar 20, 2017, 1:59:39 PM3/20/17
to ravendb
Raven.Tests.Helpers.RavenTestBase.CreateDefaultIndexes

Which by default will create just the Raven/DocumentsByEntityName index

Hibernating Rhinos Ltd  

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

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

 


--

Justin A

unread,
Mar 20, 2017, 6:44:27 PM3/20/17
to RavenDB - 2nd generation document database
Ok. it's taken me hours to fix this ... but I have.

I'm not sure what the actual fix was ... but I'll try and mention the steps I did.

Test project -> .NET 4.5.1
- update nuget's to 3.5.3
- (also updated other nugets, like xunit which is actually .NET 4.6.x and above).
- fixed up code, etc. tested against a localhost version of 3.5.3 running in RAM. (i usually always test against a localhost so I can easy _see_ my documents, Terms, etc). This includes my UNIT TESTS also (so in reality, they aren't really a unit test, at this stage but a quasi-integratin test :P )
- all tests pass
- switched over from LH server to NewDocumentStore (in tests).
- boom.
- Upgraded project to .NET 4.6.2
- replaced raven nuget dll's with local copies that I finally got compiling (had errors and bad luck doing this) ... so then i can STEP INTO the ravendb-code
- still got no where.
- made sure all my BINDING REDIRECTS where ok.
- still got no where.
- created a new project with some demo code. WORKS. (ok, so 3.5.3. is good...)
- DELETED ALL REFERENCES everywhere in this project.
- DELETED ALL pacakges from packages.config
- Manually package-installed all the packages again. There were ..a lot ...
- compile/ran/WORKED.

So .. the best i could think of was there's some rogue packages somewhere? I do BUILD->CLEAN SOLUTION all the time .. so I thought that might have helped ?

So yeah. 

TL;DR; nuke all. re-start. pray to the demo gods. Be nice to your parents.

And i'm back.


Hope this might help someone else.

-le me-
Reply all
Reply to author
Forward
0 new messages