2012-11-06 84 views
1

我在使用全新的干净RavenDB安装启动的每个POST请求中不断收到HTTP 409错误。我在Windows 7 64位开发工作站上提取了构建960(超出建议的最低系统要求)。我的配置包含在下面。我通过运行Start.cmd启动服务器。在服务器运行时,我复制粘贴来自RavenDB网站的HTTP API文档的CURL命令并运行它,但是我得到一个HTTP代码409错误。我没有找到适当处理此错误的任何说明,或者除了设置适当的匿名访问以外的其他显式配置的特殊说明。我也看到了同样的问题,从其他工作站运行相同的服务器设置并使用其他客户端(Ruby rest-client gem)。RavenDB在POST上发生HTTP错误409(冲突)

CONFIG

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <appSettings> 
    <add key="Raven/Port" value="*"/> 
    <add key="Raven/DataDir" value="~\Data"/> 
    <add key="Raven/AnonymousAccess" value="All"/> 
    <add key="Raven/RunInMemory" value="true"/> 
    </appSettings> 
    <runtime> 
     <loadFromRemoteSources enabled="true"/> 
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
      <probing privatePath="Analyzers"/> 
     </assemblyBinding> 
    </runtime> 
</configuration> 

命令行客户端:

C:\dev\RavenDB> curl -v -X POST http://localhost:8080/docs -d "{ FirstName: 'Bob', LastName: 'Smith', Address: '5 Elm St' }" 
* timeout on name lookup is not supported 
* About to connect() to localhost port 8080 (#0) 
* Trying XXX.XXX.XXX.XXX... 
* connected 
* Connected to localhost (XXX.XXX.XXX.XXX) port 8080 (#0) 
> POST /docs HTTP/1.1 
> User-Agent: curl/7.26.0 
> Host: localhost:8080 
> Accept: */* 
> Content-Length: 60 
> Content-Type: application/x-www-form-urlencoded 
> 
* upload completely sent off: 60 out of 60 bytes 
< HTTP/1.1 409 Conflict 
< Transfer-Encoding: chunked 
< Server: Microsoft-HTTPAPI/2.0 
< Raven-Server-Build: 960 
< Date: Tue, 06 Nov 2012 19:36:35 GMT 
< 
{ 
    "Url": "/docs", 
    "ActualETag": "00000000-0000-0000-0000-000000000000", 
    "ExpectedETag": "213966fe-5c42-41c4-80c1-6a73c44e77d3", 
    "Error": "PUT attempted on document 'ac171c38-5428-40d5-beb6-56ea006dbcf6' using a non current etag (document deleted)" 
}* Connection #0 to host localhost left intact 
* Closing connection #0 

这是当我尝试手动创建通过Web界面的新文档时出现的错误。

Message: PUT attempted on document 'bbc8a11d-94fb-4e80-958d-4b5c74d8e8be' using a non current etag (document deleted) 
Uri: /edit?mode=new&database=Default 
Server Uri: unknown 

-- Error Information -- 
Raven.Abstractions.Exceptions.ConcurrencyException: PUT attempted on document 'bbc8a11d-94fb-4e80-958d-4b5c74d8e8be' using a non current etag (document deleted) 
    at Raven.Client.Silverlight.Connection.Async.AsyncServerClient.<>c__DisplayClass39.<PutAsync>b__38(Task`1 task1) 
    at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() 
    at System.Threading.Tasks.Task.Execute() 

Inner StackTrace: 
    at Raven.Studio.Infrastructure.InvocationExtensions.Catch(Task parent, Action`1 action) 
    at Raven.Studio.Models.EditableDocumentModel.SaveDocumentCommand.SaveDocument() 
    at Raven.Studio.Models.EditableDocumentModel.SaveDocumentCommand.Execute(Object parameter) 
    at System.Windows.Controls.Primitives.ButtonBase.ExecuteCommand() 
    at System.Windows.Controls.Primitives.ButtonBase.OnClick() 
    at System.Windows.Controls.Button.OnClick() 
    at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e) 
    at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e) 
    at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags) 

回答

0

这是一个错误的960 你需要做一个PUT到/文档/ [Guid.NewGuid()]

不支持POST到/文档