Project

General

Profile

Actions

Defect #1502

closed

redmine work time plugin fails

Added by Gonzalo Valdez over 5 years ago. Updated over 4 years ago.

Status:
終了(Closed)
Priority:
通常(Normal)
Target version:
Start date:
06/20/2019
Due date:
% Done:

100%

Estimated time:

Description

I installed the plugin in redmine 4.0.3.stable

Environment:
Redmine version 4.0.3.stable
Ruby version 2.5.5-p157 (2019-03-15) [x86_64-linux]
Rails version 5.2.2.1
Environment production
Database adapter Mysql2
Mailer queue ActiveJob::QueueAdapters::AsyncAdapter
Mailer delivery smtp
SCM:
Subversion 1.11.1
Cvs 1.12.13
Git 2.19.1
Filesystem
Redmine plugins:
easy_gantt 1.12
periodictask 4.1.0
redmine_agile 1.4.12
redmine_work_time 0.4.0

When i tried to update the hours of a project I got
Internal error

An error occurred on the page you were trying to access.
If you continue to experience problems please contact your Redmine administrator for assistance.

If you are the Redmine administrator, check your log files for details about the error.

And the production.log shows

ActionController::UnfilteredParameters (unable to convert unpermitted parameters to hash):

plugins/redmine_work_time/app/controllers/work_time_controller.rb:768:in `block (2 levels) in hour_update'
plugins/redmine_work_time/app/controllers/work_time_controller.rb:766:in `block in hour_update'
plugins/redmine_work_time/app/controllers/work_time_controller.rb:762:in `hour_update'
plugins/redmine_work_time/app/controllers/work_time_controller.rb:19:in `index'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'

Is there a patch or a work around?

Thanks in advance


Files

ScreenShot_2019-09-27_10.15.46.png (326 KB) ScreenShot_2019-09-27_10.15.46.png Yuichi HARADA, 09/27/2019 11:27 AM
ScreenShot_2019-09-27_10.15.46.png

Related issues 1 (0 open1 closed)

Has duplicate r-labs - Defect #1501: redmine work time plugin fails終了(Closed)06/20/2019

Actions
Actions #1

Updated by Tomohisa Kusukawa over 5 years ago

  • Has duplicate Defect #1501: redmine work time plugin fails added
Actions #2

Updated by Yuichi HARADA over 5 years ago

以下の環境で動作検証をしておりますが、 日毎工数入力 で更新ボタンクリック時に本チケットと同様の Internal error が発生します。

Environment:
  Redmine version                4.0.4.stable.18527
  Ruby version                   2.5.6-p201 (2019-08-28) [x86_64-darwin18]
  Rails version                  5.2.3
  Environment                    production
  Database adapter               SQLite
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
SCM:
  Subversion                     1.10.3
  Mercurial                      5.1.1
  Cvs                            1.12.13
  Bazaar                         2.7.0
  Git                            2.23.0
  Filesystem
Redmine plugins:
  redmine_work_time              0.4.0
Started POST "/work_time/show/ecookbook?day=27&month=9&prj=false&user=3&year=2019" for 127.0.0.1 at 2019-09-27 10:16:16 +0900
Processing by WorkTimeController#show as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"hHidALbUfAHVFdsVFevuW2W91gjkBfac8/6C2dUKz/Y9tnhTmzpRsNQy3Unfs9yJTibR6sBvcNPcDS2b1FoPww==", "year"=>"2019", "month"=>"9", "day"=>"27", "user"=>"3", "prj"=>"false", "new_time_entry"=>{"3"=>{"0"=>{"hours"=>"", "activity_id"=>"10", "status_id"=>"1", "comments"=>""}}, "2"=>{"0"=>{"hours"=>"1", "activity_id"=>"10", "status_id"=>"2", "comments"=>""}}}, "new_time_entry_3_0"=>{"custom_field_values"=>{"12"=>"0"}}, "new_time_entry_2_0"=>{"custom_field_values"=>{"12"=>"0"}}, "commit"=>"更新", "id"=>"ecookbook"}
  Current user: admin (id=1)
Completed 500 Internal Server Error in 9ms (ActiveRecord: 2.0ms)

ActionController::UnfilteredParameters (unable to convert unpermitted parameters to hash):

plugins/redmine_work_time/app/controllers/work_time_controller.rb:768:in `block (2 levels) in hour_update'
plugins/redmine_work_time/app/controllers/work_time_controller.rb:766:in `block in hour_update'
plugins/redmine_work_time/app/controllers/work_time_controller.rb:762:in `hour_update'
plugins/redmine_work_time/app/controllers/work_time_controller.rb:46:in `show'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'

動作検証のために rake db:fixtures:load で test/fixtures をデータとして使っています。
作業時間カスタムフィールド の存在が原因のように思われます。

  • 作業時間カスタムフィールド が存在すると、日毎工数一覧にカスタムフィールドが表示され、更新ボタンクリックで Internal error が発生します。
  • 作業時間カスタムフィールド が存在しなければ(削除すると)、日毎工数入力(更新ボタンクリック)でエラーは発生しません。
Actions #4

Updated by xot47603 xot47603 over 5 years ago

@Tomohisa Kusukawa

