Repository: mrlt8/docker-wyze-bridge

Issue #909: RuntimeError: can't start new thread
Created: 2023-07-09T14:05:33Z
Just started today...docker shows it running, but I can't connect via any of the ports. Docker is running on a linux box.  Other containers are normal. The logs are as follows:🚀 DOCKER-WYZE-BRIDGE v2.3.9
[WyzeBridge] ♻️ Clearing local cache...
Traceback (most recent call last):
File "/usr/local/bin/flask", line 8, in 
sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.11/site-packages/flask/cli.py", line 1063, in main
cli.main()
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/decorators.py", line 93, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/flask/cli.py", line 911, in run_command
raise e from None
File "/usr/local/lib/python3.11/site-packages/flask/cli.py", line 897, in run_command
app = info.load_app()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/flask/cli.py", line 308, in load_app
app = locate_app(import_name, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/flask/cli.py", line 235, in locate_app
return find_best_app(module)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/flask/cli.py", line 63, in find_best_app
app = app_factory()
^^^^^^^^^^^^^
File "/app/frontend.py", line 38, in create_app
wb.start()
File "/usr/local/lib/python3.11/threading.py", line 957, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread

Duplicate issue #959: RuntimeError: can't start new thread
Created: 2023-08-12T01:03:14Z
I'm getting the following:
wyze-bridge  | 🚀 DOCKER-WYZE-BRIDGE v2.3.14
wyze-bridge  |
wyze-bridge  | [WyzeBridge] ♻️ Clearing local cache...
wyze-bridge  | Traceback (most recent call last):
wyze-bridge  |   File "/usr/local/bin/flask", line 8, in <module>
wyze-bridge  |     sys.exit(main())
wyze-bridge  |              ^^^^^^
wyze-bridge  |   File "/usr/local/lib/python3.11/site-packages/flask/cli.py", line 1063, in main
wyze-bridge  |     cli.main()
... snip ...
wyze-bridge  |   File "/usr/local/lib/python3.11/site-packages/flask/cli.py", line 63, in find_best_app
wyze-bridge  |     app = app_factory()
wyze-bridge  |           ^^^^^^^^^^^^^
wyze-bridge  |   File "/app/frontend.py", line 38, in create_app
wyze-bridge  |     wb.start()
wyze-bridge  |   File "/usr/local/lib/python3.11/threading.py", line 957, in start
wyze-bridge  |     _start_new_thread(self._bootstrap, ())
wyze-bridge  | RuntimeError: can't start new thread

I just upgraded from 1.11.  I'm using docker-compose.yml with latest image tag.  I have FRESH_DATA=true.
Here's my environment info:
$ docker -v
Docker version 1.13.1, build 7d71120/1.13.1

$ docker-compose -v
Docker Compose version v2.3.4

$ rpm -qa | grep libseccomp
libseccomp-2.3.1-4.el7.x86_64

$ cat /etc/os-release | grep Cent
NAME="CentOS Linux"
PRETTY_NAME="CentOS Linux 7 (Core)"
CENTOS_MANTISBT_PROJECT="CentOS-7"

$ uname -a
Linux nas-04 5.13.4-1.el7.elrepo.x86_64 #1 SMP Wed Jul 21 23:02:00 EDT 2021 x86_64 x86_64 x86_64 GNU/Linux
My docker/config.json:
{
	"auths": {
		"https://index.docker.io/v1/": {
			"auth": "REMOVED"
		}
	},
	"psFormat": "table {{.ID}}\\t{{.Image}}\\t{{.Status}}\\t{{.Names}}"
}
These are my images:
docker image ls|grep wyze
docker.io/mrlt8/wyze-bridge                        latest              1215a7b5ef17        5 days ago          232 MB
docker.io/mrlt8/wyze-bridge                        <none>              ac1f81edda17        7 months ago        208 MB
docker.io/mrlt8/wyze-bridge                        <none>              dbdbc44ef2a7        16 months ago       222 MB

I restarted the container today and I started getting an auth error:
wyze-bridge  | 2023/08/11 20:03:29 [WyzeBridge] 🚀 STARTING DOCKER-WYZE-BRIDGE v1.11.1
... snip ...
wyze-bridge  | 2023/08/11 20:03:30 [WyzeBridge] 403 Client Error: Forbidden for url: https://auth-prod.api.wyze.com/user/login

So, after reading some of the issues in here, I figured I would upgrade the container.
Any ideas?   I really appreciate this software (and I'm a very happy donor).

Closing comment (2023-08-12T02:34:53Z): The thread issue is potentially related to #909 and you'll need to update your host machine for compatibility with the bookworm image that we're using as the base.
https://auth-prod.api.wyze.com/user/login is the old authentication endpoint that wyze has deprecated, so you will need to be on 2.3.x or higher.