FileNotFoundError:将启动推送到heroku后[Errno 2]

时间:2019-05-31 14:05:21

标签: linux docker heroku scrapy-splash

enter image description here

我正在尝试部署最新的scrapinghub / splash

我在win10上使用git-bash。我将回购分叉到https://github.com/kc1/splash/blob/master

并且我一直在尝试遵循Using docker, scrapy splash on Heroku来修改docker文件

在使用Linux行结尾克隆仓库后,使用以下命令:

git clone --config core.eol=lf <repository>

我能够使用heroku命令行推送整个仓库 与:

$ heroku container:push web --app MYAPP

这样做之后:

$ heroku container:release web --app MYAPP

我得到了屏幕截图。日志显示:

2019-05-26T15:38:29.843665+00:00 app[api]: Initial release by user myemail@gmail.com
2019-05-26T15:38:29.843665+00:00 app[api]: Release v1 created by user myemail@gmail.com
2019-05-26T15:38:29.961092+00:00 app[api]: Enable Logplex by user myemail@gmail.com
2019-05-26T15:38:29.961092+00:00 app[api]: Release v2 created by user myemail@gmail.com
2019-05-31T00:33:50.361100+00:00 app[api]: Deployed web (0f79ef2df7e0) by user myemail@gmail.com
2019-05-31T00:33:50.361100+00:00 app[api]: Release v3 created by user myemail@gmail.com
2019-05-31T00:33:50.384143+00:00 app[api]: Scaled to web@1:Free by user myemail@gmail.com
2019-05-31T00:34:11.839319+00:00 heroku[web.1]: Starting process with command `python3 /app/bin/ --proxy-profiles-path /etc/splash/proxy-profiles --js-profiles-path /etc/splash/j
s-profiles --filters-path /etc/splash/filters --lua-package-path /etc/splash/lua_modules/\?.lua`
2019-05-31T00:34:14.755233+00:00 heroku[web.1]: State changed from starting to crashed
2019-05-31T00:34:14.761282+00:00 heroku[web.1]: State changed from crashed to starting
2019-05-31T00:34:14.303540+00:00 app[web.1]: 2019-05-31 00:34:14+0000 [-] Log opened.
2019-05-31T00:34:14.313531+00:00 app[web.1]: 2019-05-31 00:34:14.313300 [-] Splash version: 3.3.1
2019-05-31T00:34:14.314106+00:00 app[web.1]: 2019-05-31 00:34:14.313966 [-] Qt 5.9.1, PyQt 5.9.2, WebKit 602.1, sip 4.19.4, Twisted 18.9.0, Lua 5.2
2019-05-31T00:34:14.314211+00:00 app[web.1]: 2019-05-31 00:34:14.314091 [-] Python 3.5.2 (default, Nov 12 2018, 13:43:14) [GCC 5.4.0 20160609]
2019-05-31T00:34:14.314389+00:00 app[web.1]: 2019-05-31 00:34:14.314272 [-] Open files limit: 10000
2019-05-31T00:34:14.314520+00:00 app[web.1]: 2019-05-31 00:34:14.314422 [-] Can't bump open files limit
2019-05-31T00:34:14.419597+00:00 app[web.1]: 2019-05-31 00:34:14.419191 [-] Xvfb is started: ['Xvfb', ':619246574', '-screen', '0', '1024x768x24', '-nolisten', 'tcp']
2019-05-31T00:34:14.424473+00:00 app[web.1]: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-u25688'
2019-05-31T00:34:14.529826+00:00 app[web.1]: 2019-05-31 00:34:14.529418 [-] Traceback (most recent call last):
2019-05-31T00:34:14.530015+00:00 app[web.1]: 2019-05-31 00:34:14.529832 [-]   File "/app/bin/splash", line 4, in <module>
2019-05-31T00:34:14.530571+00:00 app[web.1]: 2019-05-31 00:34:14.530383 [-]     main()
2019-05-31T00:34:14.530806+00:00 app[web.1]: 2019-05-31 00:34:14.530607 [-]   File "/app/splash/server.py", line 394, in main
2019-05-31T00:34:14.531405+00:00 app[web.1]: 2019-05-31 00:34:14.531215 [-]     disable_browser_caches=opts.disable_browser_caches
2019-05-31T00:34:14.531619+00:00 app[web.1]: 2019-05-31 00:34:14.531439 [-]   File "/app/splash/server.py", line 273, in default_splash_server
2019-05-31T00:34:14.532121+00:00 app[web.1]: 2019-05-31 00:34:14.531941 [-]     disable_browser_caches=disable_browser_caches,
2019-05-31T00:34:14.532335+00:00 app[web.1]: 2019-05-31 00:34:14.532158 [-]   File "/app/splash/network_manager.py", line 58, in __init__
2019-05-31T00:34:14.532731+00:00 app[web.1]: 2019-05-31 00:34:14.532551 [-]     self.adblock_rules = AdblockRulesRegistry(filters_path, verbosity=verbosity)
2019-05-31T00:34:14.532939+00:00 app[web.1]: 2019-05-31 00:34:14.532768 [-]   File "/app/splash/request_middleware.py", line 162, in __init__
2019-05-31T00:34:14.533389+00:00 app[web.1]: 2019-05-31 00:34:14.533210 [-]     self._load(path)
2019-05-31T00:34:14.533599+00:00 app[web.1]: 2019-05-31 00:34:14.533425 [-]   File "/app/splash/request_middleware.py", line 186, in _load
2019-05-31T00:34:14.534038+00:00 app[web.1]: 2019-05-31 00:34:14.533857 [-]     for fname in os.listdir(path):
2019-05-31T00:34:14.534271+00:00 app[web.1]: 2019-05-31 00:34:14.534100 [-] FileNotFoundError: [Errno 2] No such file or directory: '/etc/splash/filters'
2019-05-31T00:34:14.738407+00:00 heroku[web.1]: Process exited with status 1

我该如何解决?

1 个答案:

答案 0 :(得分:0)

我还没有测试过如何自己部署它,但是当我阅读Docker文件时,我看到了导致您错误的可能原因。

在Dockerfile中,Volume映射器具有注释掉的代码行,该代码行将虚拟环境映射到包含splash/filters的物理文件空间。我不知道为什么图像的作者会这样做,但是它与您的错误代码一致。

因此,在Dockerfile中,将卷映射器取消注释到splash / filter目录

VOLUME [ \
    "/etc/splash/proxy-profiles", \
    "/etc/splash/js-profiles", \
    "/etc/splash/filters", \ ##UNCOMMENTED LINE
    "/etc/splash/lua_modules" \
]
相关问题