Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RavenDb - Status Code: NotFound

Tags:

c#

docker

ravendb

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

like image 902
Matthew Groves Avatar asked Sep 04 '26 04:09

Matthew Groves


1 Answers

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

like image 88
Ayende Rahien Avatar answered Sep 05 '26 16:09

Ayende Rahien