[英]Update an issue to redmine server using Rest API C# and getting 500 Internal Server Error
I'm newbie in building redmine client by Rest API. 我是通过Rest API构建Redmine客户端的新手。 I'm trying to update an issue to redmine server and server response 500 Internal Server Error.
我正在尝试更新一个问题来代替服务器和服务器响应500 Internal Server Error。 Here is my production log.
这是我的生产日志。
Started PUT "/redmine/issues/7.xml" for 127.0.0.1 at 2015-10-21 16:13:38 +0700
Processing by IssuesController#update as XML
Parameters: {"issue"=>{"subject"=>"Stop test close", "notes"=>"My note", "private_notes"=>"false", "description"=>"Updated description", "is_private"=>"false", "project_id"=>"1", "priority_id"=>"4", "status_id"=>"2", "tracker_id"=>"2", "assigned_to_id"=>"1", "estimated_hours"=>"30", "done_ratio"=>"10", "start_date"=>"2015-10-12", "due_date"=>"2015-10-12", "updated_on"=>"2015-10-19", "uploads"=>nil, "custom_fields"=>nil}, "id"=>"7"}
Current user: user (id=1)
Completed 500 Internal Server Error in 32ms (ActiveRecord: 8.0ms)
NoMethodError (undefined method `inject' for nil:NilClass):
lib/plugins/acts_as_customizable/lib/acts_as_customizable.rb:54:in `custom_fields='
app/models/issue.rb:372:in `assign_attributes_with_project_and_tracker_first'
app/models/issue.rb:495:in `safe_attributes='
app/controllers/issues_controller.rb:397:in `update_issue_from_params'
app/controllers/issues_controller.rb:176:in `update'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'
Please help me. 请帮我。 Thanks!
谢谢!
I fixed the bug. 我已修复该错误。 In this case, the server raise error some thing null and it can't updates to database.
在这种情况下,服务器引发错误,某些错误为空,并且无法更新数据库。 The server didn't tell what error on that then I check the production.log.
服务器没有告诉我那是什么错误,然后我检查了production.log。 I found the solution that "'uploads'=>nil, 'custom_fields'=>nil" was null then we should remove or make it not null.
我找到了“'uploads'=> nil,'custom_fields'=> nil”为空的解决方案,那么我们应该删除它或使其不为空。 So the problem was fixed.
因此,问题已解决。 Thank for your attend!
感谢您的参加!
如果您通过电子邮件更新附件,只需修改“附件”表,将默认描述行设置为“不为null;)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.