24

我一直在寻找这个,但找不到任何似乎适用于我的情况的东西。我一直盯着这些日志看,看不出问题出在哪里。

这在之前的部署过程中发生过,但似乎总是能自行解决。现在这只是自己发生的(没有部署),我无法摆脱它。尝试恢复到应用程序的先前版本,但似乎我被卡住了。我已经重置了测功机并且还做了一个 rake db:migrate。

日志中有一些重复的东西,但我只是不知道从它们中读出什么。有人知道问题出在哪里吗?任何指导将不胜感激。请参阅下面的日志。

Jun 18 15:51:54 snapclass-production app/heroku-postgres:  source=HEROKU_POSTGRESQL_WHITE measure.current_transaction=1077 measure.db_size=6153016bytes measure.tables=0 measure.active-connections=3 measure.waiting-connections=0 measure.index-cache-hit-rate=0.99981 measure.table-cache-hit-rate=0.99349
Jun 18 15:52:06 snapclass-production heroku/router:  at=error code=H10 desc="App crashed" method=GET path=/ host=www.snapclass.com fwd="46.165.195.139" dyno= connect= service= status=503 bytes= 
Jun 18 15:52:07 snapclass-production heroku/router:  at=error code=H10 desc="App crashed" method=GET path=/ host=www.snapclass.com fwd="178.255.152.2" dyno= connect= service= status=503 bytes= 
Jun 18 15:52:12 snapclass-production app/postgres:  [47-1]  [] LOG:  checkpoint starting: time 
Jun 18 15:52:13 snapclass-production app/postgres:  [48-1]  [] LOG:  checkpoint complete: wrote 0 buffers (0.0%); 0 transaction log file(s) added, 0 removed, 0 recycled; write=0.000 s, sync=0.000 s, total=0.334 s; sync files=0, longest=0.000 s, average=0.000 s 
Jun 18 15:52:51 snapclass-production app/heroku-postgres:  source=HEROKU_POSTGRESQL_WHITE measure.current_transaction=1077 measure.db_size=6153016bytes measure.tables=0 measure.active-connections=3 measure.waiting-connections=0 measure.index-cache-hit-rate=0.99994 measure.table-cache-hit-rate=0.99997 
Jun 18 15:53:06 snapclass-production heroku/router:  at=error code=H10 desc="App crashed" method=GET path=/ host=www.snapclass.com fwd="95.141.32.46" dyno= connect= service= status=503 bytes= 
Jun 18 15:53:48 snapclass-production app/heroku-postgres:  source=HEROKU_POSTGRESQL_WHITE measure.current_transaction=1077 measure.db_size=6153016bytes measure.tables=0 measure.active-connections=3 measure.waiting-connections=0 measure.index-cache-hit-rate=0.97826 measure.table-cache-hit-rate=0.99999 
Jun 18 15:54:06 snapclass-production heroku/router:  at=error code=H10 desc="App crashed" method=GET path=/ host=www.snapclass.com fwd="95.211.217.68" dyno= connect= service= status=503 bytes= 
Jun 18 15:54:17 snapclass-production heroku/router:  at=error code=H10 desc="App crashed" method=GET path=/ host=www.snapclass.com fwd="205.197.158.210" dyno= connect= service= status=503 bytes= 
Jun 18 15:54:17 snapclass-production heroku/router:  at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=www.snapclass.com fwd="205.197.158.210" dyno= connect= service= status=503 bytes= 
Jun 18 15:54:25 snapclass-production heroku/router:  at=error code=H10 desc="App crashed" method=GET path=/ host=demosidney.snapclass.com fwd="202.46.61.33" dyno= connect= service= status=503 bytes=  
Jun 18 15:54:44 snapclass-production heroku/web.1:  State changed from crashed to starting 
Jun 18 15:54:44 snapclass-production app/heroku-postgres:  source=HEROKU_POSTGRESQL_WHITE measure.current_transaction=1077 measure.db_size=6153016bytes measure.tables=0 measure.active-connections=3 measure.waiting-connections=0 measure.index-cache-hit-rate=0.98897 measure.table-cache-hit-rate=0.99087 
Jun 18 15:54:48 snapclass-production heroku/web.1:  Starting process with command `bundle exec thin start -R config.ru -e $RAILS_ENV -p 50180` 
Jun 18 15:55:40 snapclass-production app/heroku-postgres:  source=HEROKU_POSTGRESQL_WHITE measure.current_transaction=1077 measure.db_size=6153016bytes measure.tables=0 measure.active-connections=3 measure.waiting-connections=0 measure.index-cache-hit-rate=0.99926 measure.table-cache-hit-rate=0.99996 
Jun 18 15:55:50 snapclass-production heroku/web.1:  Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch 
Jun 18 15:55:50 snapclass-production heroku/web.1:  Stopping process with SIGKILL 
Jun 18 15:55:51 snapclass-production heroku/web.1:  Process exited with status 137 
Jun 18 15:55:51 snapclass-production heroku/web.1:  State changed from starting to crashed 
Jun 18 15:55:52 snapclass-production heroku/router:  at=error code=H10 desc="App crashed" method=GET path=/ host=demosidney.snapclass.com fwd="119.63.193.130" dyno= connect= service= status=503 bytes= 
Jun 18 15:55:52 snapclass-production heroku/router:  at=error code=H10 desc="App crashed" method=GET path=/snapclasses/sat-prep-math/register host=www.snapclass.com fwd="173.199.115.115" dyno= connect= service= status=503 bytes= 
Jun 18 15:55:53 snapclass-production heroku/router:  at=error code=H10 desc="App crashed" method=GET path=/ host=www.snapclass.com fwd="23.21.36.78" dyno= connect= service= status=503 bytes= 
Jun 18 15:55:54 snapclass-production heroku/router:  at=error code=H10 desc="App crashed" method=GET path=/ host=www.snapclass.com fwd="23.22.98.102" dyno= connect= service= status=503 bytes= 
Jun 18 15:55:54 snapclass-production heroku/router:  at=error code=H10 desc="App crashed" method=GET path=/ host=www.snapclass.com fwd="91.109.115.41" dyno= connect= service= status=503 bytes= 
Jun 18 15:56:06 snapclass-production heroku/router:  at=error code=H10 desc="App crashed" method=GET path=/ host=www.snapclass.com fwd="174.34.224.167" dyno= connect= service= status=503 bytes= 
4

