简体   繁体   English

更新一个问题以使用Rest API C#替换服务器并获得500 Internal Server Error

[英]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.

相关问题 500 px API与C#引发500内部服务器错误 - 500 px api with C# throwing 500 Internal Server Error Acumatica REST API 员工记录创建问题,适用于更新返回内部服务器错误 500 - Acumatica REST API Employee Record Creation issue, works for Update returns Internal Server Error 500 获取服务器错误 500,“内部服务器错误”,但在 Postman 上工作正常,在 c# 中使用 httpclient - getting server error 500, 'Internal Server Error', but works fine on Postman, using httpclient in c# 500:尝试从C#控制台调用REST API时发生内部服务器错误 - 500: internal server error while trying to call a REST api from C# console C# Web API - 内部服务器错误 500 - C# Web API - Internal Server Error 500 出现错误:使用 AJAX POST 到 C# Webmethod 时出现 500 内部服务器错误 - Getting Error: 500 Internal server error when using AJAX POST to C# Webmethod 500内部服务器错误Unity C# - 500 Internal Server Error Unity C# C#500内部服务器错误MongoDB - C# 500 Internal Server Error MongoDB 获取内部服务器错误500 - Getting Internal Server Error 500 在Spotify API令牌检索中获得500个内部服务器错误 - Getting a 500 internal server error on Spotify API Token Retrieval
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM