error when migrating to 1.7
Support Ticket
+issues
Hello! I just upgraded to Wagn 1.7. I pulled the latest version and everything worked good until I did "rake db:migrate RAILS_ENV=production", the migration process was terminated by an error:
- create rule for Admin User+*self, DELETE: [ [Administrator] ]
- create rule for Another Admin User+*self, READ: [ [Anyone Signed In] ]
-- execute("update cards set read_rule_id=903, read_rule_class='*self' where trash is false and id=484")
-> 0.0015s
rake aborted!
An error has occurred, all later migrations was canceled:
FAILURE creating Another Admin User+*self:
#<NoMethodError: undefined method `card' for nil:NilClass>
./db/migrate//20110705033023_permissions_into_settings.rb:189:in `who_could'./db/migrate//20110705033023_permissions_into_settings.rb:103:in `up_without_benchmarks'./db/migrate//20110705033023_permissions_into_settings.rb:101:in `each'./db/migrate//20110705033023_permissions_into_settings.rb:(blablah...)
Is there anything that I have missed? Thank you in advance!
Judging by that error, there appears to be some permissions data integrity issues associated with the "Another Admin User". It appears that there is a permission assigned to a party that doesn't have a card. The log suggests that READ and DELETE are fine, so it must be either COMMENT or EDIT.
The good news is that integrity in the old permissions table shouldn't impact the new permissions system if we manage to get through the migration.
I would suggest that you edit db/migrate/20110705033023_permissions_into_settings.rb and change line 189 from
perm && [perm.party.card.key]
to
perm && perm.party && [perm.party.card.key]
This will make it so that the import skips over any party not associated with a card.
If you really want to investigate further to figure out what the intended permission was, you can open up a console (./script/console) and do something like this:
c = Card.fetch 'Another Admin User'
c.permissions
... and then look at the parties on those permissions to see if you can figure out why they're broken.
Thanks it skips that error. But there is another error while migrating:
- create rule for Contract Negotiation+*self, DELETE: [ [Anyone Signed In] ]
- create rule for Engagement Setup and Management+*self, EDIT: [ [Anyone Signed In] ]
rake aborted!
An error has occurred, all later migrations canceled:
FAILURE creating Engagement Setup and Management+*self:
#<Wagn::Exceptions::Oops: error saving Engagement Setup and Management+*self+*update: end of file reached, /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/protocol.rb:135:in `sysread'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/protocol.rb:135:in `rbuf_fill'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/timeout.rb:62:in `timeout'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/timeout.rb:93 (blablah...)
Why did I encounter so many errors? Is it because I did not follow some rules while creating these cards? Thank you!
--evanyw.....Thu Sep 01 10:20:34 -0700 2011
whoa, that's a weird error. Looks like it timed out for some reason. Do you have some sort of limit set? If you re-run the migration, does it fail at the same place?
I don't know how the data integrity issue got there -- could have something to do with deleting a user or role? Good news is that 1.7.0 drastically reduces the amount of permissions data and stops using the permissions table altogether, so I would expect to see fewer issues in the future.
--Ethan McCutchen.....Thu Sep 01 10:37:18 -0700 2011
...also, this is by far the most involved migration in wagn's history. I hope we don't have to do anything of this magnitude again for a loooooong time !!!
--Ethan McCutchen.....Thu Sep 01 10:38:12 -0700 2011
I've been working on the migration staff for almost 2 hours... The same error happens but not at the same place. It seems the timeout just happens at random place while doing "create rule" for cards. I just repeat this staff "migrate -> error occurs -> restore the database -> migrate..." Hope I can get through this...
--evanyw.....Thu Sep 01 12:27:10 -0700 2011
can you paste a little more of the error message here?
- create rule for Software Architecture Planning+*self, DELETE: [ [Anyone Signed In] ]
rake aborted!
An error has occurred, all later migrations canceled:
FAILURE creating Software Architecture Planning+*self:
#<Wagn::Exceptions::Oops: error saving Software Architecture Planning+*self+*delete: end of file reached, /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/protocol.rb:135:in `sysread'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/protocol.rb:135:in `rbuf_fill'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/timeout.rb:62:in `timeout'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/timeout.rb:93:in `timeout'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/protocol.rb:134:in `rbuf_fill'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/protocol.rb:116:in `readuntil'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/protocol.rb:126:in `readline'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/smtp.rb:911:in `recv_response'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/smtp.rb:897:in `getok'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/smtp.rb:921:in `critical'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/smtp.rb:895:in `getok'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/smtp.rb:889:in `quit'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/smtp.rb:607:in `do_finish'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/smtp.rb:528:in `start'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/actionmailer-2.3.11/lib/action_mailer/base.rb:715:in `perform_delivery_smtp'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/actionmailer-2.3.11/lib/action_mailer/base.rb:556:in `__send__'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/actionmailer-2.3.11/lib/action_mailer/base.rb:556:in `deliver!'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/actionmailer-2.3.11/lib/action_mailer/base.rb:428:in `method_missing'/root/WAGN/modules/notification.rb:20:in `send_notifications'/root/WAGN/modules/notification.rb:18:in `each'/root/WAGN/modules/notification.rb:18:in `send_notifications'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:178:in `send'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:178:in `evaluate_method'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:166:in `call'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:93:in `run'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:92:in `each'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:92:in `send'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:92:in `run'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:276:in `run_callbacks'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/callbacks.rb:344:in `callback'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/callbacks.rb:251:in `create_or_update'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/base.rb:2577:in `save_without_validation'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/validations.rb:1090:in `save_without_dirty'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/dirty.rb:79:in `save_without_transactions'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/transactions.rb:229:in `send'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/transactions.rb:229:in `with_transaction_returning_status'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/transactions.rb:182:in `transaction'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/transactions.rb:196:in `save_without_trash'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/transactions.rb:196:in `save_without_trash'/root/WAGN/app/models/card.rb:113:in `save_without_permissions'/root/WAGN/lib/wagn/model/permissions.rb:53:in `send'/root/WAGN/lib/wagn/model/permissions.rb:53:in `run_checked_save'/root/WAGN/lib/wagn/model/permissions.rb:42:in `save'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/base.rb:727:in `create'./db/migrate//20110705033023_permissions_into_settings.rb:162:in `create_rule'./db/migrate//20110705033023_permissions_into_settings.rb:107:in `up_without_benchmarks'./db/migrate//20110705033023_permissions_into_settings.rb:101:in `each'./db/migrate//20110705033023_permissions_into_settings.rb:101:in `up_without_benchmarks'./db/migrate//20110705033023_permissions_into_settings.rb:98:in `each'./db/migrate//20110705033023_permissions_into_settings.rb:98:in `up_without_benchmarks'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:282:in `send'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:282:in `migrate'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/benchmark.rb:293:in `measure'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:282:in `migrate'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:365:in `__send__'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:365:in `migrate'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:491:in `migrate'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:567:in `call'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:567:in `ddl_transaction'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:490:in `migrate'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:477:in `each'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:477:in `migrate'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:401:in `up'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:383:in `migrate'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/tasks/databases.rake:112/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/monitor.rb:242:in `synchronize'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/bin/rake:32/opt/ruby-enterprise-1.8.7-2010.02/bin/rake:19:in `load'/opt/ruby-enterprise-1.8.7-2010.02/bin/rake:19>
/root/WAGN/lib/wagn/model/permissions.rb:57:in `run_checked_save'/root/WAGN/lib/wagn/model/permissions.rb:42:in `save'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/base.rb:727:in `create'./db/migrate//20110705033023_permissions_into_settings.rb:162:in `create_rule'./db/migrate//20110705033023_permissions_into_settings.rb:107:in `up_without_benchmarks'./db/migrate//20110705033023_permissions_into_settings.rb:101:in `each'./db/migrate//20110705033023_permissions_into_settings.rb:101:in `up_without_benchmarks'./db/migrate//20110705033023_permissions_into_settings.rb:98:in `each'./db/migrate//20110705033023_permissions_into_settings.rb:98:in `up_without_benchmarks'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:282:in `send'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:282:in `migrate'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/benchmark.rb:293:in `measure'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:282:in `migrate'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:365:in `__send__'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:365:in `migrate'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:491:in `migrate'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:567:in `call'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:567:in `ddl_transaction'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:490:in `migrate'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:477:in `each'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:477:in `migrate'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:401:in `up'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:383:in `migrate'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/tasks/databases.rake:112/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/monitor.rb:242:in `synchronize'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/bin/rake:32/opt/ruby-enterprise-1.8.7-2010.02/bin/rake:19:in `load'/opt/ruby-enterprise-1.8.7-2010.02/bin/rake:19
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
maybe that will tell us what is setting the timeout limit. I think if we can just raise it we'll be fine.
The other option would be to break this into multiple migrations; definitely more work.
For what it's worth, you probably don't have to restore the database every time; usually migrations roll back transactions when they fail. You can confirm this by counting the cards before and after the run.
select count(*) from cards.
--Ethan McCutchen.....Thu Sep 01 12:37:31 -0700 2011
Thanks! I have posted all the error messages from the console.
I tried to migrate without restoring after an error occured but it raised another error that terminated the migration...
--evanyw.....Thu Sep 01 12:45:36 -0700 2011
wow, this is a huge pain!
OK, it looks like that new error has to do with notifications. We should turn them off for the migration. Try changing line 4 of modules/notification.rb to this:
return false if Card.record_userstamps==false || ENV['MIGRATE_PERMISSIONS'] == 'true'
--Ethan McCutchen.....Thu Sep 01 12:53:07 -0700 2011
actually, if your mail server is acting up, that could explain the timeout issue, too.
--Ethan McCutchen.....Thu Sep 01 12:53:49 -0700 2011
There are actually 2 types of error. One is the "error saving ...", and the other is the one I just updated (timeout issue).
--evanyw.....Thu Sep 01 12:58:07 -0700 2011
OK. That works and now I am facing the last problem (I hope :D ) I've tried 4 times and the following error happens every time.
successfully updated read rules for 295 cards
== GenerateReadRules: migrated (18.8646s) ====================================
== PermissionSettingsDetails: migrating ======================================
rake aborted!
An error has occurred, all later migrations canceled:
error saving *create+*right+*options: could not get 3xx (550), /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/smtp.rb:936:in `check_continue'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/smtp.rb:876:in `data'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/smtp.rb:921:in `critical'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/smtp.rb:875:in `data'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/smtp.rb:655:in `sendmail'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/actionmailer-2.3.11/lib/action_mailer/base.rb:717:in `perform_delivery_smtp'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/net/smtp.rb:526:in `start'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/actionmailer-2.3.11/lib/action_mailer/base.rb:715:in `perform_delivery_smtp'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/actionmailer-2.3.11/lib/action_mailer/base.rb:556:in `__send__'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/actionmailer-2.3.11/lib/action_mailer/base.rb:556:in `deliver!'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/actionmailer-2.3.11/lib/action_mailer/base.rb:428:in `method_missing'/root/WAGN/modules/notification.rb:20:in `send_notifications'/root/WAGN/modules/notification.rb:18:in `each'/root/WAGN/modules/notification.rb:18:in `send_notifications'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:178:in `send'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:178:in `evaluate_method'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:166:in `call'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:93:in `run'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:92:in `each'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:92:in `send'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:92:in `run'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/callbacks.rb:276:in `run_callbacks'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/callbacks.rb:344:in `callback'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/callbacks.rb:251:in `create_or_update'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/base.rb:2577:in `save_without_validation'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/validations.rb:1090:in `save_without_dirty'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/dirty.rb:79:in `save_without_transactions'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/transactions.rb:229:in `send'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/transactions.rb:229:in `with_transaction_returning_status'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/transactions.rb:182:in `transaction'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/transactions.rb:196:in `save_without_trash'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/transactions.rb:196:in `save_without_trash'/root/WAGN/app/models/card.rb:113:in `save_without_permissions'/root/WAGN/lib/wagn/model/permissions.rb:53:in `send'/root/WAGN/lib/wagn/model/permissions.rb:53:in `run_checked_save'/root/WAGN/lib/wagn/model/permissions.rb:42:in `save'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/base.rb:727:in `create'/root/WAGN/lib/wagn/model/fetch.rb:52:in `fetch_or_create'./db/migrate//20110720160456_permission_settings_details.rb:15:in `up_without_benchmarks'./db/migrate//20110720160456_permission_settings_details.rb:12:in `each'./db/migrate//20110720160456_permission_settings_details.rb:12:in `up_without_benchmarks'/root/WAGN/app/models/user.rb:49:in `as'./db/migrate//20110720160456_permission_settings_details.rb:3:in `up_without_benchmarks'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:282:in `send'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:282:in `migrate'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/benchmark.rb:293:in `measure'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:282:in `migrate'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:365:in `__send__'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:365:in `migrate'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:491:in `migrate'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:567:in `call'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:567:in `ddl_transaction'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:490:in `migrate'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:477:in `each'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:477:in `migrate'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:401:in `up'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/migration.rb:383:in `migrate'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/tasks/databases.rake:112/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/1.8/monitor.rb:242:in `synchronize'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/rake-0.9.2/bin/rake:32/opt/ruby-enterprise-1.8.7-2010.02/bin/rake:19:in `load'/opt/ruby-enterprise-1.8.7-2010.02/bin/rake:19
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
--evanyw.....Thu Sep 01 13:05:34 -0700 2011
Nice! The main part of the migration completed successfully. There are 4 more minor migrations, each of them DRAMATICALLY simpler.
This error is, again, a notifications issue. What mailer are you using? I'm now wondering if it started shooting you down because wagn was sending out so many notifications with the migrations. I'm guessing you're "watching" lots of cards on the site?
If you could switch your configuration to a dummy mailer for now it might fix the migration. But I'm guessing you'll need to get the mailer working again at some point, no?
--Ethan McCutchen.....Thu Sep 01 13:34:30 -0700 2011
I just use ActionMailer. I registered an account from Gmail and use that mail to sent out all the notifications. I guess the problem is Wagn send so many emails using that gmail account in a short period that google disabled that account?
--evanyw.....Thu Sep 01 14:27:13 -0700 2011
Ahhh! I just tried to log into that account and send testing email. Gmail said: You have reached a limit for sending mail... Too baad. I understand the cause of the problem and will switch another email account. I really appreciate your timely help! Thank you!
--evanyw.....Thu Sep 01 14:32:07 -0700 2011
Oh, good! Sorry about the email limit; I had intended to turn that off in the migration before. We should probably find a way to turn it off automatically for all migrations.
-e
--Ethan McCutchen.....Thu Sep 01 14:36:48 -0700 2011