8 回答 8

29

尝试以下步骤:

- git push heroku master # if not done
- heroku run rake db:migrate
- heroku restart

等几分钟...

于 2013-08-26T09:18:39.173 回答
18

就我而言,这是因为我对要使用的端口进行了硬编码,

我用这个改变了,它起作用了

app.listen(process.env.PORT || 3000);
于 2017-10-27T19:42:45.637 回答
7

创建 Heroku 帐户

 $heroku create

验证您的 git 配置是否正常

$git remote -v

将 Git 存储库与现有应用程序关联

$heroku git:remote -a herokuapp-name

执行推送到主控

$git push heroku master

要使您的数据库正常工作,您必须迁移到生产数据库

$heroku run bundle exec rake db:migrate

然后重启

heroku restart

最后浏览到您的位置

于 2015-04-20T14:52:00.973 回答
1

我也遇到过这个错误,总的来说这个错误意味着它不能与你的依赖项一起工作,原因之一可能是旧版本的依赖项。我通过以下两个步骤解决了这个问题:1)我手动更新了所有依赖项。2)我将我的 Flask API 从 app.py 更改为 err.py (使用不同的名称可能会有所帮助,但不是必需的。

这对我有用。希望能帮助到你!!

于 2020-06-07T09:29:38.907 回答
0

更改我在代码上连接到数据库的方式有帮助

    let  databaseURL = pgURL
   if var postgresConfig = PostgresConfiguration(url: databaseURL) {
    postgresConfig.tlsConfiguration = tls
    app.databases.use(.postgres(
        configuration: postgresConfig
    ), as: .psql)
    app.middleware.use(ErrorMiddleware.default(environment: app.environment))

    app.migrations.add(CreateTranscription())
    app.migrations.add(CreateTemplate())

    app.routes.defaultMaxBodySize = "10mb"

    try app.autoMigrate().wait()

    // register routes
    try routes(app)
} else{
    fatalError("DATABASE_URL not configured")
}
于 2021-10-03T21:08:52.627 回答
0

我的主要条目package.json指向错误的目录。确保它指向构建输出目录。至于我的情况,我在/bin文件夹中有服务器文件,所以我设置了我的package.json

{
  "main": "build/bin/www.js"
  "scripts": {
    "start": "node ."
  }
}
于 2019-11-03T10:13:44.300 回答
0

在您的应用程序中设置 Proc 文件

web: node build/build.js

Heroku Proc 文件

于 2022-02-22T04:54:05.927 回答
0

就我而言,我正在使用 babel 在 ES6 上使用 express,将 babel 导入为 devDependency (Heroku 在生产中忽略 devDependencies)在将它们包含到它为我工作的依赖项中之后。

"dependencies": {
    "@babel/register": "^7.8.3",
    "@babel/core": "^7.8.4",
    "@babel/preset-env": "^7.8.4"
}
于 2020-05-22T10:24:08.127 回答