alphanodes / additionals

Redmine plugin for easy customization of settings, text and content display by using personal or role-based dashboards (drag&drop), providing wiki macros and act as library for other plugins.
https://www.redmine.org/plugins/additionals
GNU General Public License v2.0
131 stars 43 forks source link

SystemStackError (stack level too deep) #120

Closed moskvin closed 7 months ago

moskvin commented 2 years ago

Overview

When I open http:://remine.local/settings I get 500 Error in my chrome browser

Environment

  Redmine version                4.1.5.stable
  Ruby version                   2.6.8-p205 (2021-07-07) [x86_64-linux]
  Rails version                  5.2.6
  Environment                    production

Redmine plugins

redmine-redmine-1  | I, [2021-10-18T07:51:43.550285 #1]  INFO -- : Completed 500 Internal Server Error in 206ms (ActiveRecord: 23.4ms)
redmine-redmine-1  | F, [2021-10-18T07:51:43.601394 #1] FATAL -- :
redmine-redmine-1  | F, [2021-10-18T07:51:43.601556 #1] FATAL -- : SystemStackError (stack level too deep):
redmine-redmine-1  | F, [2021-10-18T07:51:43.601585 #1] FATAL -- :
plugins/additionals/lib/additionals/patches/access_control_patch.rb:37:in `available_project_modules'
redmine-redmine-1  | plugins/redmine_favorite_projects/lib/redmine_favorite_projects/patches/access_control_patch.rb:20:in `available_project_modules_with_favorite_projects'
redmine-redmine-1  | plugins/additionals/lib/additionals/patches/access_control_patch.rb:37:in `available_project_modules'
redmine-redmine-1  | plugins/redmine_favorite_projects/lib/redmine_favorite_projects/patches/access_control_patch.rb:20:in `available_project_modules_with_favorite_projects'
redmine-redmine-1  | plugins/additionals/lib/additionals/patches/access_control_patch.rb:37:in `available_project_modules'
redmine-redmine-1  | plugins/redmine_favorite_projects/lib/redmine_favorite_projects/patches/access_control_patch.rb:20:in `available_project_modules_with_favorite_projects'
redmine-redmine-1  | plugins/additionals/lib/additionals/patches/access_control_patch.rb:37:in `available_project_modules'
...
redmine-redmine-1  | plugins/redmine_favorite_projects/lib/redmine_favorite_projects/patches/access_control_patch.rb:20:in `available_project_modules_with_favorite_projects'
redmine-redmine-1  | plugins/additionals/lib/additionals/patches/access_control_patch.rb:37:in `available_project_modules'
redmine-redmine-1  | app/views/settings/_projects.html.erb:7:in `block in _app_views_settings__projects_html_erb___4206641923890319920_47365141377660'
redmine-redmine-1  | app/views/settings/_projects.html.erb:1:in `_app_views_settings__projects_html_erb___4206641923890319920_47365141377660'
redmine-redmine-1  | app/views/common/_tabs.html.erb:21:in `block in _app_views_common__tabs_html_erb___44189417872363782_47365140145300'
redmine-redmine-1  | app/views/common/_tabs.html.erb:20:in `each'
redmine-redmine-1  | app/views/common/_tabs.html.erb:20:in `_app_views_common__tabs_html_erb___44189417872363782_47365140145300'
redmine-redmine-1  | app/helpers/application_helper.rb:439:in `render_tabs'
redmine-redmine-1  | app/views/settings/edit.html.erb:5:in `_app_views_settings_edit_html_erb___3664657171096934650_47365140014020'
redmine-redmine-1  | app/controllers/settings_controller.rb:33:in `index'
redmine-redmine-1  | lib/redmine/sudo_mode.rb:65:in `sudo_mode'
moskvin commented 2 years ago

FYI: works fine from stable branch, but it appears from master branch

alexandermeindl commented 2 years ago

Hi @moskvin this is a compatibility problem with prepend and alias_method. More and more plugins fight with this problem. One redmine plugin use prepend and another plugin uses alias_method for the same method to overwrite - but this raises stack level too deep. Since Ruby 2.0 prepend is available and in most cases a better and more powerful solution. We try always to use prepend for that reason. To make it sort: if you have a case with "stack level too deep", you cannot use both plugins.

alexandermeindl commented 7 months ago

See #120 for more information