用heroku部署Vapor [英] Deploying Vapor with heroku

查看:160
本文介绍了用heroku部署Vapor的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 main.swift 中创建了一个非常简单的应用程序。它从查询字符串中读取一个城市,并使用它来获取该城市的天气(通过雅虎API)。这是路线:

  drop.get(是){请求在


guard let city = request.data [city]?。string else {
return try JSON(node:[Error:no city given])
}

return try drop.client.get(https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20from%20woeid%20in%20(从%20geo.places(1)%20where%20text%3D%22 \\(city)%22)& format = json& env = store%3A%2F%2Fdatatables.org%2Falltableswithkeys选择%20woeid% b $ b}

当我在localhost上运行代码时,代码完美运行,但出现500错误当我使用Heroku进行部署时。



有没有我不应该推向heroku的文件?我想指出,在 server.json 中,主机值是 0.0.0.0



这是我的Heroku日志(注意多次重新部署,所有这些都不起作用):

  2017-01-05T17:00:28.932559 + 00:00 heroku [router]:at = info method = POST path =/host = dry-beyond-95031.herokuapp.com request_id = 10bd5717- a444-4106-9479-5dda7de686d1 fwd =94.77.202.2dyno = web.1 connect = 1ms service = 24ms status = 500 bytes = 138 
2017-01-05T17:00:34.568980 + 00:00 heroku [路由器]:at = info method = GET path =/是否host = dry-beyond-95031.herokuapp.com request_id = 88277ee9-5814-4e33-a180-69e2a36a10ac fwd =94.77.202.2dyno = web.1 connect = 0ms service = 2ms status = 404 bytes = 161
2017-01-05T17:00:50.620499 + 00:00 heroku [router]:at = info method = POST path =/是否host = dry-beyond -95031.herokuapp.com request_id = e9e03939-3252-4eb2-ba05-ed06b7123fc0 fwd =94.77.202.2dyno = web.1 connect = 0ms service = 20ms status = 500 bytes = 138
2017-01-05T17 :03:30.089070+ 00:00 heroku [router]:at = info method = POST path =/是否host = dry-beyond-95031.herokuapp.com request_id = d3334e79-bdaf-4f51-a6fe-198a356c2c8a fwd =94.77.202.2dyno = web.1 connect = 0ms service = 31ms status = 500 bytes = 138
2017-01-05T17:03:41.773239 + 00:00 heroku [router]:at = error code = H13 desc =Connection closed without响应method = POST path =/是否host = dry-beyond-95031.herokuapp.com request_id = cb0f1bca-7538-497b-b1f2-6af9756c80f4 fwd =94.77.202.2dyno = web.1 connect = 2ms service = 6ms状态= 503字节= 0
2017-01-05T17:03:41.855395 + 00:00 heroku [web.1]:状态从up变为崩溃
2017-01-05T17:03:41.856485 +00:00 heroku [web.1]:状态从崩溃状态变为启动
2017-01-05T17:03:41.842156 + 00:00 heroku [web.1]:进程已退出,状态为132
2017-01-05T17:03:45.147623 + 00:00 heroku [web.1]:使用命令`App --env = production --workdir =。/ --config:servers.default.port = 25036` $启动进程b $ b 2017-01-05T17:03:48.789403 + 00:00 heroku [web.1]:状态改变了f ROM启动到
2017-01-05T17:04:29.863680 + 00:00 heroku [router]:at = info method = GET path =/host = dry-beyond-95031.herokuapp.com request_id = 82133ef0-4539-4095-b3a9-e4d0c4bc709c fwd =94.77.202.2dyno = web.1 connect = 0ms service = 5ms status = 404 bytes = 119
2017-01-05T17:04:38.544040 + 00:00 heroku [router]:at = info method = GET path =/host = dry-beyond-95031.herokuapp.com request_id = 258ab0c8-df6e-4ad2-a220-cb27f854a1bd fwd =94.77.202.2dyno = web。 1 connect = 0ms service = 2ms status = 404 bytes = 119
2017-01-05T17:05:43.705482 + 00:00 heroku [web.1]:进程已退出,状态为132
2017-01- 05T17:05:43.718722 + 00:00 heroku [web.1]:状态从up改为崩溃
2017-01-05T17:05:43.608207 + 00:00 heroku [router]:at = error code = H13 desc =连接关闭无响应方法= POST路径=/是否主机= dry-beyond-95031.herokuapp.com request_id = 1a343b3b-963e-45b0-9795-1f83351b0100 fwd =94.77.202.2dyno = web。 1 connect = 1ms service = 6ms status = 503 bytes = 0
2017-01-05T17:08:54.1 12283 + 00:00 heroku [router]:at = error code = H10 desc =App crashedmethod = POST path =/ whetherhost = dry-beyond-95031.herokuapp.com request_id = 5fcfc4a8-d8da-4e45- b8d1-99a8c14c1529 fwd =94.77.202.2dyno = connect = service = status = 503 bytes =
2017-01-05T17:10:3​​4.292205 + 00:00 heroku [router]:at = error code = H10 desc =App crashedmethod = POST path =/ whetherhost = dry-beyond-95031.herokuapp.com request_id = 75035a40-c1ca-4fc9-8cd1-10f73c5a4b84 fwd =94.77.202.2dyno = connect = service = status = 503字节=
2017-01-05T17:17:45.483824 + 00:00 heroku [slug-compiler]:弹头编译开始
2017-01-05T17:17:45.483833 + 00:00 heroku [ slug-compiler]:Slug编译完成
2017-01-05T17:17:45.350717 + 00:00 app [api]:用户部署c3d8250 naifdev@gmail.com
2017-01-05T17:17 :45.350717 + 00:00 app [api]:用户创建的第4版naifdev@gmail.com
2017-01-05T17:17:45.706244 + 00:00 heroku [web.1]:状态从崩溃状态变为起价
2017-01-05T17:17:48.678813 + 00:00 heroku [web.1]:使用命令`App --env = production --workdir =。/ --config:servers.default.port = 53088`
2017-01-05T17:17:52.352793 + 00:00 heroku [web。 1]:状态从开始更改为
2017-01-05T17:18:25.670087 + 00:00 heroku [router]:at = info method = POST path =/是否host = dry-beyond-95031 .herokuapp.com request_id = 9cec4496-95c5-4157-8dea-002310af4eaf fwd =94.77.202.2dyno = web.1 connect = 1ms service = 27ms status = 500 bytes = 138
2017-01-05T17:51 :55.253360 + 00:00 heroku [web.1]:怠速
2017-01-05T17:51:55.254766 + 00:00 heroku [web.1]:状态由上升至下降
2017- 01-05T17:51:55.780574 + 00:00 app [web.1]:没有提供命令,默认提供...
2017-01-05T17:51:55.780578 + 00:00 app [web.1 ]:服务器'默认'开始于0.0.0.0:53088
2017-01-05T17:51:55.780562 + 00:00应用[web.1]:启用生产模式,禁用信息日志。
2017-01-05T17:51:55.780575 + 00:00 app [web.1]:没有准备。
2017-01-05T17:51:55.780579 + 00:00 app [web.1]:[已弃用] Mozilla证书已弃用,将在未来的版本中删除。改用'defaults'。
2017-01-05T17:51:55.774837 + 00:00 heroku [web.1]:使用SIGTERM
停止所有进程2017-01-05T17:51:55.895627 + 00:00 heroku [web。 1]:退出状态15
2017-01-05T18:01:48.893674 + 00:00 heroku [web.1]:Unidling
2017-01-05T18:01:48.893975 + 00:00 heroku [web.1]:从下往上开始
2017-01-05T18:01:53.364634 + 00:00 heroku [web.1]:用命令`App --env = production - workdir = ./ --config:servers.default.port = 21483`
2017-01-05T18:01:57.090891 + 00:00 heroku [web.1]:状态从开始更改为
2017-01-05T18:01:58.019181 + 00:00 heroku [router]:at = info method = POST path =/host = dry-beyond-95031.herokuapp.com request_id = ed174181-b3c9-4196-bd39 -29121c343ea6 fwd =94.77.202.2dyno = web.1 connect = 0ms service = 41ms status = 500 bytes = 138
2017-01-05T18:34:12.945697 + 00:00 heroku [web.1]:闲置
2017-01-05T18:34:12.946307 + 00:00 heroku [web.1]:状态从上往下变化
2017-01-05T18:34:13.855518 + 00:00 app [ w ^ eb.1]:启用生产模式,禁用信息日志。
2017-01-05T18:34:13.855528 + 00:00 app [web.1]:没有提供命令,默认服务...
2017-01-05T18:34:13.855529 + 00: 00应用[web.1]:没有准备。
2017-01-05T18:34:13.855530 + 00:00 app [web.1]:服务器'默认'起始于0.0.0.0:21483
2017-01-05T18:34:13.855531 + 00 :00 app [web.1]:[弃用] Mozilla证书已被弃用,并将在未来版本中删除。改用'defaults'。
2017-01-05T18:34:13.848202 + 00:00 heroku [web.1]:用SIGTERM
停止所有进程2017-01-05T18:34:13.932737 + 00:00 heroku [web。 1]:进程退出状态15
2017-01-06T07:44:31.444744 + 00:00 heroku [web.1]:Unidling
2017-01-06T07:44:31.444992 + 00:00 heroku [web.1]:状态从下往上变为
2017-01-06T07:44:34.523300 + 00:00 heroku [web.1]:用命令`App --env = production - workdir = ./ --config:servers.default.port = 31252`
2017-01-06T07:44:36.676936 + 00:00 heroku [web.1]:状态从开始更改为
2017-01-06T07:44:37.549125 + 00:00 heroku [router]:at = info method = POST path =/host = dry-beyond-95031.herokuapp.com request_id = 0355d39f-cda9-4f8b-888b -18082332a824 fwd =94.99.227.109dyno = web.1 connect = 0ms service = 26ms status = 500 bytes = 138
2017-01-06T07:50:51.627447 + 00:00 heroku [router]:at = info method = POST path =/host = dry-beyond-95031.herokuapp.com request_id = 11ee0882-1bd1-43a2-a0cc-4bc1c11f74eb fwd =94.99 .227.109dyno = web.1 connect = 0ms service = 27ms status = 500 bytes = 138
2017-01-06T07:57:45.954329 + 00:00 heroku [router]:at = info method = POST path = /是否host = dry-beyond-95031.herokuapp.com request_id = e4ca9186-fdc5-4cd8-b98b-cfee45c7f3b2 fwd =94.99.227.109dyno = web.1 connect = 0ms service = 213ms status = 500 bytes = 138
2017-01-06T08:04:00.591772 + 00:00 heroku [router]:at = info method = POST path =/host = dry-beyond-95031.herokuapp.com request_id = b664a4c2-5aef -43b8-9c9f-180dfabeb93d fwd =94.99.227.109dyno = web.1 connect = 0ms service = 23ms status = 500 bytes = 138
2017-01-06T08:04:57.818556 + 00:00 heroku [router ]:at = info method = GET path =/host = dry-beyond-95031.herokuapp.com request_id = 4ea215b8-a0a3-4ad0-9d8a-45fe27dbafd0 fwd =94.99.227.109dyno = web.1 connect = 0ms service = 4ms status = 404 bytes = 119
2017-01-06T08:04:58.069106 + 00:00 heroku [router]:at = info method = GET path =/ favicon.icohost = dry-beyond -95031.herokuapp.com request_id = 04affbf0-ded7-4eb1-845c-e569aa31107c fwd =94.99。 227.109dyno = web.1 connect = 0ms service = 2ms status = 404 bytes = 161
2017-01-06T08:05:26.089377 + 00:00 heroku [router]:at = info method = POST path = /是否host = dry-beyond-95031.herokuapp.com request_id = 3c5ba6df-acec-4b27-a3f4-e3c0f27941c2 fwd =94.99.227.109dyno = web.1 connect = 0ms service = 400ms status = 500 bytes = 138
2017-01-06T08:05:32.043519 + 00:00 heroku [router]:at = info method = GET path =/host = dry-beyond-95031.herokuapp.com request_id = 9d35561a-633b-42c9 -8fb6-6ec423bf667c fwd =94.99.227.109dyno = web.1 connect = 0ms service = 2ms status = 404 bytes = 119
2017-01-06T08:05:40.163170 + 00:00 heroku [router]: at = info method = GET path =/ huguhhost = dry-beyond-95031.herokuapp.com request_id = 7a11db63-7644-4e42-a662-e223cb154171 fwd =94.99.227.109dyno = web.1 connect = 0ms service = 2ms status = 404 bytes = 119
2017-01-06T08:13:43.406289 + 00:00 heroku [router]:at = info method = GET path =/是否host = dry-beyond-95031。 herokuapp.com request_id = f672e00b-db30-484c-a5da-01f8e57022f4 fwd =94.99.227.109d yno = web.1 connect = 0ms service = 2ms status = 404 bytes = 161
2017-01-06T08:13:55.835147 + 00:00 heroku [router]:at = info method = GET path =/是否host = dry-beyond-95031.herokuapp.com request_id = adb06e24-72cc-4b79-9d23-8a5ea127d2a3 fwd =94.99.227.109dyno = web.1 connect = 0ms service = 1ms status = 404 bytes = 161
2017-01-06T08:45:25.599867 + 00:00 heroku [web.1]:怠速
2017-01-06T08:45:25.600941 + 00:00 heroku [web.1]:状态从up to down
2017-01-06T08:45:26.264901 + 00:00 heroku [web.1]:用SIGTERM
停止所有进程2017-01-06T08:45:26.280223 + 00:00 app [ web.1]:启用生产模式,禁用信息日志。
2017-01-06T08:45:26.280240 + 00:00 app [web.1]:没有提供命令,默认提供...
2017-01-06T08:45:26.280241 + 00: 00应用[web.1]:没有准备。
2017-01-06T08:45:26.280241 + 00:00 app [web.1]:服务器'默认'起始于0.0.0.0:31252
2017-01-06T08:45:26.280242 + 00 :00 app [web.1]:[弃用] Mozilla证书已被弃用,并将在未来版本中删除。改用'defaults'。
2017-01-06T08:45:26.280243 + 00:00 app [web.1]:[已弃用] Mozilla证书已被弃用,并将在未来版本中删除。改用'defaults'。
2017-01-06T08:45:26.280244 + 00:00 app [web.1]:[已弃用] Mozilla证书已被弃用,并将在未来版本中删除。改用'defaults'。
2017-01-06T08:45:26.280244 + 00:00 app [web.1]:[已弃用] Mozilla证书已被弃用,并将在未来版本中删除。改用'defaults'。
2017-01-06T08:45:26.280245 + 00:00 app [web.1]:无法加载路径
2017-01-06T08:45:26.280246 + 00:00 app [web.1 ]:[弃用] Mozilla证书已被弃用,并将在未来的版本中删除。改用'defaults'。
2017-01-06T08:45:26.280246 + 00:00 app [web.1]:无法加载路径
2017-01-06T08:45:26.369735 + 00:00 heroku [web.1 ]:进程退出状态15
2017-01-06T18:01:52.724336 + 00:00 heroku [web.1]:unidling
2017-01-06T18:01:52.724823 + 00:00 heroku [web.1]:状态从下往上变为
2017-01-06T18:01:56.197941 + 00:00 heroku [web.1]:使用命令`App --env = production --workdir启动进程=。/ --config:servers.default.port = 51652`
2017-01-06T18:01:59.779285 + 00:00 heroku [web.1]:状态从开始更改为
2017 -01-06T18:02:00.857405 + 00:00 heroku [router]:at = info method = GET path =/host = dry-beyond-95031.herokuapp.com request_id = 39353fc7-8f70-49b4-95b0- 12b4f2e0980a fwd =94.99.227.109dyno = web.1 connect = 1ms service = 4ms status = 404 bytes = 161
2017-01-06T18:36:26.460178 + 00:00 heroku [web.1]:怠速
2017-01-06T18:36:26.460594 + 00:00 heroku [web.1]:状态由上往下变更
2017-01-06T18:36:27.237564 + 00:00 heroku [web .1]:停止所有使用SIGTERM
2017-01-06T18:36:27.390324 + 00:00的进程heroku [web.1]:进程退出状态15
2017-01-06T18:36:27.262126 + 00:00应用程序[web.1]:启用生产模式,禁用信息日志。
2017-01-06T18:36:27.262141 + 00:00 app [web.1]:没有提供命令,默认服务...
2017-01-06T18:36:27.262142 + 00: 00应用[web.1]:没有准备。
2017-01-06T18:36:27.262143 + 00:00 app [web.1]:服务器'默认'起始于0.0.0.0:51652
2017-01-06T19:13:59.497901 + 00 :00 heroku [slug-compiler]:弹头编译开始
2017-01-06T19:13:59.497911 + 00:00 heroku [slug-compiler]:弹头编译完成
2017-01-06T19:13 :59.336403 + 00:00 app [api]:部署fa16ad6,由用户naifdev@gmail.com
2017-01-06T19:13:59.336403 + 00:00 app [api]:由用户naifdev @ gmail创建的发布v5 .com
2017-01-06T19:13:59.722058 + 00:00 heroku [web.1]:状态从下降改为开始
2017-01-06T19:14:02.835500 + 00:00 heroku [web.1]:使用命令`App --env = production --workdir =。/ --config:servers.default.port = 8308`开始处理
2017-01-06T19:14:06.609232 + 00 :00 heroku [web.1]:状态从开始更改为
2017-01-06T19:14:38.480190 + 00:00 heroku [router]:at = info method = GET path =/是否?city = Parishost = dry-beyond-95031.herokuapp.com request_id = 26c5f8bb-eb3b-47be-8fd2-799dfc4aed66 fwd =94.99.227.109dyno = web.1 con nect = 1ms service = 24ms status = 500 bytes = 138
2017-01-06T19:17:53.744114 + 00:00 heroku [router]:at = info method = GET path =/ whether?city = Paris host = dry-beyond-95031.herokuapp.com request_id = 8414a869-8d81-480a-8a74-51cf​​b3644bbf fwd =94.99.227.109dyno = web.1 connect = 1ms service = 221ms status = 500 bytes = 138
2017-01-06T19:18:06.721140 + 00:00 heroku [router]:at = info method = GET path =/是否?city = Parishost = dry-beyond-95031.herokuapp.com request_id = 04a1b568-bfe1 -4643-9a34-fce7b23eb325 fwd =94.99.227.109dyno = web.1 connect = 1ms service = 22ms status = 500 bytes = 138


解决方案

在Slack频道中的一位用户让我对这个问题有了深入的了解:

VZSG:
@animatronicgopher:在Heroku上进行试验很便宜,但是因为这个原因,扩展到付费dynos是毫无意义的。它并没有改变 - 首先,这个错误是由HTTP 客户端生成的,所以你的服务器的证书并不重要,其次,即使免费的dynos也有适当的证书(而且它们不仅仅是letsencrypt证书)。实际的问题是,默认HTTPClient不关心dyno的受信任根证书,因此,传出的SSL连接不能验证 - >错误。

另外,GitHub中存在一个问题,它提供了一个如何使用FoundationClient的示例。
https://github.com/vapor/vapor/issues/699


I have created a very simple app with one route in main.swift. It reads a city from a query string and use it to get the weather (through the yahoo API) of that city. this is the route:

drop.get("whether") { request in


    guard let city = request.data["city"]?.string else {
        return try JSON(node: ["Error": "no city given"])
    }

    return try drop.client.get("https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22\(city)%22)&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys")
}

The code works perfectly when I run it on localhost, but I get a 500 error when I deploy it with Heroku.

Is there any file that I shouldn't be pushing to heroku? I want to note that in server.json the host value is 0.0.0.0.

This is my Heroku logs (note that I redeployed it multiple times. all of which didn't work):

2017-01-05T17:00:28.932559+00:00 heroku[router]: at=info method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=10bd5717-a444-4106-9479-5dda7de686d1 fwd="94.77.202.2" dyno=web.1 connect=1ms service=24ms status=500 bytes=138
2017-01-05T17:00:34.568980+00:00 heroku[router]: at=info method=GET path="/whether" host=dry-beyond-95031.herokuapp.com request_id=88277ee9-5814-4e33-a180-69e2a36a10ac fwd="94.77.202.2" dyno=web.1 connect=0ms service=2ms status=404 bytes=161
2017-01-05T17:00:50.620499+00:00 heroku[router]: at=info method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=e9e03939-3252-4eb2-ba05-ed06b7123fc0 fwd="94.77.202.2" dyno=web.1 connect=0ms service=20ms status=500 bytes=138
2017-01-05T17:03:30.089070+00:00 heroku[router]: at=info method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=d3334e79-bdaf-4f51-a6fe-198a356c2c8a fwd="94.77.202.2" dyno=web.1 connect=0ms service=31ms status=500 bytes=138
2017-01-05T17:03:41.773239+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=cb0f1bca-7538-497b-b1f2-6af9756c80f4 fwd="94.77.202.2" dyno=web.1 connect=2ms service=6ms status=503 bytes=0
2017-01-05T17:03:41.855395+00:00 heroku[web.1]: State changed from up to crashed
2017-01-05T17:03:41.856485+00:00 heroku[web.1]: State changed from crashed to starting
2017-01-05T17:03:41.842156+00:00 heroku[web.1]: Process exited with status 132
2017-01-05T17:03:45.147623+00:00 heroku[web.1]: Starting process with command `App --env=production --workdir=./ --config:servers.default.port=25036`
2017-01-05T17:03:48.789403+00:00 heroku[web.1]: State changed from starting to up
2017-01-05T17:04:29.863680+00:00 heroku[router]: at=info method=GET path="/" host=dry-beyond-95031.herokuapp.com request_id=82133ef0-4539-4095-b3a9-e4d0c4bc709c fwd="94.77.202.2" dyno=web.1 connect=0ms service=5ms status=404 bytes=119
2017-01-05T17:04:38.544040+00:00 heroku[router]: at=info method=GET path="/whether" host=dry-beyond-95031.herokuapp.com request_id=258ab0c8-df6e-4ad2-a220-cb27f854a1bd fwd="94.77.202.2" dyno=web.1 connect=0ms service=2ms status=404 bytes=119
2017-01-05T17:05:43.705482+00:00 heroku[web.1]: Process exited with status 132
2017-01-05T17:05:43.718722+00:00 heroku[web.1]: State changed from up to crashed
2017-01-05T17:05:43.608207+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=1a343b3b-963e-45b0-9795-1f83351b0100 fwd="94.77.202.2" dyno=web.1 connect=1ms service=6ms status=503 bytes=0
2017-01-05T17:08:54.112283+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=5fcfc4a8-d8da-4e45-b8d1-99a8c14c1529 fwd="94.77.202.2" dyno= connect= service= status=503 bytes=
2017-01-05T17:10:34.292205+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=75035a40-c1ca-4fc9-8cd1-10f73c5a4b84 fwd="94.77.202.2" dyno= connect= service= status=503 bytes=
2017-01-05T17:17:45.483824+00:00 heroku[slug-compiler]: Slug compilation started
2017-01-05T17:17:45.483833+00:00 heroku[slug-compiler]: Slug compilation finished
2017-01-05T17:17:45.350717+00:00 app[api]: Deploy c3d8250 by user naifdev@gmail.com
2017-01-05T17:17:45.350717+00:00 app[api]: Release v4 created by user naifdev@gmail.com
2017-01-05T17:17:45.706244+00:00 heroku[web.1]: State changed from crashed to starting
2017-01-05T17:17:48.678813+00:00 heroku[web.1]: Starting process with command `App --env=production --workdir=./ --config:servers.default.port=53088`
2017-01-05T17:17:52.352793+00:00 heroku[web.1]: State changed from starting to up
2017-01-05T17:18:25.670087+00:00 heroku[router]: at=info method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=9cec4496-95c5-4157-8dea-002310af4eaf fwd="94.77.202.2" dyno=web.1 connect=1ms service=27ms status=500 bytes=138
2017-01-05T17:51:55.253360+00:00 heroku[web.1]: Idling
2017-01-05T17:51:55.254766+00:00 heroku[web.1]: State changed from up to down
2017-01-05T17:51:55.780574+00:00 app[web.1]: No command supplied, defaulting to serve...
2017-01-05T17:51:55.780578+00:00 app[web.1]: Server 'default' starting at 0.0.0.0:53088
2017-01-05T17:51:55.780562+00:00 app[web.1]: Production mode enabled, disabling informational logs.
2017-01-05T17:51:55.780575+00:00 app[web.1]: No preparations.
2017-01-05T17:51:55.780579+00:00 app[web.1]: [deprecated] Mozilla certificates have been deprecated and will be removed in future releases. Using 'defaults' instead.
2017-01-05T17:51:55.774837+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-01-05T17:51:55.895627+00:00 heroku[web.1]: Process exited with status 15
2017-01-05T18:01:48.893674+00:00 heroku[web.1]: Unidling
2017-01-05T18:01:48.893975+00:00 heroku[web.1]: State changed from down to starting
2017-01-05T18:01:53.364634+00:00 heroku[web.1]: Starting process with command `App --env=production --workdir=./ --config:servers.default.port=21483`
2017-01-05T18:01:57.090891+00:00 heroku[web.1]: State changed from starting to up
2017-01-05T18:01:58.019181+00:00 heroku[router]: at=info method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=ed174181-b3c9-4196-bd39-29121c343ea6 fwd="94.77.202.2" dyno=web.1 connect=0ms service=41ms status=500 bytes=138
2017-01-05T18:34:12.945697+00:00 heroku[web.1]: Idling
2017-01-05T18:34:12.946307+00:00 heroku[web.1]: State changed from up to down
2017-01-05T18:34:13.855518+00:00 app[web.1]: Production mode enabled, disabling informational logs.
2017-01-05T18:34:13.855528+00:00 app[web.1]: No command supplied, defaulting to serve...
2017-01-05T18:34:13.855529+00:00 app[web.1]: No preparations.
2017-01-05T18:34:13.855530+00:00 app[web.1]: Server 'default' starting at 0.0.0.0:21483
2017-01-05T18:34:13.855531+00:00 app[web.1]: [deprecated] Mozilla certificates have been deprecated and will be removed in future releases. Using 'defaults' instead.
2017-01-05T18:34:13.848202+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-01-05T18:34:13.932737+00:00 heroku[web.1]: Process exited with status 15
2017-01-06T07:44:31.444744+00:00 heroku[web.1]: Unidling
2017-01-06T07:44:31.444992+00:00 heroku[web.1]: State changed from down to starting
2017-01-06T07:44:34.523300+00:00 heroku[web.1]: Starting process with command `App --env=production --workdir=./ --config:servers.default.port=31252`
2017-01-06T07:44:36.676936+00:00 heroku[web.1]: State changed from starting to up
2017-01-06T07:44:37.549125+00:00 heroku[router]: at=info method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=0355d39f-cda9-4f8b-888b-18082332a824 fwd="94.99.227.109" dyno=web.1 connect=0ms service=26ms status=500 bytes=138
2017-01-06T07:50:51.627447+00:00 heroku[router]: at=info method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=11ee0882-1bd1-43a2-a0cc-4bc1c11f74eb fwd="94.99.227.109" dyno=web.1 connect=0ms service=27ms status=500 bytes=138
2017-01-06T07:57:45.954329+00:00 heroku[router]: at=info method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=e4ca9186-fdc5-4cd8-b98b-cfee45c7f3b2 fwd="94.99.227.109" dyno=web.1 connect=0ms service=213ms status=500 bytes=138
2017-01-06T08:04:00.591772+00:00 heroku[router]: at=info method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=b664a4c2-5aef-43b8-9c9f-180dfabeb93d fwd="94.99.227.109" dyno=web.1 connect=0ms service=23ms status=500 bytes=138
2017-01-06T08:04:57.818556+00:00 heroku[router]: at=info method=GET path="/" host=dry-beyond-95031.herokuapp.com request_id=4ea215b8-a0a3-4ad0-9d8a-45fe27dbafd0 fwd="94.99.227.109" dyno=web.1 connect=0ms service=4ms status=404 bytes=119
2017-01-06T08:04:58.069106+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=dry-beyond-95031.herokuapp.com request_id=04affbf0-ded7-4eb1-845c-e569aa31107c fwd="94.99.227.109" dyno=web.1 connect=0ms service=2ms status=404 bytes=161
2017-01-06T08:05:26.089377+00:00 heroku[router]: at=info method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=3c5ba6df-acec-4b27-a3f4-e3c0f27941c2 fwd="94.99.227.109" dyno=web.1 connect=0ms service=400ms status=500 bytes=138
2017-01-06T08:05:32.043519+00:00 heroku[router]: at=info method=GET path="/" host=dry-beyond-95031.herokuapp.com request_id=9d35561a-633b-42c9-8fb6-6ec423bf667c fwd="94.99.227.109" dyno=web.1 connect=0ms service=2ms status=404 bytes=119
2017-01-06T08:05:40.163170+00:00 heroku[router]: at=info method=GET path="/huguh" host=dry-beyond-95031.herokuapp.com request_id=7a11db63-7644-4e42-a662-e223cb154171 fwd="94.99.227.109" dyno=web.1 connect=0ms service=2ms status=404 bytes=119
2017-01-06T08:13:43.406289+00:00 heroku[router]: at=info method=GET path="/whether" host=dry-beyond-95031.herokuapp.com request_id=f672e00b-db30-484c-a5da-01f8e57022f4 fwd="94.99.227.109" dyno=web.1 connect=0ms service=2ms status=404 bytes=161
2017-01-06T08:13:55.835147+00:00 heroku[router]: at=info method=GET path="/whether" host=dry-beyond-95031.herokuapp.com request_id=adb06e24-72cc-4b79-9d23-8a5ea127d2a3 fwd="94.99.227.109" dyno=web.1 connect=0ms service=1ms status=404 bytes=161
2017-01-06T08:45:25.599867+00:00 heroku[web.1]: Idling
2017-01-06T08:45:25.600941+00:00 heroku[web.1]: State changed from up to down
2017-01-06T08:45:26.264901+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-01-06T08:45:26.280223+00:00 app[web.1]: Production mode enabled, disabling informational logs.
2017-01-06T08:45:26.280240+00:00 app[web.1]: No command supplied, defaulting to serve...
2017-01-06T08:45:26.280241+00:00 app[web.1]: No preparations.
2017-01-06T08:45:26.280241+00:00 app[web.1]: Server 'default' starting at 0.0.0.0:31252
2017-01-06T08:45:26.280242+00:00 app[web.1]: [deprecated] Mozilla certificates have been deprecated and will be removed in future releases. Using 'defaults' instead.
2017-01-06T08:45:26.280243+00:00 app[web.1]: [deprecated] Mozilla certificates have been deprecated and will be removed in future releases. Using 'defaults' instead.
2017-01-06T08:45:26.280244+00:00 app[web.1]: [deprecated] Mozilla certificates have been deprecated and will be removed in future releases. Using 'defaults' instead.
2017-01-06T08:45:26.280244+00:00 app[web.1]: [deprecated] Mozilla certificates have been deprecated and will be removed in future releases. Using 'defaults' instead.
2017-01-06T08:45:26.280245+00:00 app[web.1]: unable to load path
2017-01-06T08:45:26.280246+00:00 app[web.1]: [deprecated] Mozilla certificates have been deprecated and will be removed in future releases. Using 'defaults' instead.
2017-01-06T08:45:26.280246+00:00 app[web.1]: unable to load path
2017-01-06T08:45:26.369735+00:00 heroku[web.1]: Process exited with status 15
2017-01-06T18:01:52.724336+00:00 heroku[web.1]: Unidling
2017-01-06T18:01:52.724823+00:00 heroku[web.1]: State changed from down to starting
2017-01-06T18:01:56.197941+00:00 heroku[web.1]: Starting process with command `App --env=production --workdir=./ --config:servers.default.port=51652`
2017-01-06T18:01:59.779285+00:00 heroku[web.1]: State changed from starting to up
2017-01-06T18:02:00.857405+00:00 heroku[router]: at=info method=GET path="/whether" host=dry-beyond-95031.herokuapp.com request_id=39353fc7-8f70-49b4-95b0-12b4f2e0980a fwd="94.99.227.109" dyno=web.1 connect=1ms service=4ms status=404 bytes=161
2017-01-06T18:36:26.460178+00:00 heroku[web.1]: Idling
2017-01-06T18:36:26.460594+00:00 heroku[web.1]: State changed from up to down
2017-01-06T18:36:27.237564+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-01-06T18:36:27.390324+00:00 heroku[web.1]: Process exited with status 15
2017-01-06T18:36:27.262126+00:00 app[web.1]: Production mode enabled, disabling informational logs.
2017-01-06T18:36:27.262141+00:00 app[web.1]: No command supplied, defaulting to serve...
2017-01-06T18:36:27.262142+00:00 app[web.1]: No preparations.
2017-01-06T18:36:27.262143+00:00 app[web.1]: Server 'default' starting at 0.0.0.0:51652
2017-01-06T19:13:59.497901+00:00 heroku[slug-compiler]: Slug compilation started
2017-01-06T19:13:59.497911+00:00 heroku[slug-compiler]: Slug compilation finished
2017-01-06T19:13:59.336403+00:00 app[api]: Deploy fa16ad6 by user naifdev@gmail.com
2017-01-06T19:13:59.336403+00:00 app[api]: Release v5 created by user naifdev@gmail.com
2017-01-06T19:13:59.722058+00:00 heroku[web.1]: State changed from down to starting
2017-01-06T19:14:02.835500+00:00 heroku[web.1]: Starting process with command `App --env=production --workdir=./ --config:servers.default.port=8308`
2017-01-06T19:14:06.609232+00:00 heroku[web.1]: State changed from starting to up
2017-01-06T19:14:38.480190+00:00 heroku[router]: at=info method=GET path="/whether?city=Paris" host=dry-beyond-95031.herokuapp.com request_id=26c5f8bb-eb3b-47be-8fd2-799dfc4aed66 fwd="94.99.227.109" dyno=web.1 connect=1ms service=24ms status=500 bytes=138
2017-01-06T19:17:53.744114+00:00 heroku[router]: at=info method=GET path="/whether?city=Paris" host=dry-beyond-95031.herokuapp.com request_id=8414a869-8d81-480a-8a74-51cfb3644bbf fwd="94.99.227.109" dyno=web.1 connect=1ms service=221ms status=500 bytes=138
2017-01-06T19:18:06.721140+00:00 heroku[router]: at=info method=GET path="/whether?city=Paris" host=dry-beyond-95031.herokuapp.com request_id=04a1b568-bfe1-4643-9a34-fce7b23eb325 fwd="94.99.227.109" dyno=web.1 connect=1ms service=22ms status=500 bytes=138

解决方案

A user in the Slack channel gave me insight to this problem.:

VZSG: @animatronicgopher: experimenting on Heroku is cheap but it's pretty pointless to scale up to paid dynos just because of this. It does not make a difference – first, this error is generated by an HTTP client, so your server's certificate doesn't matter, and second, even free dynos have proper certs (and they aren't just letsencrypt certs either). What you probably found is for custom domains.

The actual problem is that the "default" HTTPClient does not care about the dyno's trusted root certificates, therefore the outgoing SSL connection cannot be verified -> error.

Also, there's an issue in GitHub that gives you a sample of how to use FoundationClient. https://github.com/vapor/vapor/issues/699

这篇关于用heroku部署Vapor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