簡體   English   中英

Heroku無法推送數據庫:Taps Server錯誤:PGError:錯誤:

[英]Heroku failed to push database: Taps Server Error: PGError: ERROR:

我的MySQL數據庫無法推送到Herokus postgreSQL datbase。 我已經安裝了水龍頭。

當我嘗試將數據庫推送到heroku時,這是我的錯誤消息:

pc@pc-PC /c/rails/funanew (master)
$ heroku db:push mysql://root:der@localhost/funew
Loaded Taps v0.3.23
Warning: Data in the app 'funa' will be overwritten and will not be recoverable.

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

> funa
Sending schema
Schema:        100% |==========================================| Time: 00:00:22
Sending indexes
Sending data
4 tables, 26 records
movielimits:   100% |==========================================| Time: 00:00:00
photographers:  27% |===========                               | ETA:  00:00:22
Saving session to push_201110142326.dat..
!!! Caught Server Exception
HTTP CODE: 500
Taps Server Error: PGError: ERROR:  invalid byte sequence for encoding "UTF8": 0
xd872
HINT:  This error can also happen if the byte sequence does not match the encodi
ng expected by the server, which is controlled by "client_encoding".

["/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/postgres.r
b:175:in `async_exec'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/seq
uel/adapters/postgres.rb:175:in `block (2 levels) in execute'", "/app/.bundle/ge
ms/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/logging.rb:28:in `log_yield
'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/postgre
s.rb:175:in `block in execute'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.
0/lib/sequel/adapters/postgres.rb:158:in `check_disconnect_errors'", "/app/.bund
le/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/postgres.rb:175:in `ex
ecute'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/po
stgres.rb:240:in `block (2 levels) in execute'", "/app/.bundle/gems/ruby/1.9.1/g
ems/sequel-3.20.0/lib/sequel/connection_pool/threaded.rb:71:in `hold'", "/app/.b
undle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/connecting.rb:226:i
n `synchronize'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/ad
apters/postgres.rb:240:in `block in execute'", "/app/.bundle/gems/ruby/1.9.1/gem
s/sequel-3.20.0/lib/sequel/adapters/postgres.rb:261:in `check_database_errors'",
 "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/adapters/postgres.r
b:238:in `execute'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel
/database/query.rb:71:in `execute_dui'", "/app/.bundle/gems/ruby/1.9.1/gems/sequ
el-3.20.0/lib/sequel/dataset/actions.rb:552:in `execute_dui'", "/app/.bundle/gem
s/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/dataset/actions.rb:243:in `block (2 l
evels) in import'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/
dataset/actions.rb:243:in `each'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.2
0.0/lib/sequel/dataset/actions.rb:243:in `block in import'", "/app/.bundle/gems/
ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/query.rb:223:in `_transaction'
", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/query.rb
:209:in `block in transaction'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.
0/lib/sequel/connection_pool/threaded.rb:84:in `hold'", "/app/.bundle/gems/ruby/
1.9.1/gems/sequel-3.20.0/lib/sequel/database/connecting.rb:226:in `synchronize'"
, "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/database/query.rb:
207:in `transaction'", "/app/.bundle/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequ
el/dataset/actions.rb:243:in `import'", "/app/lib/taps/data_stream.rb:315:in `im
port_rows'", "/app/lib/taps/data_stream.rb:158:in `fetch_remote_in_server'", "/a
pp/lib/taps/server.rb:94:in `block (3 levels) in <class:Server>'", "/app/lib/tap
s/utils.rb:161:in `call'", "/app/lib/taps/utils.rb:161:in `server_error_handling
'", "/app/lib/taps/server.rb:92:in `block (2 levels) in <class:Server>'", "/app/
lib/taps/db_session.rb:15:in `block in conn'", "/app/.bundle/gems/ruby/1.9.1/gem
s/sequel-3.20.0/lib/sequel/database/connecting.rb:76:in `connect'", "/app/.bundl
e/gems/ruby/1.9.1/gems/sequel-3.20.0/lib/sequel/core.rb:119:in `connect'", "/app
/lib/taps/db_session.rb:14:in `conn'", "/app/lib/taps/server.rb:91:in `block in
<class:Server>'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/bas
e.rb:865:in `call'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/
base.rb:865:in `block in route'", "/app/.bundle/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:521: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/1.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 `b
lock in route!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/bas
e.rb:476:in `each'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/
base.rb:476:in `route!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sin
atra/base.rb:601:in `dispatch!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0
/lib/sinatra/base.rb:411:in `block in call!'", "/app/.bundle/gems/ruby/1.9.1/gem
s/sinatra-1.0/lib/sinatra/base.rb:566:in `instance_eval'", "/app/.bundle/gems/ru
by/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/base.rb:566:in `catch'", "/a
pp/.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-1.0/lib/sinatra/base.rb:411:in `cal
l!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:399:in
`call'", "/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/auth/basic.rb:25
:in `call'", "/app/.bundle/gems/ruby/1.9.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/sina
tra/base.rb:1005:in `synchronize'", "/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'", "/home/heroku_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
/.bundle/gems/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'", "/hom
e/heroku_rack/lib/date_header.rb:14:in `call'", "/app/.bundle/gems/ruby/1.9.1/ge
ms/rack-1.2.1/lib/rack/builder.rb:77:in `call'", "/app/.bundle/gems/ruby/1.9.1/g
ems/thin-1.2.7/lib/thin/connection.rb:76:in `block in pre_process'", "/app/.bund
le/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:74:in `catch'", "/app/
.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:74:in `pre_proces
s'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/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/gems/ruby/1.9.1/gems/eventmachine-0.12.10/
lib/eventmachine.rb:256:in `run_machine'", "/app/.bundle/gems/ruby/1.9.1/gems/ev
entmachine-0.12.10/lib/eventmachine.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/thin-1.2.7/lib/thin/server.rb:156:in `start'", "/app/.bundle/ge
ms/ruby/1.9.1/gems/thin-1.2.7/lib/thin/controllers/controller.rb:80:in `start'",
 "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/runner.rb:177:in `run_co
mmand'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/runner.rb:143:in
 `run!'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/bin/thin:6:in `<top (req
uired)>'", "/usr/ruby1.9.2/bin/thin:19:in `load'", "/usr/ruby1.9.2/bin/thin:19:i
n `<main>'"]

pc@pc-PC /c/rails/funanew (master)
$

更新:

當我在應用程序根目錄的git控制台中說heroku db:push時。 我收到此錯誤:

pc@pc-PC /c/rails/myapp (master)
$ heroku db:push
Loaded Taps v0.3.23
Error parsing database.yml: undefined method `[]' for nil:NilClass
c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.3.6/lib/heroku/command/db.rb:72:in
`parse_database_yml'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.3.6/lib/heroku/command/db.rb:157:in
 `parse_taps_opts'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.3.6/lib/heroku/command/db.rb:29:in
`push'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.3.6/lib/heroku/command.rb:114:in `r
un'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/heroku-2.3.6/bin/heroku:14:in `<top (require
d)>'
c:/Ruby192/bin/heroku:19:in `load'
c:/Ruby192/bin/heroku:19:in `<main>'
Invalid database url

pc@pc-PC /c/rails/myapp (master)
$

我的database.yml在配置文件夾中:

   development:
      adapter: mysql
      database: [mydatabase]
      encoding: utf8
      pool: 5
      username: root
      password: mysecretpassword
      socket: C:/xampp/mysql/bin/mysqld.sock
      host: localhost
      encoding: utf8

    # Warning: The database defined as "test" will be erased and
    # re-generated from your development database when you run "rake".
    # Do not set this db to the same as development or production.
    test:
      adapter: mysql
      database: [mydatabase]
      pool: 5
      username: root
      password: mysecretpassword
      socket: C:/xampp/mysql/bin/mysqld.sock
      host: localhost
      encoding: utf8

    production:
      adapter: mysql
      database: [mydatabase]
      pool: 5
      username: root
      password: mysecretpassword
      socket: C:/xampp/mysql/bin/mysqld.sock
      host: localhost
      encoding: utf8

我相信字符0xd872不是UTF-8。 Heroku也發生類似的事情。

祝你好運。

[edit]忘記提及了,也許您的編輯器的默認編碼或字體沒有特定字符,而是將其替換為憤怒的問號,並在上傳時拋出錯誤。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM