6

heroku run rake db:migrate चलाने की कोशिश करते समय मुझे निम्न त्रुटि मिल रही है। मैंने heroku pg:reset की कोशिश की है, मैंने heroku restart को आजमाया है। मैंने एक नया ऐप बनाने और शुरू करने का भी प्रयास किया, लेकिन समस्या बनी हुई है। यहां क्या समस्या हो सकती थी?हेरोकू पीजी माइग्रेशन त्रुटि "पीजी: डेटा क्रॉस्ड: त्रुटि"

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) 

चैनलों तालिका ऐसा दिखाई देता है (कुछ भी नहीं साधारण से बाहर)

class CreateChannels < ActiveRecord::Migration 
    def change 
     create_table :channels do |t| 
     t.string :name 
     t.integer :user_id 

     t.timestamps 
     end 
    end 
    end 
+5

उसकेोकू के साथ सिस्टम समस्या की तरह दिखता है ... (मुझे यह भी मिल रहा है - 45 मिनट बाद और @ योंग) – cwd

+1

मुझे यह भी अनुभव हो रहा है ... – Darbs

+4

ओह प्रिय। तत्काल से Heroku समर्थन से संपर्क करें। सुनिश्चित करें कि आप किसी अनुयायियों को बंद नहीं करते हैं, और आपके पास बैकअप रोटेशन को रोकें ताकि आप पुराने बैकअप को न छोड़ें। उन्हें अपने डेटाबेस के फाइल सिस्टम स्तर बैकअप लेने के लिए प्राप्त करें। यह दृढ़ता से संभावित डेटा भ्रष्टाचार का सुझाव देता है। आप क्या सटीक PostgreSQL संस्करण चल रहे हैं? यह पहली बार कब हुआ? –

उत्तर

3

मैं एक ही मुद्दा था बनाने के लिए मेरे प्रवास फ़ाइल, मैं https://dashboard.heroku.com/apps से डेटाबेस हटा दिया (यह [संपादित करें] गया था नौसेना) एक नया पीजी डाटाबेस जोड़ा गया (इस नीला था)

From the terminal ran: 
heroku config 

You should see your db url 
heroku config:set DATABASE_URL=postgres://your-db-url 

Ran 
heroku run rake db:migrate 

और सब कुछ काम किया। मुझे अभी भी यकीन नहीं है कि ऐसा क्यों हुआ!

-1

अब मुझे एक ही समस्या है। मेरे पास कोई उत्पादन डेटा नहीं था इसलिए बस एक नया डेटाबेस स्थापित किया जाएगा। बहुत कष्टप्रद हालांकि

संपादित करें: बस में ही तय हो गई है जब मैं फिर से माइग्रेशन

संपादित 2 भाग गया: अभी भी टूटी हुई है। जब मैं अपने दूसरे माइग्रेशन फ़ाइल को चलाने की कोशिश की मैं त्रुटि

PG::DataCorrupted: ERROR: could not read block 1 in file "base/117039/12684": read only 0 of 8192 bytes 

बहुत कष्टप्रद

मिल बस Heroku पर टिकट फ़ाइल की कोशिश की। जानकारी के भार के साथ फॉर्म भर दिया और केवल एक संदेश प्राप्त करने के लिए सबमिट किया कि मैंने कोई समर्थन टिकट नहीं बनाया है!

1

मैंने कल रात उसकीोकू समर्थन टीम से संपर्क किया, मुझे एक ही समस्या थी, सब कुछ सामान्य हो गया है। भाई उनकी प्रतिक्रिया है।

दुर्भाग्य से, ऐसा लगता है कि वहाँ अपने डेटाबेस कल रात जो कुछ घंटों के लिए एक आउटेज की वजह से साथ एक मुद्दा था, लेकिन यह के बाद से हमारी ऑन-कॉल डेटाबेस इंजीनियरों में से एक द्वारा बरामद किया गया है। यह समस्या आपके कारण नहीं थी, यह होस्ट सर्वर पर हार्डवेयर विफलता थी।

उम्मीद है कि इससे मदद मिलती है।

संबंधित मुद्दे