0
我是一個新手,試圖用heroku和ghost框架創建自己的博客。 我已經成功地將我的源代碼部署到了heroku中。 。但是當我連接到我的博客域名(myblog.herokuapp.com)時,錯誤消失。[Heroku + GhostJs] _ Heroku和Ghost之間的服務器配置不正確
我檢查記錄與命令:
heroku logs --tail -n 200
它說:
app[web.1]: at Promise._settlePromiseCtx (/app/node_modules/bluebird/js/release/promise.js:606:10)
app[web.1]: at Async._drainQueue (/app/node_modules/bluebird/js/release/async.js:138:12)
app[web.1]: at Async._drainQueues (/app/node_modules/bluebird/js/release/async.js:143:10)
app[web.1]: at Immediate.Async.drainQueues (/app/node_modules/bluebird/js/release/async.js:17:14)
app[web.1]: at runCallback (timers.js:672:20)
app[web.1]: at tryOnImmediate (timers.js:645:5)
app[web.1]: at processImmediate [as _immediateCallback] (timers.js:617:5)
app[web.1]:
app[web.1]:
app[web.1]: ERROR: invalid server configuration
app[web.1]:
app[web.1]: Error: invalid server configuration
app[web.1]: at ConfigManager.validate (/app/core/server/config/index.js:458:31)
app[web.1]: at /app/core/server/config/index.js:332:29
app[web.1]: at tryCatcher (/app/node_modules/bluebird/js/release/util.js:16:23)
app[web.1]: at Promise._settlePromiseFromHandler (/app/node_modules/bluebird/js/release/promise.js:512:31)
app[web.1]: at Promise._settlePromise (/app/node_modules/bluebird/js/release/promise.js:569:18)
app[web.1]: at Async._drainQueue (/app/node_modules/bluebird/js/release/async.js:138:12)
app[web.1]: at Promise._settlePromiseCtx (/app/node_modules/bluebird/js/release/promise.js:606:10)
app[web.1]: at Async._drainQueues (/app/node_modules/bluebird/js/release/async.js:143:10)
app[web.1]: at Immediate.Async.drainQueues (/app/node_modules/bluebird/js/release/async.js:17:14)
app[web.1]: at runCallback (timers.js:672:20)
app[web.1]: at tryOnImmediate (timers.js:645:5)
app[web.1]:
app[web.1]: at processImmediate [as _immediateCallback] (timers.js:617:5)
heroku[web.1]: State changed from starting to crashed
heroku[web.1]: Process exited with status 0
heroku[web.1]: State changed from crashed to starting
heroku[web.1]: Starting process with command `npm start`
app[web.1]: > node index
app[web.1]:
app[web.1]: > [email protected] start /app
app[web.1]:
app[web.1]:
app[web.1]: ERROR: Your server values (socket, or host and port) in config.js are invalid.
app[web.1]: Please provide them before restarting.
app[web.1]: Error: Your server values (socket, or host and port) in config.js are invalid.
app[web.1]: at ConfigManager.validate (/app/core/server/config/index.js:454:13)
app[web.1]: at /app/core/server/config/index.js:332:29
app[web.1]: at tryCatcher (/app/node_modules/bluebird/js/release/util.js:16:23)
app[web.1]: at Promise._settlePromiseFromHandler (/app/node_modules/bluebird/js/release/promise.js:512:31)
app[web.1]: at Promise._settlePromise (/app/node_modules/bluebird/js/release/promise.js:569:18)
app[web.1]: at Promise._settlePromiseCtx (/app/node_modules/bluebird/js/release/promise.js:606:10)
app[web.1]: at Async._drainQueue (/app/node_modules/bluebird/js/release/async.js:138:12)
app[web.1]: at Async._drainQueues (/app/node_modules/bluebird/js/release/async.js:143:10)
app[web.1]: at Immediate.Async.drainQueues (/app/node_modules/bluebird/js/release/async.js:17:14)
app[web.1]: at runCallback (timers.js:672:20)
app[web.1]: at tryOnImmediate (timers.js:645:5)
app[web.1]: at processImmediate [as _immediateCallback] (timers.js:617:5)
app[web.1]:
app[web.1]:
app[web.1]: at ConfigManager.validate (/app/core/server/config/index.js:458:31)
app[web.1]: ERROR: invalid server configuration
app[web.1]:
app[web.1]: at /app/core/server/config/index.js:332:29
app[web.1]: Error: invalid server configuration
app[web.1]: at tryCatcher (/app/node_modules/bluebird/js/release/util.js:16:23)
app[web.1]: at Promise._settlePromiseFromHandler (/app/node_modules/bluebird/js/release/promise.js:512:31)
app[web.1]: at Promise._settlePromise (/app/node_modules/bluebird/js/release/promise.js:569:18)
app[web.1]: at Promise._settlePromiseCtx (/app/node_modules/bluebird/js/release/promise.js:606:10)
app[web.1]: at Async._drainQueue (/app/node_modules/bluebird/js/release/async.js:138:12)
app[web.1]: at Async._drainQueues (/app/node_modules/bluebird/js/release/async.js:143:10)
app[web.1]: at Immediate.Async.drainQueues (/app/node_modules/bluebird/js/release/async.js:17:14)
app[web.1]: at runCallback (timers.js:672:20)
app[web.1]: at tryOnImmediate (timers.js:645:5)
app[web.1]: at processImmediate [as _immediateCallback] (timers.js:617:5)
app[web.1]:
heroku[web.1]: Process exited with status 0
heroku[web.1]: State changed from starting to crashed
heroku[web.1]: State changed from crashed to starting
heroku[web.1]: Starting process with command `npm start`
app[web.1]:
app[web.1]: > [email protected] start /app
app[web.1]: > node index
app[web.1]:
app[web.1]:
app[web.1]: ERROR: Your server values (socket, or host and port) in config.js are invalid.
app[web.1]: Please provide them before restarting.
app[web.1]: Error: Your server values (socket, or host and port) in config.js are invalid.
app[web.1]: at ConfigManager.validate (/app/core/server/config/index.js:454:13)
app[web.1]: at /app/core/server/config/index.js:332:29
app[web.1]: at tryCatcher (/app/node_modules/bluebird/js/release/util.js:16:23)
app[web.1]: at Promise._settlePromiseFromHandler (/app/node_modules/bluebird/js/release/promise.js:512:31)
app[web.1]: at Promise._settlePromiseCtx (/app/node_modules/bluebird/js/release/promise.js:606:10)
app[web.1]: at Async._drainQueue (/app/node_modules/bluebird/js/release/async.js:138:12)
app[web.1]: at Async._drainQueues (/app/node_modules/bluebird/js/release/async.js:143:10)
app[web.1]: at Immediate.Async.drainQueues (/app/node_modules/bluebird/js/release/async.js:17:14)
app[web.1]: at tryOnImmediate (timers.js:645:5)
app[web.1]: at runCallback (timers.js:672:20)
app[web.1]:
app[web.1]: at processImmediate [as _immediateCallback] (timers.js:617:5)
app[web.1]: at Promise._settlePromise (/app/node_modules/bluebird/js/release/promise.js:569:18)
app[web.1]:
app[web.1]: ERROR: invalid server configuration
app[web.1]:
app[web.1]: Error: invalid server configuration
app[web.1]: at ConfigManager.validate (/app/core/server/config/index.js:458:31)
app[web.1]: at /app/core/server/config/index.js:332:29
app[web.1]: at tryCatcher (/app/node_modules/bluebird/js/release/util.js:16:23)
app[web.1]: at Promise._settlePromiseFromHandler (/app/node_modules/bluebird/js/release/promise.js:512:31)
app[web.1]: at Promise._settlePromise (/app/node_modules/bluebird/js/release/promise.js:569:18)
app[web.1]: at Promise._settlePromiseCtx (/app/node_modules/bluebird/js/release/promise.js:606:10)
app[web.1]: at Async._drainQueue (/app/node_modules/bluebird/js/release/async.js:138:12)
app[web.1]: at Async._drainQueues (/app/node_modules/bluebird/js/release/async.js:143:10)
app[web.1]: at Immediate.Async.drainQueues (/app/node_modules/bluebird/js/release/async.js:17:14)
app[web.1]: at runCallback (timers.js:672:20)
app[web.1]: at tryOnImmediate (timers.js:645:5)
app[web.1]: at processImmediate [as _immediateCallback] (timers.js:617:5)
app[web.1]:
heroku[web.1]: Process exited with status 0
heroku[web.1]: State changed from starting to crashed
heroku[web.1]: State changed from crashed to starting
heroku[web.1]: Starting process with command `npm start`
app[web.1]: > node index
app[web.1]:
app[web.1]: > [email protected] start /app
app[web.1]:
app[web.1]:
app[web.1]: ERROR: Your server values (socket, or host and port) in config.js are invalid.
app[web.1]: Please provide them before restarting.
app[web.1]: Error: Your server values (socket, or host and port) in config.js are invalid.
app[web.1]: at ConfigManager.validate (/app/core/server/config/index.js:454:13)
app[web.1]: at /app/core/server/config/index.js:332:29
app[web.1]: at tryCatcher (/app/node_modules/bluebird/js/release/util.js:16:23)
app[web.1]: at Promise._settlePromiseFromHandler (/app/node_modules/bluebird/js/release/promise.js:512:31)
app[web.1]: at Async._drainQueue (/app/node_modules/bluebird/js/release/async.js:138:12)
app[web.1]: at Promise._settlePromise (/app/node_modules/bluebird/js/release/promise.js:569:18)
app[web.1]: at Promise._settlePromiseCtx (/app/node_modules/bluebird/js/release/promise.js:606:10)
app[web.1]: at Async._drainQueues (/app/node_modules/bluebird/js/release/async.js:143:10)
app[web.1]: at Immediate.Async.drainQueues (/app/node_modules/bluebird/js/release/async.js:17:14)
app[web.1]: at runCallback (timers.js:672:20)
app[web.1]: at tryOnImmediate (timers.js:645:5)
app[web.1]: at processImmediate [as _immediateCallback] (timers.js:617:5)
app[web.1]:
app[web.1]:
app[web.1]: ERROR: invalid server configuration
app[web.1]: Error: invalid server configuration
app[web.1]:
app[web.1]: at ConfigManager.validate (/app/core/server/config/index.js:458:31)
app[web.1]: at /app/core/server/config/index.js:332:29
app[web.1]: at tryCatcher (/app/node_modules/bluebird/js/release/util.js:16:23)
app[web.1]: at Promise._settlePromiseFromHandler (/app/node_modules/bluebird/js/release/promise.js:512:31)
app[web.1]: at Promise._settlePromise (/app/node_modules/bluebird/js/release/promise.js:569:18)
app[web.1]: at Promise._settlePromiseCtx (/app/node_modules/bluebird/js/release/promise.js:606:10)
app[web.1]: at Async._drainQueue (/app/node_modules/bluebird/js/release/async.js:138:12)
app[web.1]: at Async._drainQueues (/app/node_modules/bluebird/js/release/async.js:143:10)
app[web.1]: at Immediate.Async.drainQueues (/app/node_modules/bluebird/js/release/async.js:17:14)
app[web.1]: at runCallback (timers.js:672:20)
app[web.1]: at tryOnImmediate (timers.js:645:5)
app[web.1]: at processImmediate [as _immediateCallback] (timers.js:617:5)
app[web.1]:
heroku[web.1]: Process exited with status 0
heroku[web.1]: State changed from starting to crashed
heroku[web.1]: State changed from crashed to starting
heroku[web.1]: Starting process with command `npm start`
app[web.1]:
app[web.1]: > [email protected] start /app
app[web.1]: > node index
app[web.1]:
app[web.1]:
app[web.1]: ERROR: Your server values (socket, or host and port) in config.js are invalid.
app[web.1]: Please provide them before restarting.
app[web.1]: Error: Your server values (socket, or host and port) in config.js are invalid.
app[web.1]: at ConfigManager.validate (/app/core/server/config/index.js:454:13)
app[web.1]: at tryCatcher (/app/node_modules/bluebird/js/release/util.js:16:23)
app[web.1]: at Promise._settlePromiseFromHandler (/app/node_modules/bluebird/js/release/promise.js:512:31)
app[web.1]: at Promise._settlePromise (/app/node_modules/bluebird/js/release/promise.js:569:18)
app[web.1]: at Promise._settlePromiseCtx (/app/node_modules/bluebird/js/release/promise.js:606:10)
app[web.1]: at Async._drainQueue (/app/node_modules/bluebird/js/release/async.js:138:12)
app[web.1]: at Async._drainQueues (/app/node_modules/bluebird/js/release/async.js:143:10)
app[web.1]: at Immediate.Async.drainQueues (/app/node_modules/bluebird/js/release/async.js:17:14)
app[web.1]: at runCallback (timers.js:672:20)
app[web.1]: at tryOnImmediate (timers.js:645:5)
app[web.1]: at processImmediate [as _immediateCallback] (timers.js:617:5)
app[web.1]:
app[web.1]: at /app/core/server/config/index.js:332:29
app[web.1]: ERROR: invalid server configuration
app[web.1]:
app[web.1]: Error: invalid server configuration
app[web.1]:
app[web.1]: at ConfigManager.validate (/app/core/server/config/index.js:458:31)
app[web.1]: at /app/core/server/config/index.js:332:29
app[web.1]: at tryCatcher (/app/node_modules/bluebird/js/release/util.js:16:23)
app[web.1]: at Promise._settlePromiseFromHandler (/app/node_modules/bluebird/js/release/promise.js:512:31)
app[web.1]: at Promise._settlePromiseCtx (/app/node_modules/bluebird/js/release/promise.js:606:10)
app[web.1]: at Promise._settlePromise (/app/node_modules/bluebird/js/release/promise.js:569:18)
app[web.1]: at tryOnImmediate (timers.js:645:5)
app[web.1]: at Immediate.Async.drainQueues (/app/node_modules/bluebird/js/release/async.js:17:14)
app[web.1]: at Async._drainQueues (/app/node_modules/bluebird/js/release/async.js:143:10)
app[web.1]:
app[web.1]: at Async._drainQueue (/app/node_modules/bluebird/js/release/async.js:138:12)
app[web.1]: at runCallback (timers.js:672:20)
app[web.1]: at processImmediate [as _immediateCallback] (timers.js:617:5)
heroku[web.1]: State changed from starting to crashed
heroku[web.1]: Process exited with status 0
我敢肯定,在/root/config.js的一些問題,我的配置如下 過程.env.SERVER_HOST = 0.0.0.0 and process.env.PORT = 3000
server: {
host: process.env.SERVER_HOST,
port: process.env.PORT
}
有沒有人有任何想法糾正這個問題?
我看到你使用Ghost 0.11中創建另一個博客。在這種情況下,這個指南爲我工作:http://www.autodidacts.io/host-a-ghost-blog-on-heroku/ –
嗨, 我試過之前的指南,但它不工作。這是我的「Procfile.txt」的內容。 Procfile的擴展名是「.txt」嗎? >幅:NODE_ENV =生產節點index.js 我CONFIG環境變量如下: === minhtrietblog配置瓦爾 DATABASE_URL:DB_URL PORT:3000 POSTGRES_DATABASE:DB_NAME POSTGRES_HOST:主機 POSTGRES_PASSWORD:通過 POSTGRES_USER:用戶 NODE_ENV:生產 PRODUCTION_URL:https://URL.herokuapp.com/ SERVER_HOST:0.0.0.0 – user1304663
在那裏指導,他們說如下。但「process.env.PORT」的價值是什麼?它是3000還是2368? 服務器:{ 主機: '0.0.0.0', 端口:process.env.PORT } – user1304663