2017-02-12 75 views
1

我使用api ai制作天气机器人,并且制作webhook。但它不适用于heroku。Python不能与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 [email protected] 
2017-02-12T01:04:09.431329+00:00 app[api]: Release v8 created by user [email protected] 
2017-02-12T01:04:09.768517+00:00 app[api]: Release v8 created by user [email protected] 
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 [email protected] 
2017-02-12T01:04:55.273050+00:00 app[api]: Release v9 created by user [email protected] 
2017-02-12T01:04:55.517592+00:00 app[api]: Release v9 created by user [email protected] 
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的&蟒蛇

回答

0

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

我能顺利拿到您的应用程序与应用程序目录在我的机器上运行以下命令,在新的Heroku网站上运行:

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

这样做之后,使POST请求/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