第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Heroku Go 應(yīng)用程序崩潰

Heroku Go 應(yīng)用程序崩潰

Go
江戶川亂折騰 2021-11-08 10:54:42
按照本教程,一切都在本地進(jìn)行。將我的應(yīng)用程序部署到 Heroku 并在瀏覽器上訪問該應(yīng)用程序后,我收到503 錯誤和消息:應(yīng)用程序錯誤 應(yīng)用程序發(fā)生錯誤,無法提供您的頁面。請稍后重試。如果您是應(yīng)用程序所有者,請檢查您的日志以了解詳細(xì)信息。日志說:2015-09-08T16:31:53.976824+00:00 heroku[web.1]: State changed from crashed to starting2015-09-08T16:31:56.174376+00:00 heroku[web.1]: Starting process with command `mywebsite`2015-09-08T16:31:59.312461+00:00 app[web.1]: Listening on port: 394612015-09-08T16:32:56.471550+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch2015-09-08T16:32:56.471550+00:00 heroku[web.1]: Stopping process with SIGKILL2015-09-08T16:32:57.390752+00:00 heroku[web.1]: Process exited with status 1372015-09-08T16:32:57.404208+00:00 heroku[web.1]: State changed from starting to crashed2015-09-08T16:32:57.645135+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=boiling-eyrie-6897.herokuapp.com request_id=ec26... fwd="xx.xxx.xxx.xxx" dyno= connect= service= status=503 bytes=2015-09-08T16:32:58.233774+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=boiling-eyrie-6897.herokuapp.com request_id=ef40...fwd="xx.xxx.xxx.xxx" dyno= connect= service= status=503 bytes=我明白錯誤是什么,但這么小的教程應(yīng)用程序怎么會導(dǎo)致啟動超時(R10)?如何更好地調(diào)試并修復(fù)應(yīng)用程序以使其運(yùn)行?
查看完整描述

2 回答

?
梵蒂岡之花

TA貢獻(xiàn)1900條經(jīng)驗(yàn) 獲得超5個贊

當(dāng)您通過heroku部署應(yīng)用程序時,它不允許您指定端口號。
換句話說,您不能將 Web 服務(wù)的端口號指定為8000或其他,heroku 在運(yùn)行時決定端口號。
因此,您不能使用以下代碼:

    log.Fatal(http.ListenAndServe(":8000", router))

您可以做的是獲取heroku 的運(yùn)行時端口。
簡而言之,只需使用以下代碼

    log.Fatal(http.ListenAndServe(":" + os.Getenv("PORT"), router))


查看完整回答
反對 回復(fù) 2021-11-08
?
偶然的你

TA貢獻(xiàn)1841條經(jīng)驗(yàn) 獲得超3個贊

您的應(yīng)用程序需要偵聽所有網(wǎng)絡(luò)連接。如果它只偵聽本地主機(jī),heroku 的進(jìn)程觀察器將無法檢測到您綁定了端口,也無法向您的應(yīng)用程序發(fā)送請求。

這意味著而不是:

http.ListenAndServe("127.0.0.1:"+port, nil)

您需要致電:

http.ListenAndServe(":"+port, nil)

另請參閱 Heroku 開始使用 Go 應(yīng)用程序:https : //github.com/heroku/go-getting-started/blob/master/cmd/go-getting-started/main.go#L27


查看完整回答
反對 回復(fù) 2021-11-08
  • 2 回答
  • 0 關(guān)注
  • 205 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號