Scrapyd权限在部署时被拒绝

时间:2014-08-09 20:41:30

标签: python ubuntu scrapy scrapyd

我对Scrapyd很新,我正在尝试部署。我在Ubuntu 12.04上运行并安装了Ubuntu版本的Scrapyd。当我运行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'

1 个答案:

答案 0 :(得分:3)

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

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

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

在我的情况下,我的项目中的构建目录的权限存在问题(scrapy部署无法删除里面的旧文件),所以我只删除了目录,因为它无论如何都会自动生成。

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