Project

General

Profile

Actions

Feature #5084

closed

upgrade to more actively maintained version of redmine

Added by laforge 9 months ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Urgent
Assignee:
Category:
redmine
Target version:
-
Start date:
03/20/2021
Due date:
% Done:

100%

Spec Reference:

Description

we're still using redmine 3.4.x - while it has not officially been discontinued, there have not been any releases since 2019 (!).

Let's try to switch to the latest version (4.1.x) in the near future.

Actions #1

Updated by laforge 9 months ago

  • % Done changed from 0 to 10

I gave it a try. Most plugins could be upgraded, however the redmine_openid_provider plugin has not been ported to a modern rails-5.x yet, and it fails.

redmine-test_1       | [ E 2021-03-20 19:18:02.0771 39/T8 age/Cor/Con/CheckoutSession.cpp:276 ]: [Client 1-1] Cannot checkout session because a spawning error occurred. The identifier of the error is 1d7fe228. Please see earlier logs for details about the error.
redmine-test_1       | App 142 output: I, [2021-03-20T19:18:29.642060 #142]  INFO -- : Starting wiki_graphviz_plugin for Redmine
redmine-test_1       | App 142 output: I, [2021-03-20T19:18:29.642660 #142]  INFO -- : Starting wiki_mscgen_plugin for Redmine
redmine-test_1       | App 142 output: W, [2021-03-20T19:18:29.760832 #142]  WARN -- : Creating scope :system. Overwriting existing method Enumeration.system.
redmine-test_1       | App 142 output: W, [2021-03-20T19:18:29.770735 #142]  WARN -- : Creating scope :sorted. Overwriting existing method Group.sorted.
redmine-test_1       | App 142 output: W, [2021-03-20T19:18:29.775510 #142]  WARN -- : Creating scope :sorted. Overwriting existing method User.sorted.
redmine-test_1       | App 142 output: Error: The application encountered the following error: undefined method `before_filter' for OpenIdProviderController:Class
redmine-test_1       | App 142 output: Did you mean?  before_action (NoMethodError)
redmine-test_1       | App 142 output:     /usr/src/redmine/plugins/redmine_openid_provider/app/controllers/open_id_provider_controller.rb:16:in `<class:OpenIdProviderController>'
redmine-test_1       | App 142 output:     /usr/src/redmine/plugins/redmine_openid_provider/app/controllers/open_id_provider_controller.rb:9:in `<top (required)>'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:291:in `require'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:291:in `block in require'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:257:in `load_dependency'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:291:in `require'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:378:in `block in require_or_load'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:37:in `block in load_interlock'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/activesupport-5.2.4.2/lib/active_support/dependencies/interlock.rb:14:in `block in loading'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/activesupport-5.2.4.2/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/activesupport-5.2.4.2/lib/active_support/dependencies/interlock.rb:13:in `loading'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:37:in `load_interlock'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:356:in `require_or_load'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:334:in `depend_on'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:246:in `require_dependency'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/railties-5.2.4.2/lib/rails/engine.rb:478:in `block (2 levels) in eager_load!'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/railties-5.2.4.2/lib/rails/engine.rb:477:in `each'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/railties-5.2.4.2/lib/rails/engine.rb:477:in `block in eager_load!'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/railties-5.2.4.2/lib/rails/engine.rb:475:in `each'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/railties-5.2.4.2/lib/rails/engine.rb:475:in `eager_load!'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/railties-5.2.4.2/lib/rails/engine.rb:356:in `eager_load!'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/railties-5.2.4.2/lib/rails/application/finisher.rb:69:in `each'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/railties-5.2.4.2/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/railties-5.2.4.2/lib/rails/initializable.rb:32:in `instance_exec'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/railties-5.2.4.2/lib/rails/initializable.rb:32:in `run'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/railties-5.2.4.2/lib/rails/initializable.rb:61:in `block in run_initializers'
redmine-test_1       | App 142 output:     /usr/local/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each'
redmine-test_1       | App 142 output:     /usr/local/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
redmine-test_1       | App 142 output:     /usr/local/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from'
redmine-test_1       | App 142 output:     /usr/local/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component'
redmine-test_1       | App 142 output:     /usr/local/lib/ruby/2.6.0/tsort.rb:347:in `each'
redmine-test_1       | App 142 output:     /usr/local/lib/ruby/2.6.0/tsort.rb:347:in `call'
redmine-test_1       | App 142 output:     /usr/local/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component'
redmine-test_1       | App 142 output:     /usr/local/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each'
redmine-test_1       | App 142 output:     /usr/local/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/railties-5.2.4.2/lib/rails/initializable.rb:60:in `run_initializers'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/railties-5.2.4.2/lib/rails/application.rb:361:in `initialize!'
redmine-test_1       | App 142 output:     /usr/src/redmine/config/environment.rb:16:in `<top (required)>'
redmine-test_1       | App 142 output:     config.ru:3:in `require'
redmine-test_1       | App 142 output:     config.ru:3:in `block in <main>'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/rack-2.2.3/lib/rack/builder.rb:125:in `instance_eval'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/rack-2.2.3/lib/rack/builder.rb:125:in `initialize'
redmine-test_1       | App 142 output:     config.ru:1:in `new'
redmine-test_1       | App 142 output:     config.ru:1:in `<main>'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/passenger-6.0.7/src/helper-scripts/rack-preloader.rb:101:in `eval'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/passenger-6.0.7/src/helper-scripts/rack-preloader.rb:101:in `preload_app'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/passenger-6.0.7/src/helper-scripts/rack-preloader.rb:189:in `block in <module:App>'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/passenger-6.0.7/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:382:in `run_block_and_record_step_progress'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/passenger-6.0.7/src/helper-scripts/rack-preloader.rb:188:in `<module:App>'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/passenger-6.0.7/src/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
redmine-test_1       | App 142 output:     /usr/local/bundle/gems/passenger-6.0.7/src/helper-scripts/rack-preloader.rb:29:in `<main>'
redmine-test_1       | [ E 2021-03-20 19:18:30.3968 39/T1c age/Cor/App/Implementation.cpp:221 ]: Could not spawn process for application /usr/src/redmine: The application encountered the following error: undefined method `before_filter' for OpenIdProviderController:Class
redmine-test_1       | Did you mean?  before_action (NoMethodError)
redmine-test_1       |   Error ID: 0000ce64
redmine-test_1       |   Error details saved to: /tmp/passenger-error-Dr00bX.html

Trying to find somebody who can help: https://twitter.com/LaF0rge/status/1373354881436807169

Actions #2

Updated by laforge 9 months ago

  • % Done changed from 10 to 50

aside from the openid provider plugin everything else seems working now. the mscgen plugin had to be trivially ported, but even I with zero rails knowledge could do it.

Actions #3

Updated by laforge 9 months ago

  • % Done changed from 50 to 60

This trivial change https://github.com/osmocom/redmine_openid_provider/commit/b639ba42b89562a71f5996380727a27466b04e43 avoids the exception in the openid provider. Not sure if it will actually work?

Actions #4

Updated by laforge 9 months ago

laforge wrote:

This trivial change https://github.com/osmocom/redmine_openid_provider/commit/b639ba42b89562a71f5996380727a27466b04e43 avoids the exception in the openid provider. Not sure if it will actually work?

It doesn't; there's a '500 internal server error' on the first openid authentication attempt :(

Started GET "/openid" for 127.0.0.1 at 2021-10-27 18:20:31 +0530
Processing by OpenIdProviderController#index as HTML
  Current user: anonymous
  Rendering plugins/redmine_openid_provider/app/views/open_id_provider/index.html.erb within layouts/base
  Rendered plugins/redmine_openid_provider/app/views/open_id_provider/index.html.erb within layouts/base (0.3ms)
Completed 200 OK in 49ms (Views: 19.0ms | ActiveRecord: 18.1ms)
Started POST "/openid" for 127.0.0.1 at 2021-10-27 18:27:04 +0530
Processing by OpenIdProviderController#checkid_setup as */*
  Parameters: {"openid.ns"=>"http://specs.openid.net/auth/2.0", "openid.claimed_id"=>"http://specs.openid.net/auth/2.0/identifier_select", "openid.identity"=>"http://specs.openid.net/auth/2.0/identifier_select", "openid.return_to"=>"https://gerrit.osmocom.org/OpenID?gerrit.mode=SIGN_IN&gerrit.token=q%2Fstatus%3Aopen%2B-is%3Awip", "openid.realm"=>"https://gerrit.osmocom.org/", "openid.assoc_handle"=>"{HMAC-SHA256}{FOO}{bar}", "openid.mode"=>"checkid_setup", "openid.ns.sreg"=>"http://openid.net/sreg/1.0", "openid.sreg.required"=>"fullname,email", "openid.ns.ext2"=>"http://openid.net/srv/ax/1.0", "openid.ext2.mode"=>"fetch_request", "openid.ext2.type.FirstName"=>"http://schema.openid.net/namePerson/first", "openid.ext2.type.LastName"=>"http://schema.openid.net/namePerson/last", "openid.ext2.type.Email"=>"http://schema.openid.net/contact/email", "openid.ext2.required"=>"FirstName,LastName,Email"}
  Current user: anonymous
Completed 500 Internal Server Error in 22ms (ActiveRecord: 8.2ms)

NoMethodError (undefined method `length' for #<ActionController::Parameters:0x000055fae6ecd6c8>):

plugins/redmine_openid_provider/app/controllers/open_id_provider_controller.rb:30:in `checkid_setup'
lib/redmine/sudo_mode.rb:61:in `sudo_mode'

note: accidentally edited instead of commented by tsaitgaist (don't know how to undo the edit)

Actions #5

Updated by laforge 9 months ago

successful case with 3.4 looks like this:

App 228 output: I, [2021-03-20T20:43:43.640010 #228]  INFO -- : Started POST "/openid" for 91.58.183.151 at 2021-03-20 20:43:43 +0000
App 228 output: I, [2021-03-20T20:43:43.640975 #228]  INFO -- : Processing by OpenIdProviderController#checkid_setup as HTML
App 228 output: I, [2021-03-20T20:43:43.641042 #228]  INFO -- :   Parameters: {"openid.ns"=>"http://specs.openid.net/auth/2.0", "openid.claimed_id"=>"http://specs.openid.net/auth/2.0/identifier_select", "openid.identity"=>"http://specs.openid.net/auth/2.0/identifier_select", "openid.return_to"=>"https://gerrit.osmocom.org/OpenID?gerrit.mode=SIGN_IN&gerrit.token=q%2Fstatus%3Aopen%2B-is%3Awip", "openid.realm"=>"https://gerrit.osmocom.org/", "openid.assoc_handle"=>"{HMAC-SHA256}{FOO}{bar}", "openid.mode"=>"checkid_setup", "openid.ns.sreg"=>"http://openid.net/sreg/1.0", "openid.sreg.required"=>"fullname,email", "openid.ns.ext2"=>"http://openid.net/srv/ax/1.0", "openid.ext2.mode"=>"fetch_request", "openid.ext2.type.FirstName"=>"http://schema.openid.net/namePerson/first", "openid.ext2.type.LastName"=>"http://schema.openid.net/namePerson/last", "openid.ext2.type.Email"=>"http://schema.openid.net/contact/email", "openid.ext2.required"=>"FirstName,LastName,Email"}
App 228 output: I, [2021-03-20T20:43:43.648085 #228]  INFO -- :   Current user: laforge (id=7)
App 228 output: I, [2021-03-20T20:43:43.650968 #228]  INFO -- :   Rendered plugins/redmine_openid_provider/app/views/open_id_provider/confirm.html.erb within layouts/base (0.8ms)
App 228 output: I, [2021-03-20T20:43:43.653375 #228]  INFO -- :   Rendered plugins/clipboard_image_paste/app/views/clipboard_image_paste/_headers.html.erb (0.3ms)
App 228 output: I, [2021-03-20T20:43:43.653704 #228]  INFO -- :   Rendered plugins/redmine_tags/app/views/tags/_header_assets.html.erb (0.2ms)
App 228 output: I, [2021-03-20T20:43:43.667147 #228]  INFO -- :   Rendered plugins/redmine_banner/app/views/banner/_project_body_bottom.html.erb (0.0ms)
App 228 output: I, [2021-03-20T20:43:43.668267 #228]  INFO -- :   Rendered plugins/clipboard_image_paste/app/views/clipboard_image_paste/_add_form.html.erb (1.0ms)
App 228 output: I, [2021-03-20T20:43:43.668369 #228]  INFO -- : Completed 200 OK in 27ms (Views: 18.9ms | ActiveRecord: 5.3ms)

Actions #6

Updated by laforge 9 months ago

  • Status changed from New to Stalled
Actions #7

Updated by laforge about 2 months ago

  • Priority changed from Normal to Urgent
Actions #8

Updated by laforge about 1 month ago

tsaitgaist, I'm sorry to bother you with it, but nobody has responded either on twitter nor in the redmine forum. Quite sad that nobody from within the redmine community appears to be intereested in helping some user with doing a few paid hours for porting a plugin. As you have ruby experience, maybe it's something you could look at? I suspect it's something like a trivial 1-2 hours for somebody understanding what's happening. but maybe I'm wrong?

The sources of the plugin are linked above. The Docker container we curreently use is described in docker-playground.git/redmine/Dockerfile. Thanks!

Actions #9

Updated by tsaitgaist about 1 month ago

  • Status changed from Stalled to In Progress
  • Assignee changed from laforge to tsaitgaist

I'll look into it. I expect the setup to take longer than the fix. I'll tell if there is a road blocker.

Actions #10

Updated by tsaitgaist about 1 month ago

  • % Done changed from 60 to 90

laforge wrote:

This trivial change https://github.com/osmocom/redmine_openid_provider/commit/b639ba42b89562a71f5996380727a27466b04e43 avoids the exception in the openid provider. Not sure if it will actually work?

this fix is correct.

It doesn't; there's a '500 internal server error' on the first openid authentication attempt :(

this is another bug. with rails 5, the length method has dissipated for the openid parameters.
a description + fix is available here:
https://github.com/openid/ruby-openid/pull/133

until a release for the ruby-openid gem used by redmine is available, the gem can be fixed locally (here for the/my docker image once I attached to it):

sed -i '/query.length == 0/query.empty?/' /home/redmine/data/tmp/bundle/ruby/2.6.0/gems/ruby-openid-2.9.2/lib/openid/server.rb

Actions #11

Updated by tsaitgaist about 1 month ago

  • Status changed from In Progress to Resolved
  • % Done changed from 90 to 100
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)