I'm experiencing the very same error, but I think I know what's the trigger. If you configure custom field on time entry the error is happening, if there are no custom fields everything seems correct. Could you handle custom fields correctly as they are handled when using standard /time_entries endpoint? Here is example of my stack trace:

redmine     | I, [2019-10-01T13:32:49.541820 #133]  INFO -- : [c7cd389c-06d6-4173-a726-0120fd1f784a] Completed 200 OK in 309ms (Views: 166.9ms | ActiveRecord: 101.0ms)
redmine     | I, [2019-10-01T13:32:51.086950 #135]  INFO -- : [8d6617f1-e0ea-4d33-8751-42d8393dabd5] Started POST "/work_time/index?day=1&month=10&prj=false&user=1&year=2019" for 172.23.0.1 at 2019-10-01 13:32:51 +0000
redmine     | I, [2019-10-01T13:32:51.087875 #135]  INFO -- : [8d6617f1-e0ea-4d33-8751-42d8393dabd5] Processing by WorkTimeController#index as HTML
redmine     | I, [2019-10-01T13:32:51.087944 #135]  INFO -- : [8d6617f1-e0ea-4d33-8751-42d8393dabd5]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"Cvn5ZaHFVo3GhZzWpWGT+OSnYTAbwax03jnwc05dkhNs/pGygHHzbkmkQs1XyFIGq0KZ9Y18kCcs/n/ZzMuRhw==", "year"=>"2019", "month"=>"10", "day"=>"1", "user"=>"1", "prj"=>"false", "time_entry"=>{"1"=>{"hours"=>"1.00", "activity_id"=>"9", "status_id"=>"1", "comments"=>""}}, "time_entry_1"=>{"custom_field_values"=>{"4"=>""}}, "commit"=>"Update"}
redmine     | I, [2019-10-01T13:32:51.136229 #135]  INFO -- : [8d6617f1-e0ea-4d33-8751-42d8393dabd5]   Current user: admin (id=1)
redmine     | I, [2019-10-01T13:32:51.152318 #135]  INFO -- : [8d6617f1-e0ea-4d33-8751-42d8393dabd5] Completed 500 Internal Server Error in 64ms (ActiveRecord: 31.1ms)
redmine     | F, [2019-10-01T13:32:51.155182 #135] FATAL -- : [8d6617f1-e0ea-4d33-8751-42d8393dabd5]   
redmine     | F, [2019-10-01T13:32:51.163839 #135] FATAL -- : [8d6617f1-e0ea-4d33-8751-42d8393dabd5] ActionController::UnfilteredParameters (unable to convert unpermitted parameters to hash):
redmine     | F, [2019-10-01T13:32:51.163906 #135] FATAL -- : [8d6617f1-e0ea-4d33-8751-42d8393dabd5]   
redmine     | F, [2019-10-01T13:32:51.163935 #135] FATAL -- : [8d6617f1-e0ea-4d33-8751-42d8393dabd5] plugins/redmine_work_time/app/controllers/work_time_controller.rb:798:in `block in hour_update'
redmine     | [8d6617f1-e0ea-4d33-8751-42d8393dabd5] plugins/redmine_work_time/app/controllers/work_time_controller.rb:794:in `hour_update'
redmine     | [8d6617f1-e0ea-4d33-8751-42d8393dabd5] plugins/redmine_work_time/app/controllers/work_time_controller.rb:19:in `index'
redmine     | [8d6617f1-e0ea-4d33-8751-42d8393dabd5] lib/redmine/sudo_mode.rb:63:in `sudo_mode'
Actions #5

Updated by Tomohisa Kusukawa over 5 years ago

  • Status changed from 新規(New) to 解決(Resolved)
  • % Done changed from 0 to 100

更新履歴 git|3b0e2a0562bc96df1617bf99655494ef9c860b62 で適用されました。

Actions #6

Updated by Tomohisa Kusukawa over 5 years ago

Thank you very much for your specific information.
I think it's cured, so try getting the latest plug-in with the "Clone or Download" button at https://github.com/tkusukawa/redmine_work_time.

皆様、具体的な情報を本当にありがとうございます。
治ったと思うので https://github.com/tkusukawa/redmine_work_time の「Clone or Download」ボタンで最新のプラグインを取得して試してください。

(3b0e2a0562bc96df1617bf99655494ef9c860b62)

Actions #7

Updated by xot47603 xot47603 over 5 years ago

Thank you. I have tested master version and patch seems to work.

I also find SO thread with explanation that inheritance hierarchy has changed in Rails 5 and that's what caused the error: https://stackoverflow.com/a/46029524/1778101

Actions #8

Updated by Yuichi HARADA over 5 years ago

迅速な対応ありがとうございます。
カスタムフィールドの有無に関係なく Internal error は発生せず、動作することを確認しました。

Actions #9

Updated by Tomohisa Kusukawa over 4 years ago

  • Status changed from 解決(Resolved) to 終了(Closed)
  • Target version changed from 0.4.0 to 0.4.1

対応が止まっていて大変申し訳ありませんでした。

バージョン 0.4.1に含めさせていただきました。
https://github.com/tkusukawa/redmine_work_time/archive/0.4.1.zip

Actions

Also available in: Atom PDF