Ravendb Database Backup - Returns 401

I am testing ravendb backup and restore,

so this works correctly:

Raven.Backup.exe --url=http://app-dev-01.web:8080/ --dest=C:\Temp\RavenDbBackup2


and I get my backup.

but when i execute it for another database like:

Raven.Backup.exe --url=http://app-dev-01.web:8080/databases/someDatabase --dest=C:\Temp\RavenBackup


I get:

The remote server returned an error: (401) Unauthorized.


I can't find anything in the log files and both operations are performed by the same user who has sufficient permissions.

any idea why i am getting this error?




source to share

1 answer

I am currently stuck with build 992 of RavenDB due to a dependency of another component that I am using which I cannot update right now.

The solution that worked for me was to set the config value Raven/AnonymousAccess

on the server Get

(previously it was All

) and make sure the calling application sets the following:

using (var handler = new HttpClientHandler())
    handler.UseDefaultCredentials = true;
    handler.PreAuthenticate = true;




All Articles