Forum: Ruby on Rails Migration failed "Mysql2::Error: Incorrect key file for table"

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Aaf3ac3153463037989622a084329ce2?d=identicon&s=25 Mendel (Guest)
on 2016-05-17 00:07
(Received via mailing list)
Hello,

I am trying to run a migration on a db that has about 100K records. When
I
run the migration I get this error

== 20160503165700 AddDetailsToTransactions: migrating
=========================
-- add_column(:transactions, :invoice_number, :string)
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

Mysql2::Error: Incorrect key file for table 'transactions'; try to
repair it
: ALTER TABLE `transactions` ADD `invoice_number`
varchar(255)/home/......./
gems/activerecord-4.1.7/lib/active_record/connection_adapters/
abstract_mysql_adapter.rb:303:in `query'
/home/deploy/.rvm/gems/ruby-2.1.4@terga/gems/activerecord-4.
1.7/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:303:in
`block
in execute'
/home/deploy/.rvm/gems/ruby-2.1.4@terga/gems/activerecord-4.
1.7/lib/active_record/connection_adapters/abstract_adapter.rb:373:in
`block
in log'
/home/deploy/.rvm/gems/ruby-2.1.4@terga/gems/activesupport-4.1.7/lib/
active_support/notifications/instrumenter.rb:20:in `instrument'
/home/deploy/.rvm/gems/ruby-2.1.4@terga/gems/activerecord-4.
1.7/lib/active_record/connection_adapters/abstract_adapter.rb:367:in
`log'
/home/deploy/.rvm/gems/ruby-2.1.4@terga/gems/activerecord-4.
1.7/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:303:in
`execute'
/home/deploy/.rvm/gems/ruby-2.1.4@terga/gems/activerecord-4.1.7/lib/
active_record/connection_adapters/mysql2_adapter.rb:228:in `execute'
/home/deploy/.rvm/gems/ruby-2.1.4@terga/gems/activerecord-4.
1.7/lib/active_record/connection_adapters/abstract/schema_statements.rb:375:in
`add_column'
/home/deploy/.rvm/gems/ruby-2.1.4@terga/gems/activerecord-4.
1.7/lib/active_record/migration.rb:649:in `block in method_missing'
/home/deploy/.rvm/gems/ruby-2.1.4@terga/gems/activerecord-4.1.7/lib/
active_record/migration.rb:621:in `block in say_with_time'
/home/deploy/.rvm/gems/ruby-2.1.4@terga/gems/activerecord-4.
1.7/lib/active_record/migration.rb:621:in `say_with_time'
/home/deploy/.rvm/gems/ruby-2.1.4@terga/gems/activerecord-4.
1.7/lib/active_record/migration.rb:641:in `method_missing'
/var/www/........../db/migrate/20160503165700_add_details_to_transactions.rb
:3:in `change'

I thought at first it was a memory issue and spun up a larger server but
it
still failed.

Cheers,

Mendel
This topic is locked and can not be replied to.