首页 > 解决方案 > Matterbridge 没有在 Heroku 上启动 - 有没有办法可以检查平台上的构建情况?

问题描述

作为展示和演示版本,我想在 heroku 的免费计划中运行一个 mattebrige。为此,我从 patcon 找到了这个不错的存储库。他通过解释你如何将它作为 web dyno 以永久的方式运行它并在我眼中改进它,因此它也接受像 webhooks 这样的 hhtp 请求。为了部署应用程序,我决定采用 git push 方法。

我已经将 repo 从 patcon 克隆到我的 windows 机器,根据我的需要进行配置并将其推送到 heroku。一开始这不起作用,因为构建环境没有检测到构建包。所以我将环境变量 BUILDPACKS_URL 设置为https://github.com/patcon/matterbridge-heroku#master

之后构建成功,但存在多个问题。在日志中提到,执行 start.sh 和 envsubst 的权限被拒绝。就像提到的 Heroku 文档中一样,我使用 chmod +x 为 start.sh 和 lib/envsubst 创建了 .profile 文件。

所以 git 正在将行尾从 windows 格式转换为 linux 格式。但不是权限。最后我不知道下载是否有效。

Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 4 threads
Writing objects: 100% (3/3), 318 bytes | 318.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Matterbridge app detected
remote: -----> Downloading Matterbridge: https://github.com/42wim/matterbridge/releases/download/v1.17.5/matterbridge-linux-amd64
remote: -----> Discovering process types
remote:
remote: -----> Compressing...
remote: -----> Launching...
remote:        Released v35
remote:        https://???.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.

但即使我在 bin/compile 文件中更改了下载的路径和版本,它总是下载版本 v1.17.5。另外,如果我用 app.json 更改它。老实说,我只是猜测这个文件的作用。我想如果我想通过这个heroku按钮方法部署应用程序来设置环境变量时使用它。

以下消息表明,matterbridge 可执行文件未下载或位置不正确。

2020-06-19T17:37:13.074592+00:00 app[web.1]: [heroku-exec] Starting
2020-06-19T17:37:13.116550+00:00 app[web.1]: ./matterbridge: line 1: Not: command not found
2020-06-19T17:37:13.181167+00:00 heroku[web.1]: Process exited with status 127
2020-06-19T17:37:13.214787+00:00 heroku[web.1]: State changed from starting to crashed
2020-06-19T19:10:11.450748+00:00 heroku[web.1]: State changed from crashed to starting
2020-06-19T19:10:11.759082+00:00 heroku[web.1]: Starting process with command `./start.sh`
2020-06-19T19:10:14.649261+00:00 app[web.1]: [heroku-exec] Starting
2020-06-19T19:10:14.671276+00:00 app[web.1]: ./matterbridge: line 1: Not: command not found
2020-06-19T19:10:14.732134+00:00 heroku[web.1]: Process exited with status 127
2020-06-19T19:10:14.787002+00:00 heroku[web.1]: State changed from starting to crashed

heroku ps:exec如果我能看到文件夹结构,我试图查看。但是因为测功机在失败后退出是不可能的。而且我还尝试运行heroku local以查看该应用程序是否在本地构建。但事实并非如此。

就像我之前解释的那样,在推送和预构建时,当我配置它时它不会下载其他版本,我猜想激活了过度好的缓存。所以我尝试用heroku repo:purge_cache.

任何人都可以帮助我或给我一个提示。提前致谢

标签: httpgoherokuprecompiled

解决方案


哦哈!我在谷歌上搜索“envsubst heroku”时发现了这个,但后来看到我的名字并决定点击:)有点疯狂......!

无论如何,我认为您的问题是我根据 42wim 使用的二进制资产命名的旧格式对下载 url 进行了硬编码:

https://github.com/42wim/matterbridge/releases/download/vX.Y.Z/matterbridge-linux-amd64

看来他现在正在使用:

https://github.com/42wim/matterbridge/releases/download/vX.Y.Z/matterbridge-X.Y.Z-linux-amd64

因此,只需对直接下载链接进行硬编码或对 buildpack 进行修复就可以了(向后兼容意味着找到名称更改的开始位置,这应该是在 2018 年 12 月之后的某个时间,当时我正在处理这个问题)


推荐阅读