https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292014-01-14T10:23:48ZRedmineRedmine - Defect #15849: Redmine:Fetch_Changesets Single-inheritance issue in subclass "Repository:Git"https://www.redmine.org/issues/15849?journal_id=542872014-01-14T10:23:48ZChristopher Maximov
<ul></ul><p>Same here. Redmin 2.4.2 stable using Mercurial repository. Getting this:</p>
<p>The single-table inheritance mechanism failed to locate the subclass: 'Repository::Mercurial'.</p>
<p>Just like in the original post for git.</p> Redmine - Defect #15849: Redmine:Fetch_Changesets Single-inheritance issue in subclass "Repository:Git"https://www.redmine.org/issues/15849?journal_id=542882014-01-14T14:03:45ZMartin Seener
<ul></ul><p>Added the same command with --trace:</p>
<pre>
root@server:/var/www/redmine# RAILS_ENV=production; bundle exec rake redmine:fetch_changesets --trace
** Invoke redmine:fetch_changesets (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:fetch_changesets
rake aborted!
The single-table inheritance mechanism failed to locate the subclass: 'Repository::Git'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Repository.inheritance_column to use another column for that information.
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.16/lib/active_record/inheritance.rb:143:in `rescue in find_sti_class'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.16/lib/active_record/inheritance.rb:136:in `find_sti_class'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.16/lib/active_record/inheritance.rb:62:in `instantiate'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.16/lib/active_record/querying.rb:38:in `block (2 levels) in find_by_sql'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.16/lib/active_record/querying.rb:38:in `collect!'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.16/lib/active_record/querying.rb:38:in `block in find_by_sql'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.16/lib/active_record/explain.rb:41:in `logging_query_plan'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.16/lib/active_record/querying.rb:37:in `find_by_sql'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.16/lib/active_record/relation.rb:171:in `exec_queries'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.16/lib/active_record/relation.rb:160:in `block in to_a'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.16/lib/active_record/explain.rb:41:in `logging_query_plan'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.16/lib/active_record/relation.rb:159:in `to_a'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.16/lib/active_record/relation/finder_methods.rb:159:in `all'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.16/lib/active_record/associations/collection_association.rb:382:in `find_target'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.16/lib/active_record/associations/collection_association.rb:335:in `load_target'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.16/lib/active_record/associations/collection_proxy.rb:44:in `load_target'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.16/lib/active_record/associations/collection_proxy.rb:89:in `method_missing'
/var/www/redmine-2.4.2/app/models/repository.rb:330:in `block in fetch_changesets'
/var/www/redmine-2.4.2/app/models/repository.rb:329:in `each'
/var/www/redmine-2.4.2/app/models/repository.rb:329:in `fetch_changesets'
/var/www/redmine-2.4.2/lib/tasks/redmine.rake:47:in `block (2 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/rake-10.1.1/lib/rake/application.rb:149:in `invoke_task'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/rake-10.1.1/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/rake-10.1.1/lib/rake/application.rb:106:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/rake-10.1.1/lib/rake/application.rb:106:in `block in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/rake-10.1.1/lib/rake/application.rb:115:in `run_with_threads'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/rake-10.1.1/lib/rake/application.rb:100:in `top_level'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/rake-10.1.1/lib/rake/application.rb:78:in `block in run'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
/usr/local/rvm/gems/ruby-1.9.3-p362/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p362/bin/rake:19:in `load'
/usr/local/rvm/gems/ruby-1.9.3-p362/bin/rake:19:in `<main>'
/usr/local/rvm/gems/ruby-1.9.3-p362/bin/ruby_noexec_wrapper:14:in `eval'
/usr/local/rvm/gems/ruby-1.9.3-p362/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => redmine:fetch_changesets
</pre> Redmine - Defect #15849: Redmine:Fetch_Changesets Single-inheritance issue in subclass "Repository:Git"https://www.redmine.org/issues/15849?journal_id=542902014-01-14T14:23:25ZMartin Seener
<ul></ul><p>I tried a bit around with my rails colleague and we found out that we dont know whats going on.</p>
<p>We are easily able to start the rails console and the rake task from within without issues.</p>
<pre>
bundle exec rails c production
</pre><br />and then the rake task (from the redmine.rake file)<br /><pre>
Repository.fetch_changesets
</pre>
<p>and it goes trough without an error. Thats weird.</p>
<p><strong>Update 5:55pm:</strong></p>
<p>We tried our own Rake Task which is the file foo.rake in lib/tasks with following content:<br /><pre>
namespace :foo do
task :bar => :environment do
Repository.fetch_changesets
end
end
</pre><br />and then executed with the following command brings the exakt same error. so it maybe is something wrong with the rake environment??<br /><pre>
bundle exec rake foo:bar RAILS_ENV=production
</pre></p> Redmine - Defect #15849: Redmine:Fetch_Changesets Single-inheritance issue in subclass "Repository:Git"https://www.redmine.org/issues/15849?journal_id=543012014-01-15T10:21:27ZMartin Seener
<ul></ul><p>We tried setting up Redmine 2.4.2 from scratch, added a new DB with own seed data and then only added an existing git repo to a new project. Even then the rake task fails!</p>
<p>But we figured out a workaround which may also work for other SCMs. Our Cronjob now looks like this (we dont use rake anymore):<br /><pre>
*/3 8-23 * * * cd /var/www/redmine && echo "Repository.fetch_changesets" | bundle exec rails c production >/dev/null 2>&1
</pre></p>
<p>With this, we just pipe the command to fetch the changes directly into the rails console, which works great and does not use rake.</p> Redmine - Defect #15849: Redmine:Fetch_Changesets Single-inheritance issue in subclass "Repository:Git"https://www.redmine.org/issues/15849?journal_id=544452014-01-22T20:34:29ZFrancois Lachance
<ul></ul><p>Hi there, I got "almost the same problem". First, I'm using SVN instead of GIT.<br />Then, I decide to try your solution and seem to be working but got this error a little bit down the line:<br /><pre>
NoMethodError: undefined method `created_on' for #<Repository::Subversion:0x000000060d2798>
from /var/lib/gems/1.9.1/gems/activemodel-3.2.16/lib/active_model/attribute_methods.rb:407:in `method_missing'
from /var/lib/gems/1.9.1/gems/activerecord-3.2.16/lib/active_record/attribute_methods.rb:149:in `method_missing'
from /var/www/redmine/app/models/changeset.rb:136:in `block (2 levels) in scan_comment_for_issue_ids'
from /var/www/redmine/app/models/changeset.rb:131:in `each'
from /var/www/redmine/app/models/changeset.rb:131:in `block in scan_comment_for_issue_ids'
from /var/www/redmine/app/models/changeset.rb:127:in `scan'
from /var/www/redmine/app/models/changeset.rb:127:in `scan_comment_for_issue_ids'
from /var/www/redmine/app/models/changeset.rb:100:in `scan_for_issues'
from /var/lib/gems/1.9.1/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:432:in `_run__1515758292348163996__create__3917711451105029760__callbacks'
from /var/lib/gems/1.9.1/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:405:in `__run_callback'
from /var/lib/gems/1.9.1/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:385:in `_run_create_callbacks'
from /var/lib/gems/1.9.1/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:81:in `run_callbacks'
from /var/lib/gems/1.9.1/gems/activerecord-3.2.16/lib/active_record/callbacks.rb:268:in `create'
from /var/lib/gems/1.9.1/gems/activerecord-3.2.16/lib/active_record/persistence.rb:348:in `create_or_update'
from /var/lib/gems/1.9.1/gems/activerecord-3.2.16/lib/active_record/callbacks.rb:264:in `block in create_or_update'
from /var/lib/gems/1.9.1/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:436:in `_run__1515758292348163996__save__3917711451105029760__callbacks'
... 19 levels...
from /var/lib/gems/1.9.1/gems/activerecord-3.2.16/lib/active_record/transactions.rb:250:in `transaction'
from /var/www/redmine/app/models/repository/subversion.rb:71:in `block in fetch_changesets'
from /var/www/redmine/app/models/repository/subversion.rb:70:in `reverse_each'
from /var/www/redmine/app/models/repository/subversion.rb:70:in `fetch_changesets'
from /var/www/redmine/app/models/repository.rb:332:in `block (2 levels) in fetch_changesets'
from /var/lib/gems/1.9.1/gems/activerecord-3.2.16/lib/active_record/associations/collection_proxy.rb:91:in `each'
from /var/lib/gems/1.9.1/gems/activerecord-3.2.16/lib/active_record/associations/collection_proxy.rb:91:in `method_missing'
from /var/www/redmine/app/models/repository.rb:330:in `block in fetch_changesets'
from /var/www/redmine/app/models/repository.rb:329:in `each'
from /var/www/redmine/app/models/repository.rb:329:in `fetch_changesets'
from (irb):1
from /var/lib/gems/1.9.1/gems/railties-3.2.16/lib/rails/commands/console.rb:47:in `start'
from /var/lib/gems/1.9.1/gems/railties-3.2.16/lib/rails/commands/console.rb:8:in `start'
from /var/lib/gems/1.9.1/gems/railties-3.2.16/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
</pre><br />And It is about the same problem when using the repository tab inside Redmine ! Should I open a new ticket ? Someone know why I got a NoMethodError: undefined method `created_on' for #<Repository::Subversion:0x000000060d2798> ?</p> Redmine - Defect #15849: Redmine:Fetch_Changesets Single-inheritance issue in subclass "Repository:Git"https://www.redmine.org/issues/15849?journal_id=545432014-01-29T13:37:46ZGregor K
<ul></ul><p>I have the same problem with SNV, please find a fix for this.</p> Redmine - Defect #15849: Redmine:Fetch_Changesets Single-inheritance issue in subclass "Repository:Git"https://www.redmine.org/issues/15849?journal_id=545442014-01-29T13:39:58ZDaniel Felix
<ul></ul><p>Did you run all database migrations? It seems that the column "created_on" is missing.</p> Redmine - Defect #15849: Redmine:Fetch_Changesets Single-inheritance issue in subclass "Repository:Git"https://www.redmine.org/issues/15849?journal_id=545452014-01-29T15:11:16ZFrancois Lachance
<ul><li><strong>File</strong> <a href="/attachments/11061">Defect15849_db_structure.PNG</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/11061/Defect15849_db_structure.PNG">Defect15849_db_structure.PNG</a> added</li></ul><p>You seem to be right (see attached picture of my DB structure surrounding repository.<br />However, this is the list of command I ran to update redmine (Debian 7):<br /><pre>
338 mysql -uroot -pxxxxxxxx redmine_default < /mnt/svnbak/redmine_db_latest.sql
339 history | more
340 cd ..
341 rake db:migrate RAILS_ENV=production
342 ll
343 history | more
344 rake redmine:plugins:migrate RAILS_ENV=production
345 rake db:migrate RAILS_ENV=production
346 history | more
347 rake tmp:cache:clear
348 rake tmp:sessions:clear
349 service apache2 start
</pre></p>
<p>Can you tell me on which table and what is the type of the column "created_on" so I can try to add it manually and try again please;<br />many thanks<br />Francois L</p> Redmine - Defect #15849: Redmine:Fetch_Changesets Single-inheritance issue in subclass "Repository:Git"https://www.redmine.org/issues/15849?journal_id=546172014-02-02T08:20:16ZA B
<ul></ul><p>It appears that <a class="changeset" title="Merged r12273 from trunk to 2.4-stable. Fixed uninitialized constant Redmine::Scm::Adapters::Com..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/12389">r12389</a> was the change that broke this. The following patch partially reverts this and fixes the issue for us (note: this is unlikely to be the real fix, as the <code>CommandFailed</code> class definition is now duplicated, which doesn't bother ruby per se but is ugly nevertheless):<br /><pre>
--- ./lib/redmine/scm/adapters/abstract_adapter.rb.orig 2014-02-02 00:10:30.391088211 -0800
+++ ./lib/redmine/scm/adapters/abstract_adapter.rb 2014-02-02 00:02:16.051390905 -0800
@@ -24,6 +24,9 @@
module Redmine
module Scm
module Adapters
+ class CommandFailed < StandardError #:nodoc:
+ end
+
class AbstractAdapter #:nodoc:
# raised if scm command exited with error, e.g. unknown revision.</pre></p> Redmine - Defect #15849: Redmine:Fetch_Changesets Single-inheritance issue in subclass "Repository:Git"https://www.redmine.org/issues/15849?journal_id=546182014-02-02T08:35:06ZToshi MARUYAMA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/15756">Defect #15756</a>: 500 on admin info/settings page on development environment</i> added</li></ul> Redmine - Defect #15849: Redmine:Fetch_Changesets Single-inheritance issue in subclass "Repository:Git"https://www.redmine.org/issues/15849?journal_id=546202014-02-02T08:42:15ZToshi MARUYAMA
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Target version</strong> set to <i>2.4.3</i></li></ul><p>I have confirmed this error on <a class="version" href="https://www.redmine.org/versions/77">2.4.2</a>.<br />I have confirmed this error was fixed on 2.4-stable by <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: 500 on admin info/settings page on development environment (Closed)" href="https://www.redmine.org/issues/15756">#15756</a>.</p> Redmine - Defect #15849: Redmine:Fetch_Changesets Single-inheritance issue in subclass "Repository:Git"https://www.redmine.org/issues/15849?journal_id=546212014-02-02T08:43:31ZToshi MARUYAMA
<ul><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul>