Repository navigation
RuntimeError: threads can only be started once #1254
Copy link
Copy link
Closed
Labels
Description
Expected behaviour:
While daemon running, I should still be able to run a manual execution.
Actual behaviour:
It's seeing process is there but crashes because of Runtime error regards threads.
Steps to reproduce:
- Step 1: start daemon
flexget daemon start -d - Step 2: run standard execution
flexget execute --verbose
Log:
There is a FlexGet process already running for this config, sending execution there.
Traceback (most recent call last):
File "/opt/bin/flexget", line 11, in <module>
sys.exit(main())
File "/opt/lib/python3.5/site-packages/flexget/__init__.py", line 42, in main
manager.start()
File "/opt/lib/python3.5/site-packages/flexget/manager.py", line 294, in start
client.handle_cli(self.args)
File "/opt/lib/python3.5/site-packages/rpyc/core/netref.py", line 196, in __call__
return syncreq(_self, consts.HANDLE_CALL, args, kwargs)
File "/opt/lib/python3.5/site-packages/rpyc/core/netref.py", line 71, in syncreq
return conn.sync_request(handler, oid, *args)
File "/opt/lib/python3.5/site-packages/rpyc/core/protocol.py", line 441, in sync_request
raise obj
RuntimeError: threads can only be started once
========= Remote Traceback (1) =========
Traceback (most recent call last):
File "/opt/lib/python3.5/site-packages/rpyc/core/protocol.py", line 305, in _dispatch_request
res = self._HANDLERS[handler](self, *args)
File "/opt/lib/python3.5/site-packages/rpyc/core/protocol.py", line 535, in _handle_call
return self._local_objects[oid](*args, **dict(kwargs))
File "/opt/lib/python3.5/site-packages/flexget/ipc.py", line 80, in exposed_handle_cli
self.manager.handle_cli(options)
File "/opt/lib/python3.5/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/opt/lib/python3.5/site-packages/flexget/logger.py", line 88, in capture_output
yield
File "/opt/lib/python3.5/site-packages/flexget/ipc.py", line 80, in exposed_handle_cli
self.manager.handle_cli(options)
File "/opt/lib/python3.5/site-packages/flexget/manager.py", line 333, in handle_cli
self.execute_command(command_options)
File "/opt/lib/python3.5/site-packages/flexget/manager.py", line 365, in execute_command
self.task_queue.start()
File "/opt/lib/python3.5/site-packages/flexget/task_queue.py", line 35, in start
self._thread.start()
File "/opt/lib/python3.5/threading.py", line 840, in start
raise RuntimeError("threads can only be started once")
RuntimeError: threads can only be started once
Additional information:
- Flexget Version: 2.1.1
- Python Version: 3.5
- Installation method: pip install
- OS and version: Android 4.4 AMLogic s805
Reactions are currently unavailable
Activity
orlandosantos commentedon Aug 10, 2016
I've got the same error message;
There is a FlexGet process already running for this config, sending execution there.
Traceback (most recent call last):
File "./bin/flexget", line 11, in
sys.exit(main())
File "/opt/local/lib/python3.5/site-packages/flexget/init.py", line 42, in main
manager.start()
File "/opt/local/lib/python3.5/site-packages/flexget/manager.py", line 295, in start
client.handle_cli(self.args)
File "/opt/local/lib/python3.5/site-packages/rpyc/core/netref.py", line 196, in call
return syncreq(_self, consts.HANDLE_CALL, args, kwargs)
File "/opt/local/lib/python3.5/site-packages/rpyc/core/netref.py", line 71, in syncreq
return conn.sync_request(handler, oid, *args)
File "/opt/local/lib/python3.5/site-packages/rpyc/core/protocol.py", line 441, in sync_request
raise obj
RuntimeError: threads can only be started once
========= Remote Traceback (1) =========
Traceback (most recent call last):
File "/opt/local/lib/python3.5/site-packages/rpyc/core/protocol.py", line 305, in _dispatch_request
res = self._HANDLERS[handler](self, *args)
File "/opt/local/lib/python3.5/site-packages/rpyc/core/protocol.py", line 535, in _handle_call
return self._local_objects[oid](*args, **dict%28kwargs%29)
File "/opt/local/lib/python3.5/site-packages/flexget/ipc.py", line 81, in exposed_handle_cli
self.manager.handle_cli(options)
File "/opt/local/lib/python3.5/contextlib.py", line 77, in exit
self.gen.throw(type, value, traceback)
File "/opt/local/lib/python3.5/site-packages/flexget/logger.py", line 83, in capture_output
yield
File "/opt/local/lib/python3.5/site-packages/flexget/ipc.py", line 81, in exposed_handle_cli
self.manager.handle_cli(options)
File "/opt/local/lib/python3.5/site-packages/flexget/manager.py", line 334, in handle_cli
self.execute_command(command_options)
File "/opt/local/lib/python3.5/site-packages/flexget/manager.py", line 366, in execute_command
self.task_queue.start()
File "/opt/local/lib/python3.5/site-packages/flexget/task_queue.py", line 36, in start
self._thread.start()
File "/opt/local/lib/python3.5/threading.py", line 840, in start
raise RuntimeError("threads can only be started once")
RuntimeError: threads can only be started once
crawln45 commentedon Aug 12, 2016
try running
See if it still crashes.
jordanade commentedon Sep 9, 2016
With that I get:
jordanade commentedon Sep 16, 2016
Assuming you meant "flexget execute --verbose", it makes no difference. Still crashes with "RuntimeError: threads can only be started once" and no additional detail. Also same result with latest version 2.3.27.
xmun2k commentedon Oct 6, 2016
I have this issue as well. Running 2.3.41 with Python3
liiight commentedon Oct 6, 2016
@gazpachoking any clue?
xmun2k commentedon Oct 6, 2016
It seems to be something related to Python3 - I reverted back to Python27 and i'm not having this issue anymore.
fabrizio5680 commentedon Oct 19, 2016
Still occurring running 2.3.42 and Python 3.5.1, while in daemon. Running
flexget executewith any flags or none.jordanade commentedon Oct 19, 2016
Sometimes I restart and the problem goes away...hmm
gazpachoking commentedon Nov 2, 2016
So, do any of you have any other errors before this? It looks like somehow one of the threads the daemon is supposed to be running has died at some point before you get the posted error message. I'm interested if we can get to the bottom of why that thread died.
Merge pull request #1472 from cvium/fix_task_queue_crash
jordanade commentedon Nov 4, 2016
Where would I look to find these other errors? My flexget.log just has normal stuff in it.
fabrizio5680 commentedon Nov 14, 2016
Can say using flexget 2.5.19 and not seeing this error
cvium commentedon Nov 14, 2016
That's not too surprising since I fixed the crash, but there's still the underlying issue of the task queue thread dying unexpectedly.
Look in your logs for an ERROR with the text
Task queue has died unexpectedly. Restarting itjordanade commentedon Dec 10, 2016
Don't see that error in my logs.
gazpachoking commentedon Jan 15, 2019
Haven't seen any action here, hoping this is squashed.