我是靠谱客的博主 外向蜻蜓,最近开发中收集的这篇文章主要介绍关于在django框架中celery运行beat报OSError: [WinError 87] 参数错误的史诗级大坑,觉得挺不错的,现在分享给大家,希望可以做个参考。
概述
OSError: [WinError 87] 参数错误。
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "d:anacondalibrunpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "d:anacondalibrunpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:AnacondaScriptscelery.exe__main__.py", line 7, in <module>
File "d:anacondalibsite-packagescelery__main__.py", line 30, in main
main()
File "d:anacondalibsite-packagescelerybincelery.py", line 81, in main
cmd.execute_from_commandline(argv)
File "d:anacondalibsite-packagescelerybincelery.py", line 770, in execute_from_commandline
super(CeleryCommand, self).execute_from_commandline(argv)))
File "d:anacondalibsite-packagescelerybinbase.py", line 311, in execute_from_commandline
return self.handle_argv(self.prog_name, argv[1:])
File "d:anacondalibsite-packagescelerybincelery.py", line 762, in handle_argv
return self.execute(command, argv)
File "d:anacondalibsite-packagescelerybincelery.py", line 694, in execute
File "d:anacondalibsite-packagescelerybinbase.py", line 315, in run_from_argv
sys.argv if argv is None else argv, command)
File "d:anacondalibsite-packagescelerybinbase.py", line 377, in handle_argv
return self(*args, **options)
File "d:anacondalibsite-packagescelerybinbase.py", line 274, in __call__
ret = self.run(*args, **kwargs)
File "d:anacondalibsite-packagescelerybinbeat.py", line 79, in run
return beat().run()
File "d:anacondalibsite-packagesceleryappsbeat.py", line 83, in run
self.start_scheduler()
File "d:anacondalibsite-packagesceleryappsbeat.py", line 95, in start_scheduler
platforms.create_pidlock(self.pidfile)
File "d:anacondalibsite-packagesceleryplatforms.py", line 255, in create_pidlock
pidlock = _create_pidlock(pidfile)
File "d:anacondalibsite-packagesceleryplatforms.py", line 262, in _create_pidlock
if pidlock.is_locked() and not pidlock.remove_if_stale():
File "d:anacondalibsite-packagesceleryplatforms.py", line 200, in remove_if_stale
os.kill(pid, 0)
SystemError: <class 'OSError'> returned a result with an error set
运行beat的时候报这个错误,网上都说是版本问题,需要把版本从4.0+降为3.0+,可我的已经是3.1.19了还是有这个错误
我去源码里看了一下,意思好像是杀掉之前的进程失败导致的(os.kill(pid,****)这个代码出错了),我联想到之前beat停止之后再运行会说当前已有beat再运行,需要删除目录里的celerybeat.pid文件,我试了一下,把他删掉了
竟然跑通了(他喵的
最后
以上就是外向蜻蜓为你收集整理的关于在django框架中celery运行beat报OSError: [WinError 87] 参数错误的史诗级大坑的全部内容,希望文章能够帮你解决关于在django框架中celery运行beat报OSError: [WinError 87] 参数错误的史诗级大坑所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复