New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined method `container_type' for #<DmsfFile:0x0000000485cd08> Redmine_dmsf 1.5.9 #975
Comments
@ausghostdog Same issue here. We are migrating to a new server, and wont use the plugin anymore. Did you manage to uninstall it? |
As you mentioned, there used to be a bug which is fixed in later version. So you can either upgrade to v1.6.0 prior the plugin uninstalling or do a manual uninstallation as follows:
|
delete from schema_migrations where version like '%redmine_dmsf%'; |
No idea if this may have broken something, will need to do testing but the following allowed it to work I am going to test everything I can but 2.0 is now installed |
The dropping of two more columns was correct. |
Not sure if this is a setting that is missing or something I may have done, but the new version, uploading documents is placing them redmine/current/files/dmsf/2019/03, no matter which project they are uploaded under. The old version we had installed when a file was uploaded a project folder was created and file placed there. I have moved all the files from the other server to the new server and made sure they have the same permissions, any thoughts? |
Thanks, I ran the script for Linux in #767, it has moved all the files. :/opt/redmine/current/files/dmsf/2017/06$ ls -la I also restarted the Apache server but the projects still do not have files? I also ran bundle exec rake redmine:plugins:migrate RAILS_ENV="production" |
If you had deleted all the database, it's empty now. If you had some documents you had to keep the database and do the upgrade. So restore your backed up database an re-run the migration. |
OK, given the database was created with version 1.5.9, and we are running 2.0 now. Could I restore just the dmsf tables and columns? From the backup. Would that cause any issues given the 1.5.9 database would be copied over the top of the 2.0 tables already present? So the tables and columns to restore would be rerun migration? |
yes |
Hey, Any idea how to run a migrate while ignoring tables that already exist? |
Just run the migration from the point you need. You can control it with version parameter. Or. modify the version table in the database. |
@picman I have finished this project now, we are running Redmine 4.0 with the latest DMSF, file migration and everything worked like a charm. Thanks for all your help. |
Hi,
In the process of upgrading to Redmine to 4.0, I thought I would uninstall DMSF before the upgrade, I have since come to understand it is not require and I can simply delete the DMSF folder and copy the redmine_dmsf-devel-2.0.0 files to the plugin directory following the upgrade process.
However, prior to finding the upgrading information I tried uninstalling the plugin using the following method
I understand that 1.5 had a bug that was fixed in 1.6 detailed here 9d4c57a
Which I fixed in the code,
When I ran the rake redmine:plugins:migrate NAME=redmine_dmsf VERSION=0 RAILS_ENV=production --trace
The folllowing in produced, looking for information on what caused it? As I stated, I am simply going to delete the files following the upgrade path this is more for an understanding of the issue.
@-virtual-machine:/opt/redmine/current$ rake redmine:plugins:migrate NAME=redmine_dmsf VERSION=0 RAILS_ENV=production --trace
** Invoke redmine:plugins:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:plugins:migrate
Migrating redmine_dmsf (DMSF)...
== 20170217141601 AddDmsfNotInheritableToCustomFields: reverting ==============
-- remove_column(:custom_fields, :dmsf_not_inheritable)
-> 0.0620s
== 20170217141601 AddDmsfNotInheritableToCustomFields: reverted (0.0624s) =====
== 20170214153223 AddDmsfFileLastRevisionIdToDmsfLock: reverting ==============
-- rename_column(:dmsf_locks, :dmsf_file_last_revision_id, :revision)
-> 0.0565s
== 20170214153223 AddDmsfFileLastRevisionIdToDmsfLock: reverted (0.0570s) =====
== 20170204214753 AddRevisionToDmsfLock: reverting ============================
-- remove_column(:dmsf_locks, :revision)
-> 0.0446s
== 20170204214753 AddRevisionToDmsfLock: reverted (0.0451s) ===================
== 20170118142001 DmsfFileContainer: reverting ================================
-- remove_index(:dmsf_files, [:container_id, :container_type])
-> 0.0314s
-- remove_column(:dmsf_files, :container_type)
-> 0.1047s
-- rename_column(:dmsf_files, :container_id, :project_id)
-> 0.0800s
-- add_index(:dmsf_files, :project_id)
-> 0.0422s
== 20170118142001 DmsfFileContainer: reverted (0.2593s) =======================
== 20170103164701 AddNameToAppovalWorkflowStep: reverting =====================
-- remove_column(:dmsf_workflow_steps, :name)
-> 0.0253s
== 20170103164701 AddNameToAppovalWorkflowStep: reverted (0.0256s) ============
== 20161223133200 CreateDmsfPublicUrls: reverting =============================
-- remove_index(:dmsf_public_urls, {:column=>:token})
-> 0.0156s
-- drop_table(:dmsf_public_urls)
-> 0.0077s
== 20161223133200 CreateDmsfPublicUrls: reverted (0.1862s) ====================
== 20160421150501 AddDigestToRevision: reverting ==============================
-- remove_column(:dmsf_file_revisions, :digest)
-> 0.2407s
== 20160421150501 AddDigestToRevision: reverted (0.2409s) =====================
== 20160222140401 ApprovalWorkflowStdFields: reverting ========================
-- remove_column(:dmsf_workflows, :updated_on)
-> 0.0238s
-- remove_column(:dmsf_workflows, :created_on)
-> 0.0232s
-- remove_column(:dmsf_workflows, :author_id)
-> 0.0236s
== 20160222140401 ApprovalWorkflowStdFields: reverted (0.0711s) ===============
== 20160217133001 StatusDeleted: reverting ====================================
-- change_column(:dmsf_folders, :deleted, :boolean, {:null=>false, :default=>false})
-> 0.0376s
-- change_column(:dmsf_files, :deleted, :boolean, {:null=>false, :default=>false})
-> 0.0724s
-- change_column(:dmsf_file_revisions, :deleted, :boolean, {:null=>false, :default=>false})
-> 0.1053s
-- change_column(:dmsf_links, :deleted, :boolean, {:null=>false, :default=>false})
-> 0.0269s
== 20160217133001 StatusDeleted: reverted (0.2430s) ===========================
== 20160215125801 ApprovalWorkflowStatus: reverting ===========================
-- remove_column(:dmsf_workflows, :status)
-> 0.0218s
== 20160215125801 ApprovalWorkflowStatus: reverted (0.0223s) ==================
== 20151209100001 TitleFormat: reverting ======================================
-- remove_column(:members, :title_format)
-> 0.0741s
== 20151209100001 TitleFormat: reverted (0.0744s) =============================
== 20151020141801 LargeFiles: reverting =======================================
-- change_column(:dmsf_file_revisions, :size, :int, {:null=>true})
-> 0.1139s
== 20151020141801 LargeFiles: reverted (0.1142s) ==============================
== 20150910153701 TitleNotNull: reverting =====================================
-- change_column(:dmsf_file_revisions, :title, :string, {:null=>true})
-> 0.2228s
== 20150910153701 TitleNotNull: reverted (0.2231s) ============================
== 20150202010301 AddUserToLinks: reverting ===================================
-- remove_column(:dmsf_links, :user_id)
-> 0.0234s
== 20150202010301 AddUserToLinks: reverted (0.0237s) ==========================
== 20150130052716 AddExternal: reverting ======================================
-- remove_column(:dmsf_links, :external_url)
-> 0.0253s
== 20150130052716 AddExternal: reverted (0.0255s) =============================
== 20150120152101 NotificationsNullable: reverting ============================
== 20150120152101 NotificationsNullable: reverted (0.0000s) ===================
== 20141205143001 RemoveUniquenessFromWf: reverting ===========================
== 20141205143001 RemoveUniquenessFromWf: reverted (0.0000s) ==================
== 20141015132701 RemoveFolderFromRevision: reverting =========================
-- add_column(:dmsf_file_revisions, :dmsf_folder_id, :integer, {:null=>true})
-> 0.2900s
rake aborted!
StandardError: An error has occurred, all later migrations canceled:
undefined method
'container_type' for #<DmsfFile:0x0000000485cd08> /home//.rvm/gems/ruby-2.0.0-p643/gems/activemodel-4.2.7.1/lib/active_model/attribute_methods.rb:433:in
method_missing'/opt/redmine/current/plugins/redmine_dmsf/app/models/dmsf_file.rb:525:in
propfind_cache_key' /opt/redmine/current/plugins/redmine_dmsf/app/models/dmsf_file_revision.rb:311:in
propfind_cache_key'/opt/redmine/current/plugins/redmine_dmsf/app/models/dmsf_file_revision.rb:301:in
save' /opt/redmine/current/plugins/redmine_dmsf/db/migrate/20141015132701_remove_folder_from_revision.rb:32:in
block in down'/home//.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.7.1/lib/active_record/relation/batches.rb:51:in
block (2 levels) in find_each' /home//.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.7.1/lib/active_record/relation/batches.rb:51:in
each'/home//.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.7.1/lib/active_record/relation/batches.rb:51:in
block in find_each' /home//.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.7.1/lib/active_record/relation/batches.rb:124:in
find_in_batches'/home//.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.7.1/lib/active_record/relation/batches.rb:50:in
find_each' /home//.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.7.1/lib/active_record/querying.rb:9:in
find_each'/opt/redmine/current/plugins/redmine_dmsf/db/migrate/20141015132701_remove_folder_from_revision.rb:29:in
down' /home//.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:611:in
exec_migration'/home//.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:592:in
block (2 levels) in migrate' /home//.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/benchmark.rb:281:in
measure'/home//.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:591:in
block in migrate' /home//.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in
with_connection'/home//.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:590:in
migrate' /home//.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:768:in
migrate'/home//.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:998:in
block in execute_migration_in_transaction' /home//.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:1046:in
ddl_transaction'/home//.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:997:in
execute_migration_in_transaction' /home//.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:959:in
block in migrate'/home//.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:955:in
each' /home//.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:955:in
migrate'/home//.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:830:in
down' /home//.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:805:in
migrate'/opt/redmine/current/lib/redmine/plugin.rb:481:in
migrate_plugin' /opt/redmine/current/lib/redmine/plugin.rb:453:in
migrate'/opt/redmine/current/lib/redmine/plugin.rb:464:in
migrate' /opt/redmine/current/lib/tasks/redmine.rake:127:in
block (3 levels) in <top (required)>'/home//.rvm/gems/ruby-2.0.0-p643/gems/rake-12.0.0/lib/rake/task.rb:250:in
call' /home//.rvm/gems/ruby-2.0.0-p643/gems/rake-12.0.0/lib/rake/task.rb:250:in
block in execute'/home//.rvm/gems/ruby-2.0.0-p643/gems/rake-12.0.0/lib/rake/task.rb:250:in
each' /home//.rvm/gems/ruby-2.0.0-p643/gems/rake-12.0.0/lib/rake/task.rb:250:in
execute'/home//.rvm/gems/ruby-2.0.0-p643/gems/rake-12.0.0/lib/rake/task.rb:194:in
block in invoke_with_call_chain' /home//.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/monitor.rb:211:in
mon_synchronize'/home//.rvm/gems/ruby-2.0.0-p643/gems/rake-12.0.0/lib/rake/task.rb:187:in
invoke_with_call_chain' /home//.rvm/gems/ruby-2.0.0-p643/gems/rake-12.0.0/lib/rake/task.rb:180:in
invoke'/home//.rvm/gems/ruby-2.0.0-p643/gems/rake-12.0.0/lib/rake/application.rb:152:in
invoke_task' /home//.rvm/gems/ruby-2.0.0-p643/gems/rake-12.0.0/lib/rake/application.rb:108:in
block (2 levels) in top_level'/home//.rvm/gems/ruby-2.0.0-p643/gems/rake-12.0.0/lib/rake/application.rb:108:in
each' /home//.rvm/gems/ruby-2.0.0-p643/gems/rake-12.0.0/lib/rake/application.rb:108:in
block in top_level'/home//.rvm/gems/ruby-2.0.0-p643/gems/rake-12.0.0/lib/rake/application.rb:117:in
run_with_threads' /home//.rvm/gems/ruby-2.0.0-p643/gems/rake-12.0.0/lib/rake/application.rb:102:in
top_level'/home//.rvm/gems/ruby-2.0.0-p643/gems/rake-12.0.0/lib/rake/application.rb:80:in
block in run' /home//.rvm/gems/ruby-2.0.0-p643/gems/rake-12.0.0/lib/rake/application.rb:178:in
standard_exception_handling'/home//.rvm/gems/ruby-2.0.0-p643/gems/rake-12.0.0/lib/rake/application.rb:77:in
run' /home//.rvm/gems/ruby-2.0.0-p643/gems/rake-12.0.0/exe/rake:27:in
<top (required)>'/home//.rvm/gems/ruby-2.0.0-p643/bin/rake:23:in
load' /home//.rvm/gems/ruby-2.0.0-p643/bin/rake:23:in
/home//.rvm/gems/ruby-2.0.0-p643/bin/ruby_executable_hooks:15:in
eval' /home//.rvm/gems/ruby-2.0.0-p643/bin/ruby_executable_hooks:15:in
'Tasks: TOP => redmine:plugins:migrate
@-virtual-machine:/opt/redmine/current$
The text was updated successfully, but these errors were encountered: