SpiderClub / haipproxy

:sparkling_heart: High available distributed ip proxy pool, powerd by Scrapy and Redis
https://spiderclub.github.io/haipproxy/
MIT License
5.43k stars 914 forks source link

调度启动失败 #43

Closed ColorfulGhost closed 6 years ago

ColorfulGhost commented 6 years ago
2018-04-13 11:20:22 [validator] INFO: crawler scheduler is starting...
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/usr/local/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar
    return list(map(*args))
  File "/custom-disk1/haipproxy-0.1/scheduler/scheduler.py", line 112, in schedule_task_with_lock
    if not r or (now - int(r.decode('utf-8'))) >= internal * 60:
TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "scheduler_booter.py", line 22, in <module>
    scheduler_start()
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/custom-disk1/haipproxy-0.1/scheduler/scheduler.py", line 186, in scheduler_start
    scheduler.schedule_all_right_now()
  File "/custom-disk1/haipproxy-0.1/scheduler/scheduler.py", line 73, in schedule_all_right_now
    pool.map(self.schedule_task_with_lock, self.tasks)
  File "/usr/local/lib/python3.6/multiprocessing/pool.py", line 266, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/usr/local/lib/python3.6/multiprocessing/pool.py", line 644, in get
    raise self._value
TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'
ResolveWang commented 6 years ago

麻烦提供详细过程。 不明白你下载的什么版本?同时不清楚你是如何操作的

ColorfulGhost commented 6 years ago

0.1版本 执行:python3 scheduler_booter.py的时候报错 ,如何排查这个问题呢?

ResolveWang commented 6 years ago

文档写了

python scheduler_booter.py --usage crawler

python scheduler_booter.py --usage validator

麻烦仔细读读项目的流程和有些什么组件。你运行调度器至少得指定调度哪个东西吧?

ColorfulGhost commented 6 years ago

这个我知道 ,但是无论写不写参数它都一样出现这个问题 , python3 scheduler_booter.py --usage validator iciba python3.6 scheduler_booter.py --usage crawler common ajax 也一样

ResolveWang commented 6 years ago

没道理啊。以前没用户反馈过这个问题,我今晚测试一下吧。你能具体说说你的环境和配置操作过程吗? iciba这个是你写的检验器吗?你先拉一个未改动的代码下来运行试试吧,看看有不有这个问题

ResolveWang commented 6 years ago

@ColorfulGhost 你好,晚上我测试了。我这边没法复现你这个问题。看报错可能是

if not r or (now - int(r.decode('utf-8'))) >= internal * 60:

这段代码的问题。它位于scheduler.py, 你可以调试一下,主要是看 r是否为None,然后打印一下

now - int(r.decode('utf-8'))

这个变量,看它是否为None,错误很可能是出在这里