ruby-on-rails Redmine API出现错误,但我不知道是什么导致了错误

kmpatx3s  于 2023-05-02  发布在  Ruby
关注(0)|答案(1)|浏览(304)

我正在使用Redmine API与PHP,它工作得很好。我以前用过我现在用的这个代码,它很好。突然间,它给我一个错误,我不知道到底是什么错误。我已经将日志设置为调试,这就是我在下面得到的。也许我只是瞎了。我不知道,但我看不出来。
任何帮助将不胜感激。

Environment:
  Redmine version                5.0.3.stable
  Ruby version                   3.0.2-p107 (2021-07-07) [x86_64-linux-gnu]
  Rails version                  6.1.7
  Environment                    production
  Database adapter               Mysql2
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
Redmine settings:
  Redmine theme                  Redmine-evolution-classic (includes JavaScript)
SCM:
  Git                            2.34.1
  Filesystem                     
Redmine plugins:
  redmine_agile                  1.6.4
  redmine_checklists             3.1.21
  redmine_contacts               4.3.6
  redmine_contacts_helpdesk      4.2.0
  redmine_zenedit                2.0.3
  redmineup_tags                 2.0.12
I, [2023-04-18T11:04:46.304234 #777496]  INFO -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2] Started GET "/trackers.json" for 192.168.3.42 at 2023-04-18 11:04:46 -0700
I, [2023-04-18T11:04:46.309249 #777496]  INFO -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2] Processing by TrackersController#index as JSON
D, [2023-04-18T11:04:46.326303 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]    (0.4ms)  SELECT MAX(`settings`.`updated_on`) FROM `settings`
D, [2023-04-18T11:04:46.330909 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   Setting Load (0.4ms)  SELECT `settings`.* FROM `settings` WHERE `settings`.`name` = 'rest_api_enabled' ORDER BY `settings`.`id` DESC LIMIT 1
D, [2023-04-18T11:04:46.341494 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   Token Load (0.4ms)  SELECT `tokens`.* FROM `tokens` WHERE `tokens`.`action` = 'api' AND `tokens`.`value` = '***********' LIMIT 1
D, [2023-04-18T11:04:46.353928 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   User Load (0.5ms)  SELECT `users`.* FROM `users` WHERE `users`.`type` IN ('User', 'AnonymousUser') AND `users`.`id` = 5 LIMIT 1
D, [2023-04-18T11:04:46.380891 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   User Load (0.7ms)  SELECT `users`.* FROM `users` WHERE `users`.`type` IN ('User', 'AnonymousUser') AND `users`.`login` = 'SCESD'
I, [2023-04-18T11:04:46.381378 #777496]  INFO -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   User switched by: Rick (id=5)
I, [2023-04-18T11:04:46.381620 #777496]  INFO -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   Current user: SCESD (id=42)
D, [2023-04-18T11:04:46.382640 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   Setting Load (0.4ms)  SELECT `settings`.* FROM `settings` WHERE `settings`.`name` = 'force_default_language_for_loggedin' ORDER BY `settings`.`id` DESC LIMIT 1
D, [2023-04-18T11:04:46.386813 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   Tracker Load (0.4ms)  SELECT `trackers`.* FROM `trackers` ORDER BY `trackers`.`position` ASC
D, [2023-04-18T11:04:46.396924 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   Rendering trackers/index.api.rsb
D, [2023-04-18T11:04:46.402461 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   IssueStatus Load (0.4ms)  SELECT `issue_statuses`.* FROM `issue_statuses` WHERE `issue_statuses`.`id` = 1 LIMIT 1
D, [2023-04-18T11:04:46.405723 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   CACHE IssueStatus Load (0.0ms)  SELECT `issue_statuses`.* FROM `issue_statuses` WHERE `issue_statuses`.`id` = 1 LIMIT 1
D, [2023-04-18T11:04:46.406359 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   CACHE IssueStatus Load (0.0ms)  SELECT `issue_statuses`.* FROM `issue_statuses` WHERE `issue_statuses`.`id` = 1 LIMIT 1
D, [2023-04-18T11:04:46.406991 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   CACHE IssueStatus Load (0.0ms)  SELECT `issue_statuses`.* FROM `issue_statuses` WHERE `issue_statuses`.`id` = 1 LIMIT 1
D, [2023-04-18T11:04:46.407582 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   CACHE IssueStatus Load (0.0ms)  SELECT `issue_statuses`.* FROM `issue_statuses` WHERE `issue_statuses`.`id` = 1 LIMIT 1
D, [2023-04-18T11:04:46.408194 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   CACHE IssueStatus Load (0.0ms)  SELECT `issue_statuses`.* FROM `issue_statuses` WHERE `issue_statuses`.`id` = 1 LIMIT 1
D, [2023-04-18T11:04:46.408812 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   CACHE IssueStatus Load (0.0ms)  SELECT `issue_statuses`.* FROM `issue_statuses` WHERE `issue_statuses`.`id` = 1 LIMIT 1
D, [2023-04-18T11:04:46.409433 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   CACHE IssueStatus Load (0.0ms)  SELECT `issue_statuses`.* FROM `issue_statuses` WHERE `issue_statuses`.`id` = 1 LIMIT 1
D, [2023-04-18T11:04:46.410049 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   CACHE IssueStatus Load (0.0ms)  SELECT `issue_statuses`.* FROM `issue_statuses` WHERE `issue_statuses`.`id` = 1 LIMIT 1
D, [2023-04-18T11:04:46.410657 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   CACHE IssueStatus Load (0.0ms)  SELECT `issue_statuses`.* FROM `issue_statuses` WHERE `issue_statuses`.`id` = 1 LIMIT 1
D, [2023-04-18T11:04:46.411294 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   CACHE IssueStatus Load (0.0ms)  SELECT `issue_statuses`.* FROM `issue_statuses` WHERE `issue_statuses`.`id` = 1 LIMIT 1
D, [2023-04-18T11:04:46.411903 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   CACHE IssueStatus Load (0.0ms)  SELECT `issue_statuses`.* FROM `issue_statuses` WHERE `issue_statuses`.`id` = 1 LIMIT 1
D, [2023-04-18T11:04:46.412520 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   CACHE IssueStatus Load (0.0ms)  SELECT `issue_statuses`.* FROM `issue_statuses` WHERE `issue_statuses`.`id` = 1 LIMIT 1
D, [2023-04-18T11:04:46.413216 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   CACHE IssueStatus Load (0.0ms)  SELECT `issue_statuses`.* FROM `issue_statuses` WHERE `issue_statuses`.`id` = 1 LIMIT 1
D, [2023-04-18T11:04:46.413852 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   CACHE IssueStatus Load (0.0ms)  SELECT `issue_statuses`.* FROM `issue_statuses` WHERE `issue_statuses`.`id` = 1 LIMIT 1
D, [2023-04-18T11:04:46.414416 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   CACHE IssueStatus Load (0.0ms)  SELECT `issue_statuses`.* FROM `issue_statuses` WHERE `issue_statuses`.`id` = 1 LIMIT 1
D, [2023-04-18T11:04:46.414998 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   CACHE IssueStatus Load (0.0ms)  SELECT `issue_statuses`.* FROM `issue_statuses` WHERE `issue_statuses`.`id` = 1 LIMIT 1
D, [2023-04-18T11:04:46.415564 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   CACHE IssueStatus Load (0.0ms)  SELECT `issue_statuses`.* FROM `issue_statuses` WHERE `issue_statuses`.`id` = 1 LIMIT 1
D, [2023-04-18T11:04:46.416150 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   CACHE IssueStatus Load (0.0ms)  SELECT `issue_statuses`.* FROM `issue_statuses` WHERE `issue_statuses`.`id` = 1 LIMIT 1
D, [2023-04-18T11:04:46.416744 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   CACHE IssueStatus Load (0.0ms)  SELECT `issue_statuses`.* FROM `issue_statuses` WHERE `issue_statuses`.`id` = 1 LIMIT 1
D, [2023-04-18T11:04:46.417710 #777496] DEBUG -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   IssueStatus Load (0.4ms)  SELECT `issue_statuses`.* FROM `issue_statuses` WHERE `issue_statuses`.`id` = 5 LIMIT 1
I, [2023-04-18T11:04:46.419663 #777496]  INFO -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2]   Rendered trackers/index.api.rsb (Duration: 22.5ms | Allocations: 9644)
I, [2023-04-18T11:04:46.420182 #777496]  INFO -- : [b1644675-c4bb-46c6-91c6-0e58aaca09b2] Completed 200 OK in 111ms (Views: 22.2ms | ActiveRecord: 17.4ms | Allocations: 43569)
I, [2023-04-18T11:04:46.434524 #777496]  INFO -- : [93f4009c-a50b-4789-bb65-200062a347db] Started POST "/issues.xml" for 192.168.3.42 at 2023-04-18 11:04:46 -0700
I, [2023-04-18T11:04:46.568276 #777496]  INFO -- : [93f4009c-a50b-4789-bb65-200062a347db] Processing by IssuesController#create as XML
I, [2023-04-18T11:04:46.568488 #777496]  INFO -- : [93f4009c-a50b-4789-bb65-200062a347db]   Parameters: {"issue"=>{"subject"=>"Chromebook repair", "description"=>"Refurbish Chromebook", "project_id"=>"23", "category_id"=>"10", "tracker_id"=>"4", "custom_fields"=>[{"name"=>"Serial Number", "id"=>"1", "value"=>"5CD0252HMK"}, {"name"=>"Brand", "id"=>"2", "value"=>"HPI"}, {"name"=>"Model", "id"=>"3", "value"=>"Chromebook x360 11 G3 EE"}, {"name"=>"Asset Tag", "id"=>"4", "value"=>"A024066"}]}}
D, [2023-04-18T11:04:46.570395 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]    (0.4ms)  SELECT MAX(`settings`.`updated_on`) FROM `settings`
D, [2023-04-18T11:04:46.571482 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]   Token Load (0.4ms)  SELECT `tokens`.* FROM `tokens` WHERE `tokens`.`action` = 'api' AND `tokens`.`value` = '************' LIMIT 1
D, [2023-04-18T11:04:46.573198 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]   User Load (0.5ms)  SELECT `users`.* FROM `users` WHERE `users`.`type` IN ('User', 'AnonymousUser') AND `users`.`id` = 5 LIMIT 1
D, [2023-04-18T11:04:46.574590 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]   User Load (0.6ms)  SELECT `users`.* FROM `users` WHERE `users`.`type` IN ('User', 'AnonymousUser') AND `users`.`login` = 'SCESD'
I, [2023-04-18T11:04:46.574866 #777496]  INFO -- : [93f4009c-a50b-4789-bb65-200062a347db]   User switched by: Rick (id=5)
I, [2023-04-18T11:04:46.575000 #777496]  INFO -- : [93f4009c-a50b-4789-bb65-200062a347db]   Current user: SCESD (id=42)
D, [2023-04-18T11:04:46.586988 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]   Role Load (0.6ms)  SELECT DISTINCT `roles`.* FROM `roles` INNER JOIN `member_roles` ON `member_roles`.`role_id` = `roles`.`id` INNER JOIN `members` ON `members`.`id` = `member_roles`.`member_id` INNER JOIN `projects` ON `projects`.`id` = `members`.`project_id` WHERE (projects.status <> 9) AND `members`.`user_id` = 42
D, [2023-04-18T11:04:46.589115 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]   GroupNonMember Load (0.5ms)  SELECT `users`.* FROM `users` WHERE `users`.`type` = 'GroupNonMember' ORDER BY `users`.`id` ASC LIMIT 1
D, [2023-04-18T11:04:46.627316 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]   Role Load (0.5ms)  SELECT DISTINCT `roles`.* FROM `roles` INNER JOIN `member_roles` ON `member_roles`.`role_id` = `roles`.`id` INNER JOIN `members` ON `members`.`id` = `member_roles`.`member_id` INNER JOIN `projects` ON `projects`.`id` = `members`.`project_id` WHERE (projects.status <> 9 AND projects.is_public = TRUE) AND `members`.`user_id` = 3
D, [2023-04-18T11:04:46.630379 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]   Role Load (0.4ms)  SELECT `roles`.* FROM `roles` WHERE `roles`.`builtin` = 1 LIMIT 1
D, [2023-04-18T11:04:46.656989 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]   IssuePriority Load (0.5ms)  SELECT `enumerations`.* FROM `enumerations` WHERE `enumerations`.`type` = 'IssuePriority' AND `enumerations`.`is_default` = TRUE ORDER BY `enumerations`.`position` ASC LIMIT 1
D, [2023-04-18T11:04:46.669876 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]   Setting Load (0.4ms)  SELECT `settings`.* FROM `settings` WHERE `settings`.`name` = 'default_issue_start_date_to_creation_date' ORDER BY `settings`.`id` DESC LIMIT 1
D, [2023-04-18T11:04:46.673424 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]   UserPreference Load (0.5ms)  SELECT `user_preferences`.* FROM `user_preferences` WHERE `user_preferences`.`user_id` = 42 LIMIT 1
D, [2023-04-18T11:04:46.696481 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]   GroupNonMember Load (0.5ms)  SELECT `users`.* FROM `users` WHERE `users`.`type` = 'GroupNonMember' ORDER BY id LIMIT 1
D, [2023-04-18T11:04:46.697527 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]    (0.4ms)  SELECT `users`.`id` FROM `users` WHERE `users`.`type` = 'GroupNonMember' LIMIT 1
D, [2023-04-18T11:04:46.698973 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]    (0.5ms)  SELECT `members`.`user_id`, `role_id`, `members`.`project_id` FROM `members` INNER JOIN `projects` ON `projects`.`id` = `members`.`project_id` INNER JOIN `member_roles` ON `member_roles`.`member_id` = `members`.`id` WHERE (projects.status <> 9) AND (members.user_id = 42 OR (projects.is_public = TRUE AND members.user_id = 3))
D, [2023-04-18T11:04:46.704421 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]   Project Exists? (0.6ms)  SELECT 1 AS one FROM `projects` WHERE (((projects.status = 1 AND EXISTS (SELECT 1 AS one FROM enabled_modules em WHERE em.project_id = projects.id AND em.name='issue_tracking')) AND ((projects.is_public = TRUE AND projects.id NOT IN (SELECT project_id FROM members WHERE user_id IN (42,3)))))) AND (projects.id IN (SELECT DISTINCT project_id FROM projects_trackers)) AND `projects`.`id` = 23 LIMIT 1
D, [2023-04-18T11:04:46.710659 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]   CACHE GroupNonMember Load (0.0ms)  SELECT `users`.* FROM `users` WHERE `users`.`type` = 'GroupNonMember' ORDER BY `users`.`id` ASC LIMIT 1
D, [2023-04-18T11:04:46.711368 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]   CACHE Role Load (0.0ms)  SELECT DISTINCT `roles`.* FROM `roles` INNER JOIN `member_roles` ON `member_roles`.`role_id` = `roles`.`id` INNER JOIN `members` ON `members`.`id` = `member_roles`.`member_id` INNER JOIN `projects` ON `projects`.`id` = `members`.`project_id` WHERE (projects.status <> 9 AND projects.is_public = TRUE) AND `members`.`user_id` = 3
D, [2023-04-18T11:04:46.712751 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]   TRANSACTION (0.3ms)  BEGIN
D, [2023-04-18T11:04:46.716535 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]   IssueCategory Load (0.4ms)  SELECT `issue_categories`.* FROM `issue_categories` WHERE `issue_categories`.`id` = 10 LIMIT 1
D, [2023-04-18T11:04:46.720232 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]   Setting Load (0.4ms)  SELECT `settings`.* FROM `settings` WHERE `settings`.`name` = 'issue_done_ratio' ORDER BY `settings`.`id` DESC LIMIT 1
D, [2023-04-18T11:04:46.721484 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]   Setting Load (0.4ms)  SELECT `settings`.* FROM `settings` WHERE `settings`.`name` = 'plugin_redmine_checklists' ORDER BY `settings`.`id` DESC LIMIT 1
D, [2023-04-18T11:04:46.723117 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]   TRANSACTION (0.3ms)  ROLLBACK
D, [2023-04-18T11:04:46.729216 #777496] DEBUG -- : [93f4009c-a50b-4789-bb65-200062a347db]   Rendering common/error_messages.api.rsb
I, [2023-04-18T11:04:46.729850 #777496]  INFO -- : [93f4009c-a50b-4789-bb65-200062a347db]   Rendered common/error_messages.api.rsb (Duration: 0.5ms | Allocations: 356)
I, [2023-04-18T11:04:46.730291 #777496]  INFO -- : [93f4009c-a50b-4789-bb65-200062a347db] Completed 422 Unprocessable Entity in 162ms (Views: 3.4ms | ActiveRecord: 26.4ms | Allocations: 77113)
eqoofvh9

eqoofvh91#

一些验证失败,e。例如,因为您(或管理员)添加了一些必需的自定义字段,或者在工作流中设置了一些必需的字段。
您应该在POST请求的响应中获得验证错误的完整列表。有关如何检索验证错误的详细信息,请参阅文档。

相关问题