I installed RavenDb with Docker using the Powershell script supplied on Docker hub: https://hub.docker.com/r/ravendb/ravendb/ (run-ubuntu1604.ps1).
I'm able to login to the RavenDb admin console using localhost:8080, and I'm able to create a database called "mydbname".
But, when I try to write a .NET program to interact with Raven, I get an error. Here is the code:
using (var store = new DocumentStore { Url = "http://localhost:8080", DefaultDatabase = "mydbname" })
{
store.Initialize();
using (var session = store.OpenSession())
{
var doc = MyClass.New();
session.Store(doc);
session.SaveChanges();
Console.WriteLine("Inserted this document:");
Console.WriteLine(doc.Name + "\t" + doc.Age + "\t" + doc.RandomString);
Console.WriteLine();
}
}
MyClass.New() just returns a new POCO of type MyClass.
The error I'm getting when I run this:
Unhandled Exception: Raven.Abstractions.Connection.ErrorResponseException: Status code: NotFound
at Raven.Client.Connection.Implementation.HttpJsonRequest.<CheckForErrorsAndReturnCachedResultIfAnyAsync>d__41.MoveNext() in C:\Builds\RavenDB-Stable-3.5\Raven.Client.Lightweight\Connection\Implementation\HttpJsonRequest.cs:line 385
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
[omitted really long stack trace]
So, have I configured something wrong, or am I writing something in the C# wrong, or what? I'm using RavenDB Client 3.5.3
Matthew, There is a bug in our docker usage that will lead to this. We just released a fix for that in beta 2 yesterday, but docker image will be updated on Monday.
You can get the new version of the client here. https://www.myget.org/feed/ravendb/package/nuget/RavenDB.Client
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With