使用 Rest API C# 更新 redmine 服务器的问题并获取 500 Internal Server Error
Update an issue to redmine server using Rest API C# and getting 500 Internal Server Error
我是通过 Rest API 构建 redmine 客户端的新手。我正在尝试将问题更新为 redmine 服务器和服务器响应 500 Internal Server Error。
这是我的生产日志。
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'
请帮帮我。
谢谢!
我修复了这个错误。在这种情况下,服务器会抛出一些 null 错误,并且无法更新数据库。服务器没有告诉我什么错误然后我检查 production.log。我发现解决方案“'uploads'=>nil,'custom_fields'=>nil”为空,那么我们应该删除或使其不为空。所以问题是固定的。感谢您的出席!
如果您通过带附件的电子邮件更新,只需修改 'attachments' table 并将默认描述行设置为“非空 ;)
我是通过 Rest API 构建 redmine 客户端的新手。我正在尝试将问题更新为 redmine 服务器和服务器响应 500 Internal Server Error。 这是我的生产日志。
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'
请帮帮我。 谢谢!
我修复了这个错误。在这种情况下,服务器会抛出一些 null 错误,并且无法更新数据库。服务器没有告诉我什么错误然后我检查 production.log。我发现解决方案“'uploads'=>nil,'custom_fields'=>nil”为空,那么我们应该删除或使其不为空。所以问题是固定的。感谢您的出席!
如果您通过带附件的电子邮件更新,只需修改 'attachments' table 并将默认描述行设置为“非空 ;)