Defect #40921
closedJSON API causes 500 Internal Server Error
0%
Description
I use redmine 5.0.7 with https://github.com/redmine/redmine/commit/d909b82d32fd3deb3b2a01e253da7aa264ffc89c this official patch. When i try to access rest api in json format, i get the error below.SystemStackError (stack level too deep):
lib/redmine/views/builders/structure.rb:49:in `method_missing'
.......
a lot of this string "lib/redmine/views/builders/structure.rb:69:in `method_missing'"
.......
lib/redmine/views/builders/structure.rb:69:in `method_missing'
app/views/timelog/index.api.rsb:3:in `block (3 levels) in smth'
app/views/timelog/index.api.rsb:2:in `each'
app/views/timelog/index.api.rsb:2:in `block (2 levels) in smth'
lib/redmine/views/builders/structure.rb:32:in `array'
app/views/timelog/index.api.rsb:1:in `block in smth'
lib/redmine/views/builders.rb:38:in `for'
app/views/timelog/index.api.rsb:1:in `smth'
lib/redmine/sudo_mode.rb:61:in `sudo_mode'
Without the patch, when i force to install old version of builder gem, rest api works.
Updated by Pavel Rosický 2 days ago
the patch is valid for the latest development version (Redmine 6). Backporting it to older versions might need more changes.
note that, Redmine 5.0 is still supported and this issue has been fixed and released as Redmine 5.0.9. Is anything blocking an upgrade to the official version, or why are you manually patching it?
if you can't upgrade for some reason, either use a patch for the right Redmine version
https://github.com/redmine/redmine/blob/5.0-stable/lib/redmine/views/builders/structure.rb
or alternatively, lock the gem version
gem 'builder', '~> 3.2.4'
Updated by Go MAEDA about 7 hours ago
- Status changed from New to Closed
- Resolution set to Invalid