1

我正在使用 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=

在 Heroku 上托管

资源

一个类似的错误 但不起作用感谢大家帮助我。我是 Api.ai heroku & python 的新手

4

2 回答 2

0

对于 Heroku,您在您的项目中描述了您的测功机配置,Procfile该配置应该位于项目的根目录中。

见:https ://devcenter.heroku.com/articles/procfile

于 2017-02-13T22:42:26.170 回答
0

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

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

$ 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

于 2017-02-12T01:48:24.060 回答