gpt4 book ai didi

python - Scrapyd 部署时权限被拒绝

转载 作者:行者123 更新时间:2023-11-30 23:20:51 25 4
gpt4 key购买 nike

我对 Scrapyd 非常陌生,正在尝试部署。我在 Ubuntu 12.04 上运行并安装了 Scrapyd 的 ubuntu 版本。当我运行 scrapy deploy default -p pull_scrapers 时,它返回

Packing version 1407616523
Deploying to project "pull_scrapers" in http://localhost:6800/addversion.json
Server response (200):
{"status": "error", "message": "[Errno 13] Permission denied:'/var/lib/scrapyd/eggs/pull_scrapers'"}


Any idea why this would be? I looks to be a credentials problem, but so far as I know it doesn't have any. Any help is appreciated.

编辑:

在conf.d/000-default文件中开启debug=on后,错误为

root@robert-GA-870A-UD3:/home/feed/Desktop/feed/scrapers# scrapy deploy default
Packing version 1407875943
Deploying to project "pull" in http://localhost:6800/addversion.json
Server response (200):
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/scrapyd/webservice.py", line 18, in render
return JsonResource.render(self, txrequest)
File "/usr/lib/pymodules/python2.7/scrapy/utils/txweb.py", line 10, in render
r = resource.Resource.render(self, txrequest)
File "/usr/lib/python2.7/dist-packages/twisted/web/resource.py", line 216, in render
return m(request)
File "/usr/lib/pymodules/python2.7/scrapyd/webservice.py", line 65, in render_POST
self.root.eggstorage.put(eggf, project, version)
File "/usr/lib/pymodules/python2.7/scrapyd/eggstorage.py", line 21, in put
makedirs(eggdir)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/var/lib/scrapyd/eggs/pull'

最佳答案

此错误可能会产生一定的误导。尝试从项目内部运行(setup.py 所在的目录):

python setup.py clean -a bdist_egg -d /tmp/scrapydeploy-8NnURF

这基本上会做与 scrapy 部署相同的事情,但它会显示更多的输出(您可以更改 tmp 中的目录名称,这只是例如,scrapy 在 '- 之后生成一些随机内容) ')。

就我而言,我的项目中的构建目录的权限有问题(scrapy部署无法删除里面的旧文件),所以我只是删除了该目录,因为它是自动生成的。

PS:我本来想发表评论,但我没有足够的声誉。

关于python - Scrapyd 部署时权限被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25222857/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com