Heroku节点应用程序崩溃,无法解决错误

时间:2017-04-18 03:51:12

标签: node.js heroku

所以我现在一直试图找到堆栈溢出的答案2个小时,我发现了类似于我的问题,但我似乎无法解决这个问题。我正在运行node.js,我在heroku上的应用程序已连接到我的文件。我可以使用heroku本地网络运行它,但是当我尝试运行heroku时,它不起作用。这是我回来的唯一错误,没有帮助

任何想法我应该怎么做?我卸载了我的node_modules并重新安装了几次。我已经尝试了许多其他的方法来解决这个问题,但答案是我的想法。任何帮助,将不胜感激。谢谢

2017-04-18T03:01:11.753817+00:00 app[web.1]:     at Connection.g (events.js:291:16)
2017-04-18T03:01:11.753818+00:00 app[web.1]:     at emitNone (events.js:86:13)
2017-04-18T03:01:11.753818+00:00 app[web.1]:     at Connection.emit (events.js:185:7)
2017-04-18T03:01:11.753819+00:00 app[web.1]:     at Socket.<anonymous> (/app/node_modules/pg/lib/connection.js:93:10)
2017-04-18T03:01:11.753820+00:00 app[web.1]:     at emitOne (events.js:96:13)
2017-04-18T03:01:11.753820+00:00 app[web.1]:     at Socket.emit (events.js:188:7)
2017-04-18T03:01:11.753822+00:00 app[web.1]:     at Function.module.exports.loopWhile (/app/node_modules/deasync/index.js:72:22)
2017-04-18T03:01:11.753821+00:00 app[web.1]:     at TCP._handle.close [as _onclose] (net.js:501:12)
2017-04-18T03:01:11.753823+00:00 app[web.1]:     at Object.connectSync (/app/node_modules/deasync/index.js:44:19)
2017-04-18T03:01:11.849495+00:00 heroku[web.1]: State changed from starting to crashed
2017-04-18T03:01:11.834795+00:00 heroku[web.1]: Process exited with status 1
2017-04-18T03:01:13.801663+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sleepy-scrubland-94070.herokuapp.com request_id=9b32ec53-0be3-4d08-bcd3-1f4515078326 fwd="73.228.98.27" dyno= connect= service= status=503 bytes= protocol=https
2017-04-18T03:01:14.364310+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sleepy-scrubland-94070.herokuapp.com request_id=6d5dbb29-e58e-4c44-ae66-c447cde53a71 fwd="73.228.98.27" dyno= connect= service= status=503 bytes= protocol=https
2017-04-18T03:03:19.882851+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sleepy-scrubland-94070.herokuapp.com request_id=a676bf55-cde0-437f-ae19-2c29a5ec8629 fwd="73.228.98.27" dyno= connect= service= status=503 bytes= protocol=https
2017-04-18T03:03:20.493726+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sleepy-scrubland-94070.herokuapp.com request_id=b54aa1b4-16f3-4fdf-8788-08734976d350 fwd="73.228.98.27" dyno= connect= service= status=503 bytes= protocol=https
2017-04-18T03:07:03.434804+00:00 app[api]: Starting process with command `node console` by user zaspringer@gmail.com
2017-04-18T03:07:07.053777+00:00 heroku[run.6379]: Awaiting client
2017-04-18T03:07:07.106000+00:00 heroku[run.6379]: Starting process with command `node console`
2017-04-18T03:07:07.065103+00:00 heroku[run.6379]: State changed from starting to up
2017-04-18T03:07:12.063311+00:00 heroku[run.6379]: State changed from up to complete
2017-04-18T03:07:12.036110+00:00 heroku[run.6379]: Process exited with status 1
2017-04-18T03:13:36.190306+00:00 heroku[web.1]: State changed from crashed to starting
2017-04-18T03:13:39.306646+00:00 heroku[web.1]: Starting process with command `node index.js`
2017-04-18T03:13:41.349539+00:00 app[web.1]: /app/node_modules/deasync/index.js:46
2017-04-18T03:13:41.349555+00:00 app[web.1]:                throw err;
2017-04-18T03:13:41.349555+00:00 app[web.1]:                ^
2017-04-18T03:13:41.349556+00:00 app[web.1]: 
2017-04-18T03:13:41.349557+00:00 app[web.1]: Error: Connection terminated
2017-04-18T03:13:41.349558+00:00 app[web.1]:     at Connection.<anonymous> (/app/node_modules/pg/lib/client.js:193:17)
2017-04-18T03:13:41.349559+00:00 app[web.1]:     at Connection.g (events.js:291:16)
2017-04-18T03:13:41.349559+00:00 app[web.1]:     at emitNone (events.js:86:13)
2017-04-18T03:13:41.349560+00:00 app[web.1]:     at Connection.emit (events.js:185:7)
2017-04-18T03:13:41.349560+00:00 app[web.1]:     at Socket.<anonymous> (/app/node_modules/pg/lib/connection.js:93:10)
2017-04-18T03:13:41.349561+00:00 app[web.1]:     at emitOne (events.js:96:13)
2017-04-18T03:13:41.349562+00:00 app[web.1]:     at Socket.emit (events.js:188:7)
2017-04-18T03:13:41.349562+00:00 app[web.1]:     at TCP._handle.close [as _onclose] (net.js:501:12)
2017-04-18T03:13:41.349563+00:00 app[web.1]:     at Function.module.exports.loopWhile (/app/node_modules/deasync/index.js:72:22)
2017-04-18T03:13:41.349564+00:00 app[web.1]:     at Object.connectSync (/app/node_modules/deasync/index.js:44:19)
2017-04-18T03:13:41.410505+00:00 heroku[web.1]: State changed from starting to crashed
2017-04-18T03:13:41.407312+00:00 heroku[web.1]: Process exited with status 1
2017-04-18T03:14:29.784056+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sleepy-scrubland-94070.herokuapp.com request_id=62bd5de1-9c85-4887-ac37-47a44249124b fwd="73.228.98.27" dyno= connect= service= status=503 bytes= protocol=https
2017-04-18T03:14:30.421942+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sleepy-scrubland-94070.herokuapp.com request_id=27e908ad-5175-4293-9fd5-23a42e542528 fwd="73.228.98.27" dyno= connect= service= status=503 bytes= protocol=https
2017-04-18T03:19:09.843901+00:00 app[api]: Starting process with command `node` by user zaspringer@gmail.com
2017-04-18T03:19:13.476965+00:00 heroku[run.3372]: Starting process with command `node`
2017-04-18T03:19:13.438795+00:00 heroku[run.3372]: Awaiting client
2017-04-18T03:19:13.643946+00:00 heroku[run.3372]: State changed from starting to up
2017-04-18T03:19:46.386468+00:00 heroku[run.3372]: State changed from up to complete
2017-04-18T03:19:46.381971+00:00 heroku[run.3372]: Process exited with status 0
2017-04-18T03:20:15.239917+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sleepy-scrubland-94070.herokuapp.com request_id=07b3037a-57b5-42da-ba14-4ddfafbd7d17 fwd="73.228.98.27" dyno= connect= service= status=503 bytes= protocol=https
2017-04-18T03:20:15.814653+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sleepy-scrubland-94070.herokuapp.com request_id=98967a80-c519-4c63-b368-6614012a3044 fwd="73.228.98.27" dyno= connect= service= status=503 bytes= protocol=https
2017-04-18T03:23:46.259605+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sleepy-scrubland-94070.herokuapp.com request_id=60735a46-1949-4aaf-8476-2ac6a031dd8b fwd="73.228.98.27" dyno= connect= service= status=503 bytes= protocol=https
2017-04-18T03:23:46.816865+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sleepy-scrubland-94070.herokuapp.com request_id=4f49d9ce-dc4d-4fd2-9f1c-fd97ee7351de fwd="73.228.98.27" dyno= connect= service= status=503 bytes= protocol=https
2017-04-18T03:31:14.000000+00:00 app[api]: Build started by user zaspringer@gmail.com
2017-04-18T03:31:46.937811+00:00 app[api]: Deploy 2c8b275 by user zaspringer@gmail.com
2017-04-18T03:31:46.937811+00:00 app[api]: Release v11 created by user zaspringer@gmail.com
2017-04-18T03:31:47.692259+00:00 app[api]: Release v11 created by user zaspringer@gmail.com
2017-04-18T03:31:47.860838+00:00 heroku[web.1]: State changed from crashed to starting
2017-04-18T03:31:14.000000+00:00 app[api]: Build succeeded
2017-04-18T03:31:51.575991+00:00 heroku[web.1]: Starting process with command `node index.js`
2017-04-18T03:31:54.117469+00:00 app[web.1]: /app/node_modules/deasync/index.js:46
2017-04-18T03:31:54.117487+00:00 app[web.1]:                throw err;
2017-04-18T03:31:54.117488+00:00 app[web.1]:                ^
2017-04-18T03:31:54.117488+00:00 app[web.1]: 
2017-04-18T03:31:54.117489+00:00 app[web.1]: Error: Connection terminated
2017-04-18T03:31:54.117505+00:00 app[web.1]:     at Connection.<anonymous> (/app/node_modules/pg/lib/client.js:193:17)
2017-04-18T03:31:54.117506+00:00 app[web.1]:     at Object.onceWrapper (events.js:290:19)
2017-04-18T03:31:54.117506+00:00 app[web.1]:     at emitNone (events.js:86:13)
2017-04-18T03:31:54.117507+00:00 app[web.1]:     at Connection.emit (events.js:185:7)
2017-04-18T03:31:54.117507+00:00 app[web.1]:     at Socket.<anonymous> (/app/node_modules/pg/lib/connection.js:93:10)
2017-04-18T03:31:54.117508+00:00 app[web.1]:     at emitOne (events.js:96:13)
2017-04-18T03:31:54.117508+00:00 app[web.1]:     at Socket.emit (events.js:188:7)
2017-04-18T03:31:54.117509+00:00 app[web.1]:     at TCP._handle.close [as _onclose] (net.js:501:12)
2017-04-18T03:31:54.117509+00:00 app[web.1]:     at Function.module.exports.loopWhile (/app/node_modules/deasync/index.js:72:22)
2017-04-18T03:31:54.117510+00:00 app[web.1]:     at Object.connectSync (/app/node_modules/deasync/index.js:44:19)
2017-04-18T03:31:54.199159+00:00 heroku[web.1]: State changed from starting to crashed
2017-04-18T03:31:54.200417+00:00 heroku[web.1]: State changed from crashed to starting
2017-04-18T03:31:54.191395+00:00 heroku[web.1]: Process exited with status 1
2017-04-18T03:31:58.993421+00:00 heroku[web.1]: Starting process with command `node index.js`
2017-04-18T03:32:01.719759+00:00 app[web.1]: /app/node_modules/deasync/index.js:46
2017-04-18T03:32:01.719772+00:00 app[web.1]:                throw err;
2017-04-18T03:32:01.719773+00:00 app[web.1]: 
2017-04-18T03:32:01.719772+00:00 app[web.1]:                ^
2017-04-18T03:32:01.719773+00:00 app[web.1]: Error: Connection terminated
2017-04-18T03:32:01.719775+00:00 app[web.1]:     at Connection.<anonymous> (/app/node_modules/pg/lib/client.js:193:17)
2017-04-18T03:32:01.719775+00:00 app[web.1]:     at Object.onceWrapper (events.js:290:19)
2017-04-18T03:32:01.719776+00:00 app[web.1]:     at emitNone (events.js:86:13)
2017-04-18T03:32:01.719776+00:00 app[web.1]:     at Connection.emit (events.js:185:7)
2017-04-18T03:32:01.719777+00:00 app[web.1]:     at Socket.<anonymous> (/app/node_modules/pg/lib/connection.js:93:10)
2017-04-18T03:32:01.719778+00:00 app[web.1]:     at emitOne (events.js:96:13)
2017-04-18T03:32:01.719778+00:00 app[web.1]:     at Socket.emit (events.js:188:7)
2017-04-18T03:32:01.719779+00:00 app[web.1]:     at TCP._handle.close [as _onclose] (net.js:501:12)
2017-04-18T03:32:01.719780+00:00 app[web.1]:     at Function.module.exports.loopWhile (/app/node_modules/deasync/index.js:72:22)
2017-04-18T03:32:01.719780+00:00 app[web.1]:     at Object.connectSync (/app/node_modules/deasync/index.js:44:19)
2017-04-18T03:32:01.814346+00:00 heroku[web.1]: Process exited with status 1
2017-04-18T03:32:01.837342+00:00 heroku[web.1]: State changed from starting to crashed
2017-04-18T03:32:02.890542+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sleepy-scrubland-94070.herokuapp.com request_id=bdb80140-a459-4eda-b176-fca72652db51 fwd="73.228.98.27" dyno= connect= service= status=503 bytes= protocol=https
2017-04-18T03:32:03.437925+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sleepy-scrubland-94070.herokuapp.com request_id=0f2294d3-82db-4ffe-b1cd-2c1d1197fbab fwd="73.228.98.27" dyno= connect= service= status=503 bytes= protocol=https
2017-04-18T03:41:38.053598+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sleepy-scrubland-94070.herokuapp.com request_id=cf44e271-b21f-4e8d-9a33-6905e77f55a5 fwd="73.228.98.27" dyno= connect= service= status=503 bytes= protocol=https
2017-04-18T03:41:38.595630+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sleepy-scrubland-94070.herokuapp.com request_id=5a6804c7-60ad-47a4-89f1-c7924dd2f837 fwd="73.228.98.27" dyno= connect= service= status=503 bytes= protocol=https
2017-04-18T03:44:46.828716+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sleepy-scrubland-94070.herokuapp.com request_id=247728f8-b560-4c89-8a6b-9041d79f0292 fwd="73.228.98.27" dyno= connect= service= status=503 bytes= protocol=https
2017-04-18T03:44:47.393479+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sleepy-scrubland-94070.herokuapp.com request_id=218bff63-8eec-40d6-8acc-f1e90ae179ee fwd="73.228.98.27" dyno= connect= service= status=503 bytes= protocol=https
~/codeprj/cornerstone-design-group/cornerstone
Full error logs. I can't seem to find something that points me in the right direction.

1 个答案:

答案 0 :(得分:0)

在您的情况下,这个错误似乎是因为postgres没有发送ready命令。这可能是因为数据库设置配置错误,或者服务器与数据库之间连接不良。

您可以详细了解如何正确执行此操作here

  

在您的应用中,将模块配置为默认为SSL连接。然后,在您的应用初始化时连接到DATABASE_URL:

var pg = require('pg');

pg.defaults.ssl = true;
pg.connect(process.env.DATABASE_URL, function(err, client) {
  if (err) throw err;
  console.log('Connected to postgres! Getting schemas...');

  client
    .query('SELECT table_schema,table_name FROM information_schema.tables;')
    .on('row', function(row) {
      console.log(JSON.stringify(row));
    });
});