Docker Run Error: Flask app crash
What happend?
Hey, I tried to run this project with Docker and got stuck. There's an error with gethostbyaddr that seems to crash the Flask app, so I can't access it. Any help would be great!
System:
Windows 11 - Version 10.0.22631 Build 22631 Tried running with and without WSL and got the same behavior
Logs:
╰─ docker run -p 50001:80 frdel/agent-zero-run
2025-05-31 20:58:10,549 INFO Set uid to user 0 succeeded
2025-05-31 20:58:10,549 INFO Set uid to user 0 succeeded
2025-05-31 20:58:10,551 INFO RPC interface 'supervisor' initialized
2025-05-31 20:58:10,551 INFO RPC interface 'supervisor' initialized
2025-05-31 20:58:10,551 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2025-05-31 20:58:10,551 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2025-05-31 20:58:10,551 INFO supervisord started with pid 1
2025-05-31 20:58:10,551 INFO supervisord started with pid 1
2025-05-31 20:58:11,552 INFO spawned: 'the_listener' with pid 108
2025-05-31 20:58:11,552 INFO spawned: 'the_listener' with pid 108
2025-05-31 20:58:11,554 INFO spawned: 'run_cron' with pid 109
2025-05-31 20:58:11,554 INFO spawned: 'run_cron' with pid 109
2025-05-31 20:58:11,555 INFO spawned: 'run_searxng' with pid 110
2025-05-31 20:58:11,555 INFO spawned: 'run_searxng' with pid 110
2025-05-31 20:58:11,557 INFO spawned: 'run_sshd' with pid 111
2025-05-31 20:58:11,557 INFO spawned: 'run_sshd' with pid 111
2025-05-31 20:58:11,558 INFO spawned: 'run_tunnel_api' with pid 112
2025-05-31 20:58:11,558 INFO spawned: 'run_tunnel_api' with pid 112
2025-05-31 20:58:11,559 INFO spawned: 'run_ui' with pid 113
2025-05-31 20:58:11,559 INFO spawned: 'run_ui' with pid 113
Starting tunnel API...
Copying files from /git/agent-zero to /a0...
2025-05-31 20:58:11,598 INFO supervisor_event_listener.py: Listening for events...
READY
* Serving Flask app 'webapp'
* Debug mode: off
2025-05-31 20:58:12,225 ERROR:searx.engines.radio browser: Fail to initialize
Traceback (most recent call last):
File "/usr/local/searxng/searxng-src/searx/search/processors/abstract.py", line 73, in initialize
self.engine.init(get_engine_from_settings(self.engine_name))
File "/usr/local/searxng/searxng-src/searx/engines/radio_browser.py", line 71, in init
server_list()
File "/usr/local/searxng/searxng-src/searx/engines/radio_browser.py", line 84, in server_list
url = socket.gethostbyaddr(_ip)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^
socket.herror: [Errno 4] No address associated with name
2025-05-31 20:58:13,227 INFO success: the_listener entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-05-31 20:58:13,227 INFO success: the_listener entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-05-31 20:58:13,227 INFO success: run_cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-05-31 20:58:13,227 INFO success: run_cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-05-31 20:58:13,227 INFO success: run_searxng entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-05-31 20:58:13,227 INFO success: run_searxng entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-05-31 20:58:13,227 INFO success: run_sshd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-05-31 20:58:13,227 INFO success: run_sshd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-05-31 20:58:13,227 INFO success: run_tunnel_api entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-05-31 20:58:13,227 INFO success: run_tunnel_api entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-05-31 20:58:13,227 INFO success: run_ui entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-05-31 20:58:13,227 INFO success: run_ui entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-05-31 20:58:13,227 INFO reaped unknown pid 10 (exit status 0)
2025-05-31 20:58:13,227 INFO reaped unknown pid 10 (exit status 0)
Preparing environment...
Changing root password...
Starting tunnel server...
Running preload...
Loading Whisper model: base
Preload completed
Starting A0...
Initializing framework...
Starting job loop...
Starting server...
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:80
* Running on http://172.17.0.2:80
exact same here; I'm on Ubuntu 22
same issue here
Same here on Win 10.
OK, following advice from ChatGpt, I changed this file "/usr/local/searxng/searxng-src/searx/engines/radio_browser.py"
and replaced this line
url = socket.gethostbyaddr(_ip)[0]
with this
try:
url = socket.gethostbyaddr(_ip)[0]
except socket.herror:
url = _ip # fallback: use the IP directly
And it worked !
Only for the current container though, the image is still faulty I guess.
Could a maintainer please confirm if this issue originates in the SearXNG engine? If so, I'd be happy to create a PR in their repository. I want to ensure it's not a project-specific problem before I start working on it :)
I got the latest (june 13) no luck ;-(
for _ip in ip_list:
try:
url = socket.gethostbyaddr(_ip)[0]
except socket.herror:
url = _ip # fallback
if url not in servers:
servers.append(url)
that worked for me, I think. yes, I can access now at localhost:55009 I wonder what I can do...