2012-11-06 51 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到/文檔
相關問題