2012-04-30 73 views
0

我想在我的Heroku應用程序執行以下命令拋出異常:Heroku的DB:推在操作過程中

heroku db:push postgres://username:[email protected]:5432/db_name 

我成功使用了相同的命令有很多次在過去三年幾個月,但今天它停止工作。它似乎只要達到5MB的大小就停止工作(現在它大約爲8MB)。問題是我現在開始爲共享數據庫付錢,所以我應該被允許擁有20GB的空間。

這是命令輸出:

> heroku db:push postgres://username:[email protected]:5432/db_name --account java 
Loaded Taps v0.3.23 
Warning: Data in the app 'my-test-app' will be overwritten and will not be recoverable. 

! WARNING: Potentially Destructive Action 
! This command will affect the app: my-test-app 
! To proceed, type "my-test-app" or re-run this command with --confirm my-test-app 

> my-test-app 
Sending schema 
Schema:  100% |==========================================| Time: 00:00:46 
Sending indexes 
test_gift_rec: 100% |==========================================| Time: 00:00:01 
test_person: 100% |==========================================| Time: 00:00:01 
Sending data 
14 tables, 114 records 
test_bonus_aw: 100% |==========================================| Time: 00:00:00 
test_money_tr: 100% |==========================================| Time: 00:00:00 
test_friendsh: 100% |==========================================| Time: 00:00:00 
test_friendsh: 100% |==========================================| Time: 00:00:00 
test_gift_rec: 100% |==========================================| Time: 00:00:00 
test_group: 100% |==========================================| Time: 00:00:00 
test_country: 100% |==========================================| Time: 00:00:00 
test_user_is_: 100% |==========================================| Time: 00:00:00 
test_gift:  100% |==========================================| Time: 00:00:00 
test_user_has: 0% |           | ETA: --:--:-- 
Saving session to push_201204301144.dat.. 
!!! Caught Server Exception 
HTTP CODE: 500 
Taps Server Error: undefined method `symbolize_keys' for nil:NilClass 
["/app/lib/taps/data_stream.rb:183:in `parse_json'", "/app/lib/taps/server.rb:89:in `block in <class:Server>'","/app/.bundle/gems/ruby/1.9.1/gems/satra-1.0/lib/sinatra/base.rb:865:in `call'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra1.0/lib/sinatra/base.rb:865:in `block in route'", "/app/.bune/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `instance_eval'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:5:in `route_eval'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:500:in `block (2 levels) in route!'", "/app/.bundle/gems/ruby/9.1/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `catch'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `block in route!, "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `each'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/baseb:476:in `route!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:601:in `dispatch!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinat-1.0/lib/sinatra/base.rb:411:in `block in call!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `instance_eval'", "/appbundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `block in invoke'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/ba.rb:566:in `catch'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `invoke'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra.0/lib/sinatra/base.rb:411:in `call!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:399:in `call'", "/app/.bundle/gems/ruby/1.1/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `block in call'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:1005:in `synchroze'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `call'", "/home/heroku_rack/lib/static_assets.rb:9:in `call'", "/homheroku_rack/lib/last_access.rb:15:in `call'", "/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/urlmap.rb:47:in `block in call'", "/app/.bundleems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/urlmap.rb:41:in `each'", "/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/urlmap.rb:41:in `call'", "/he/heroku_rack/lib/date_header.rb:14:in `call'", "/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:77:in `call'", "/app/.bundle/gems/by/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:76:in `block in pre_process'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb::in `catch'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:74:in `pre_process'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2/lib/thin/connection.rb:57:in `process'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:42:in `receive_data'","/app/.bundle/ms/ruby/1.9.1/gems/eventmachine0.12.10/lib/eventmachine.rb:256:in`run_machine'","/app/.bundle/gems/ruby/1.9.1/gems/eventmachine0.12.10/lib/eventchine.rb:256:in `run'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/backends/base.rb:57:in `start'", "/app/.bundle/gems/ruby/1.9.1/gems/tn-1.2.7/lib/thin/server.rb:156:in `start'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/controllers/controller.rb:80:in `start'", "/app/.ndle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/runner.rb:177:in `run_command'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/runner.rb:143: `run!'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/bin/thin:6:in `<top (required)>'", "/app/.bundle/gems/ruby/1.9.1/bin/thin:19:in `load'", "https://stackoverflow.com/a/.bundle/gems/ruby/1.9.1/bin/thin:19:in `<main>'"] 

運行在Windows 7

請幫幫忙!

回答

0

如果您不更改本地和生產之間的數據庫,可以嘗試使用pgbackups插件。

它比db:push/db:pull更可靠,通常也更快。

https://devcenter.heroku.com/articles/pgbackups

+0

對,謝謝你,@JohnBeynon。它解決了我的問題!問題是這只是一個解決方法,你認爲我原來的問題是由於Heroku的bug嗎? – satoshi

+0

db:推送功能是通過不由Heroku管理的TAPS gem--它可能與你的數據庫中的一個流氓字符一樣簡單,Taps無法閱讀。它每次都做同樣的事情嗎?這可能只是一個小故障。 –

+0

有兩個特定的表在push中有問題。如果我用參數'--exclude table1,table2'推入DB,然後分別推送這兩個表(' - table table1'和'--tables table2 '),它工作正常。我想這是一個TAPS錯誤,然後...... – satoshi