ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

uninitialized constant Redmine::Scm::Adapters::CommandFailed in RepositoryController (Bug #828)


Added by Jeffrey MACKO at 2012-01-12 06:19 pm. Updated at 2012-02-24 02:47 pm.


Status:Closed Start date:2012-01-12
Priority:Normal Due date:
Assignee:Felix Schäfer % Done:

0%

Category:SCM
Target version:3.1.0
Remote issue URL: Affected version:

Description

Processing ApplicationController#edit (for 127.0.0.1 at 2012-01-12 19:09:44) [GET]
Parameters: {"action"=>"edit", "authenticity_token"=>"bbls4aOMj837bDz/KTViA4juzCiaNaz5IH9dxx0EGGU=", "id"=>"test", "controller"=>"repositories", "repository_scm"=>"Subversion"}

NameError (uninitialized constant Redmine::Scm::Adapters::CommandFailed):
mysql/ruby/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:466:in `load_missing_constant'
mysql/ruby/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:106:in `const_missing'
app/controllers/repositories_controller.rb:32
mysql/ruby/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:406:in `load_without_new_constant_marking'
mysql/ruby/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:406:in `load_file'
mysql/ruby/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:547:in `new_constants_in'
mysql/ruby/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:405:in `load_file'
mysql/ruby/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:285:in `require_or_load_without_engine_additions'
mysql/ruby/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:451:in `load_missing_constant'
mysql/ruby/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:106:in `const_missing'
mysql/ruby/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:118:in `const_missing'
mysql/ruby/1.8/gems/activesupport-2.3.14/lib/active_support/inflector.rb:364:in `constantize'
mysql/ruby/1.8/gems/activesupport-2.3.14/lib/active_support/inflector.rb:363:in `each'
mysql/ruby/1.8/gems/activesupport-2.3.14/lib/active_support/inflector.rb:363:in `constantize'
mysql/ruby/1.8/gems/activesupport-2.3.14/lib/active_support/core_ext/string/inflections.rb:162:in `constantize'
mysql/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/routing/route_set.rb:444:in `recognize'
mysql/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/routing/route_set.rb:437:in `call'
mysql/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:87:in `dispatch'
mysql/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:121:in `_call'
mysql/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack'
mysql/ruby/1.8/gems/activerecord-2.3.14/lib/active_record/query_cache.rb:29:in `call'
mysql/ruby/1.8/gems/activerecord-2.3.14/lib/active_record/query_cache.rb:29:in `call'
mysql/ruby/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
mysql/ruby/1.8/gems/activerecord-2.3.14/lib/active_record/query_cache.rb:9:in `cache'
mysql/ruby/1.8/gems/activerecord-2.3.14/lib/active_record/query_cache.rb:28:in `call'
mysql/ruby/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
mysql/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/string_coercion.rb:25:in `call'
mysql/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/params_parser.rb:15:in `call'
mysql/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/session/cookie_store.rb:99:in `call'
mysql/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/failsafe.rb:26:in `call'
mysql/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:114:in `call'
mysql/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/reloader.rb:34:in `run'
mysql/ruby/1.8/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:108:in `call'
mysql/ruby/1.8/gems/rails-2.3.14/lib/rails/rack/static.rb:31:in `call'
mysql/ruby/1.8/gems/rails-2.3.14/lib/rails/rack/log_tailer.rb:17:in `call'
mysql/ruby/1.8/gems/rails-2.3.14/lib/rails/rack/static.rb:31:in `call'
mysql/ruby/1.8/gems/rails-2.3.14/lib/rails/rack/log_tailer.rb:17:in `call'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
mysql/ruby/1.8/gems/rails-2.3.14/lib/commands/server.rb:111

Rendered rescues/_trace (30.3ms)
Rendered rescues/_request_and_response (0.9ms)
Rendering rescues/layout (internal_server_error)
SQL (0.1ms) SET NAMES 'utf8'
SQL (0.1ms) SET SQL_AUTO_IS_NULL=0


Associated revisions

Revision cbcce704
Added by Michaël Rigart at 2012-02-24 03:44 pm

Fix requiring SCM classes in dev mode #828

Change require to require_dependency so SCM classes get loaded on each request in dev mode

History

Updated by Holger Just at 2012-01-12 06:43 pm

That shouldn't happen. The class definitely exists and is used.

Could you please tell us which version of ChiliProject you are using and which Ruby version you have? Also, please have a look into your log dir if you find a file called scm.stderr.log. Its contents would be helpful.

  • Target version deleted (2.7.0)
  • Subject changed from SCM don't workchiliproject to uninitialized constant Redmine::Scm::Adapters::CommandFailed in RepositoryController

Updated by Jeffrey MACKO at 2012-01-13 09:10 am

Can you allow me to edit my ticket because yesterday I didn't have time to finish to write it because I validate it by mistake.

Ruby 1.8.7
Chiliproject 2.6.0
The file scm.stderr.log is not present in my log directory.

I will try with ruby 1.9.3.

Updated by Jeffrey MACKO at 2012-01-16 11:42 am

Jeffrey MACKO wrote:

Can you allow me to edit my ticket because yesterday I didn't have time to finish to write it because I validate it by mistake.

Ruby 1.8.7
Chiliproject 2.6.0
The file scm.stderr.log is not present in my log directory.

I will try with ruby 1.9.3.

Don't work with ruby 1.9.3 too and I still don't have scm.stderr.log in log directory.

Updated by Gilbert Flamino at 2012-01-25 04:06 am

Seeing this error too.

Upgraded from 1.54 to 2.6.0
Ruby 1.8.7
scm.stderr.log is present but empty

Updated by Michaël Rigart at 2012-02-15 09:25 am

I just discovered Chiliproject after running into some problems with Redmine. So I took it for a spin and had the same error as explained above.

clean install of Chiliproject 3.0
Ruby 1.9.3p0
running in development

It seems the adapter classes haven't been loaded. Quick fix was adding the lib directory to the autoload paths.
Haven't had any time to look into it deeper. Maybe this afternoon.

Updated by Michaël Rigart at 2012-02-15 01:11 pm

Hi,

took a little time to investigate it a bit further and found the problem.

Seems this only happens in development mode, after the first request (from the second request on), since rails unloads your modules so you don't have to restart your app every time you make a change.

In the application_controller, all scm repository classes get loaded again with require_dependency on every request. But the modules these scm depend on like for example git_adapter and abstract_adapter get loaded with the standard ruby require, so they don't get loaded again.
Hence the uninitialized constant errors in development.

I see like two ways to overcome this, either change those require to require_dependency or require the modules somewhere globally like your environment file.

Suggestions are welcome. If necessary I'm willing to implement this and send a pull request.

Updated by Michaël Rigart at 2012-02-15 01:25 pm

Another, maybe cleaner way might be to remove the requires from within the modules and integrate them to the application_controller :

  require_dependency 'redmine/scm/adapters/abstract_adapter'
  Redmine::Scm::Base.all.each do |scm|
    require_dependency "repository/#{scm.underscore}" 
    require_dependency "redmine/scm/adapters/#{scm.underscore}_adapter" 
  end

Updated by Felix Schäfer at 2012-02-24 02:37 pm

I can confirm this, trying out pull request 156.

  • Assignee set to Felix Schäfer

Updated by Felix Schäfer at 2012-02-24 02:47 pm

Fixed in cbcce70, thanks Michaël!

  • Status changed from Open to Closed

Updated by Felix Schäfer at 2012-02-24 02:47 pm

  • Target version set to 3.1.0

Also available in: Atom PDF