Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RavenDb - The remote server returned an error: (403) Forbidden

When I try to create a database people collection on RavenDb, I get the following error:

The remote server returned an error: (403) Forbidden.

I hots the Raven on IIS and I am not sure what is going on. On the raven Management Studio, when I try to create a database, I get the below result:

Could not authenticate against server

Message: The remote server returned an error: NotFound. Uri: /databases?database=Default Server Uri: http://localhost:8888/docs/Raven/Databases/People

-- Error Information -- System.Net.WebException: The remote server returned an error: NotFound. at System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Func2.Invoke(T arg) at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endMethod, TaskCompletionSource1 tcs)

When I looked into this with process monitor, I see that I am getting bunch of not found errors:

enter image description here

Under C:\Utils\RavenDB\Web directory, there are Bin and Data folders, nothing more. Should I create the necessary folders by myself? I created the docs folder but nothing changed. Still having problems.

Any thoughts?

Edit:

Tried with fiddler on Raven Management Studio by creating a document:

Request:

PUT http://localhost:1786/docs/People HTTP/1.1

Accept: /

Accept-Language: en-US

Referer: http://localhost:1786/silverlight/Raven.Studio.xap

Content-Length: 24

Accept-Encoding: identity

If-None-Match: 00000000-0000-0000-0000-000000000000

Content-Type: application/json; charset=utf-8

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7

Host: localhost:1786

Connection: Keep-Alive

Pragma: no-cache

{

"Name": "..."

}

Response:

HTTP/1.1 403 Forbidden

Cache-Control: private

Server: Microsoft-IIS/7.5

X-AspNet-Version: 4.0.30319

X-Powered-By: ASP.NET

Date: Thu, 08 Mar 2012 12:33:22 GMT

Content-Length: 0

like image 286
tugberk Avatar asked Mar 08 '12 10:03

tugberk


People also ask

What does (403) Forbidden mean in /' application?

Server Error in '/' Application. The remote server returned an error: (403) Forbidden. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

How to fix HTTP 403 Forbidden error in EWS?

Before you can use EWS, you must configure access, otherwise the Web service will respond with HTTP 403: Forbidden. Have you configured it? If you have done the above and the problem still exists. Use a Network Monitor Tool and try to get the substatus of the ERROR 403. It will narrow down the issue. 403.1 - Execute access forbidden.

How do I Turn Off authentication in Raven IIs?

Here is the link to the config page that explains each of the options. Be aware that this option will in fact turn off authentication, if you wish to run with authentication you will need the 'Get' or 'None' setting and you will also need to make sure Windows Authentication is installed (IIS 7.5) and enabled on the Raven IIS Application.

Why is my website returning 403 when I log in?

This will let the application use the credentials of the logged in user to access the site. If it's returning 403, clearly it's expecting authentication. It's also possible that you (now?) have an authenticating proxy in between you and the remote site. In which case, try: Hope this helps. Show activity on this post.


1 Answers

This was answered in the comments, however I'll post it here for posterity.

The issue is resolved by changing the web.config value:

<add key="Raven/AnonymousAccess" value="Get"/> 

To:

<add key="Raven/AnonymousAccess" value="All"/>

Here is the link to the config page that explains each of the options. Be aware that this option will in fact turn off authentication, if you wish to run with authentication you will need the 'Get' or 'None' setting and you will also need to make sure Windows Authentication is installed (IIS 7.5) and enabled on the Raven IIS Application.

like image 141
JonVD Avatar answered Oct 16 '22 09:10

JonVD