1

我对 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.

编辑:

打开debug=onconf.d/000-default文件后,报错是

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'
4

1 回答 1

3

这个错误可能有点误导。尝试从项目内部运行(setup.py 所在的目录):

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

这基本上会做和scrapy deploy一样的事情,但是它会显示更多的输出(你可以在tmp中更改目录的名称,这只是例如,scrapy在'-'之后随机生成一些东西)。

就我而言,我的项目中构建目录的权限存在问题(scrapy deploy 无法删除其中的旧文件),所以我只是删除了该目录,因为它无论如何都是自动生成的。

PS:我会留下评论,但我没有足够的声誉。

于 2014-08-11T11:34:01.027 回答