When trying to start heroku run rake db:migrate , the following error appears. I tried heroku pg:reset , I tried heroku restart . I also tried to create a new application and start with it, but the problem persists. What could be the problem here?
Running `rake db:migrate` attached to terminal... up, run.7662 Migrating to CreateChannels (20140424224543) == CreateChannels: migrating ================================================= -- create_table(:channels) PG::DataCorrupted: ERROR: could not read block 0 in file "base/57396/12684": read only 0 of 8192 bytes : CREATE TABLE "channels" ("id" serial primary key, "name" character varying(255), "user_id" integer, "created_at" timestamp, "updated_at" timestamp) rake aborted! StandardError: An error has occurred, this and all later migrations canceled: PG::DataCorrupted: ERROR: could not read block 0 in file "base/57396/12684": read only 0 of 8192 bytes : CREATE TABLE "channels" ("id" serial primary key, "name" character varying(255), "user_id" integer, "created_at" timestamp, "updated_at" timestamp) /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `async_exec' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `block in execute' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract_adapter.rb:435:in `block in log' /app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/notifications/instrumenter.rb:20:in `instrument' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract_adapter.rb:430:in `log' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/postgresql/database_statements.rb:127:in `execute' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/schema_statements.rb:190:in `create_table' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:625:in `block in method_missing' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:597:in `block in say_with_time' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:597:in `say_with_time' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:617:in `method_missing' /app/db/migrate/20140424224543_create_channels.rb:3:in `change' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:571:in `exec_migration' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:555:in `block (2 levels) in migrate' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:554:in `block in migrate' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `with_connection' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:553:in `migrate' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:709:in `migrate' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:959:in `block in execute_migration_in_transaction' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:1005:in `block in ddl_transaction' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:202:in `block in transaction' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:210:in `within_new_transaction' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:202:in `transaction' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/transactions.rb:209:in `transaction' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:1005:in `ddl_transaction' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:958:in `execute_migration_in_transaction' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:920:in `block in migrate' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:916:in `each' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:916:in `migrate' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:764:in `up' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/migration.rb:742:in `migrate' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/railties/databases.rake:42:in `block (2 levels) in <top (required)>' Tasks: TOP => db:migrate (See full trace by running task with --trace)
[Edit] My migration file for creating the channel table is as follows (nothing unusual)
class CreateChannels < ActiveRecord::Migration def change create_table :channels do |t| t.string :name t.integer :user_id t.timestamps end end end
source share