Python不适用于heroku

时间:2017-02-12 01:29:16

标签: python heroku dialogflow

我正在使用api ai制作一个天气机器人,我正在制作webhook。但它不适用于heroku。

日志:

2017-02-12T01:04:09.580619+00:00 heroku[slug-compiler]: Slug compilation started
2017-02-12T01:04:09.580628+00:00 heroku[slug-compiler]: Slug compilation finished
2017-02-12T01:04:09.431329+00:00 app[api]: Deploy f5b127a by user ntrung03@gmail.com
2017-02-12T01:04:09.431329+00:00 app[api]: Release v8 created by user ntrung03@gmail.com
2017-02-12T01:04:09.768517+00:00 app[api]: Release v8 created by user ntrung03@gmail.com
2017-02-12T01:04:55.382953+00:00 heroku[slug-compiler]: Slug compilation started
2017-02-12T01:04:55.382960+00:00 heroku[slug-compiler]: Slug compilation finished
2017-02-12T01:04:55.273050+00:00 app[api]: Deploy f5b127a by user ntrung03@gmail.com
2017-02-12T01:04:55.273050+00:00 app[api]: Release v9 created by user ntrung03@gmail.com
2017-02-12T01:04:55.517592+00:00 app[api]: Release v9 created by user ntrung03@gmail.com
2017-02-12T01:05:02.283592+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/webhook" host=botmia.herokuapp.com request_id=cf6fc4f6-fd84-415b-b2de-0c69e140ef5b fwd="54.198.43.155" dyno= connect= service= status=503 bytes=
2017-02-12T01:08:56.636508+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=POST path="/webhook" host=botmia.herokuapp.com request_id=2e1b3ba4-c495-431e-8695-7dd742258201 fwd="54.198.43.155" dyno= connect= service= status=503 bytes=
2017-02-12T01:12:28.027455+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=botmia.herokuapp.com request_id=23238026-ba99-45da-a0d4-94b426e8dbb8 fwd="117.5.143.247" dyno= connect= service= status=503 bytes=
2017-02-12T01:12:29.548164+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=botmia.herokuapp.com request_id=95a8d5b9-639f-405e-a83e-a4603ab44f1c fwd="117.5.143.247" dyno= connect= service= status=503 bytes=

Host on Heroku

Source

A similar error 但是不起作用 谢谢大家帮助我。我是Api.ai heroku&蟒

2 个答案:

答案 0 :(得分:0)

从您的错误日志中,您看起来有一个代码H14,这意味着您尚未启动您的网络动态(https://devcenter.heroku.com/articles/error-codes#h14-no-web-dynos-running)。您可以通过从终端运行heroku ps:scale web=1来启动dyno(假设您已安装heroku命令行工具)。您需要至少运行1个dyno才能使您的站点正常运行。

我能够在新的heroku站点上成功运行您的应用程序,并在我的计算机上的app目录中运行以下命令:

$ git clone https://github.com/TrungNguyen1909/BotMia
$ cd BotMia
$ heroku create
$ git push heroku master

执行此操作后,向/webhook发送请求成功访问该端点,如日志中所示:

2017-02-12T01:53:12.721050+00:00 heroku[router]: at=info method=POST path="/webhook" host=MY_HOST request_id=REQ_ID fwd="IP" dyno=web.1 connect=1ms service=4ms status=500 bytes=452

答案 1 :(得分:0)

对于Heroku,您可以在Procfile中描述您的dyno配置,该配置应该存在于项目的根目录中。

请参阅:https://devcenter.heroku.com/articles/procfile