RestClient ::冲突:409冲突

时间:2017-06-13 10:34:04

标签: ruby-on-rails ruby orientdb rest-client

通过rails console在rails应用程序中执行某个功能时出现此错误。主数据库是OrientDB。这个功能是在循环中删除OrientDB中的边缘。

RestClient::Conflict: 409 Conflict
    from /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/rest-client-1.8.0/lib/restclient/abstract_response.rb:74:in `return!'
    from /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/rest-client-1.8.0/lib/restclient/request.rb:495:in `process_result'
    from /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/rest-client-1.8.0/lib/restclient/request.rb:421:in `block in transmit'
    from /home/ubuntu/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/net/http.rb:877:in `start'
    from /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/rest-client-1.8.0/lib/restclient/request.rb:413:in `transmit'
    from /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/rest-client-1.8.0/lib/restclient/request.rb:176:in `execute'
    from /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/rest-client-1.8.0/lib/restclient/request.rb:41:in `execute'
    from /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/rest-client-1.8.0/lib/restclient/resource.rb:67:in `post'
    from /home/ubuntu/.rvm/gems/ruby-2.4.0/bundler/gems/active-orient-fdae334715ca/lib/rest/operations.rb:113:in `execute'
    from /home/ubuntu/rails-project/config/initializers/string.rb:27:in `run_active_orient'

首先,我无法得到哪个应用程序生成此错误。是 RestClient by rails 还是 active-orient gem (active-orient是用于访问rails中的OrientDB的ORM)或 orientDB-server 。每次运行它时,该函数似乎都会在不同的步骤中生成错误。此外,在orientDB服务器日志屏幕上也没有错误日志。

任何人都可以帮我解决此错误或帮助我了解导致错误产生的原因。

1 个答案:

答案 0 :(得分:0)

您通过»execute«提交了一个查询,该查询通过POST请求传输。请求将在调试级别记录。

111       begin
112         logger.debug{ batch[:operations].map{|y|y[:command]}.join("; ") }
113         response = @res["/batch/#{ActiveOrient.database}"].post batch.to_json
114       rescue ...

您能否提供一个简短的测试用例并在github上打开一个问题? 并包括记录器的输出?