Docker-compose doesn't work but Docker run does
extremelyonline opened this issue · 2 comments
Hi Paulgo,
I was able to run the production image successfully with docker run -it --rm -p 8080:8080 paulgoio/searxng:production
However, when I run [basic-http]/docker-compose.yml,
, I got the following errors. I am running Debian 11.
Would you know what may cause this?
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/httpcore/backends/asyncio.py", line 101, in connect_tcp
stream: anyio.abc.ByteStream = await anyio.connect_tcp(
File "/usr/lib/python3.9/site-packages/anyio/_core/_sockets.py", line 152, in connect_tcp
gai_res = await getaddrinfo(target_host, remote_port, family=family,
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/httpcore/_exceptions.py", line 8, in map_exceptions
d
File "/usr/lib/python3.9/site-packages/httpcore/backends/asyncio.py", line 101, in connect_tcp
stream: anyio.abc.ByteStream = await anyio.connect_tcp(
File "/usr/lib/python3.9/site-packages/anyio/_core/_tasks.py", line 103, in __exit__
raise TimeoutError
TimeoutError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions
d
File "/usr/lib/python3.9/site-packages/httpx/_transports/default.py", line 308, in handle_async_request
resp = await self._pool.handle_async_request(req)
File "/usr/lib/python3.9/site-packages/httpcore/_async/connection_pool.py", line 253, in handle_async_request
raise exc
File "/usr/lib/python3.9/site-packages/httpcore/_async/connection_pool.py", line 237, in handle_async_request
response = await connection.handle_async_request(request)
File "/usr/lib/python3.9/site-packages/httpcore/_async/connection.py", line 86, in handle_async_request
raise exc
File "/usr/lib/python3.9/site-packages/httpcore/_async/connection.py", line 63, in handle_async_request
stream = await self._connect(request)
File "/usr/lib/python3.9/site-packages/httpcore/_async/connection.py", line 111, in _connect
stream = await self._network_backend.connect_tcp(**kwargs)
File "/usr/lib/python3.9/site-packages/httpcore/backends/auto.py", line 23, in connect_tcp
return await self._backend.connect_tcp(
File "/usr/lib/python3.9/site-packages/httpcore/backends/asyncio.py", line 101, in connect_tcp
stream: anyio.abc.ByteStream = await anyio.connect_tcp(
File "/usr/lib/python3.9/contextlib.py", line 137, in __exit__
self.gen.throw(typ, value, traceback)
File "/usr/lib/python3.9/site-packages/httpcore/_exceptions.py", line 12, in map_exceptions
raise to_exc(exc)
httpcore.ConnectTimeout
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/searxng/searx/search/processors/abstract.py", line 75, in initialize
self.engine.init(get_engine_from_settings(self.engine_name))
File "/usr/local/searxng/searx/engines/wikidata.py", line 748, in init
jsonresponse = send_wikidata_query(query)
File "/usr/local/searxng/searx/engines/wikidata.py", line 138, in send_wikidata_query
http_response = get(SPARQL_ENDPOINT_URL + '?' + urlencode({'query': query}), headers=get_headers())
File "/usr/local/searxng/searx/network/__init__.py", line 111, in get
return request('get', url, **kwargs)
File "/usr/local/searxng/searx/network/__init__.py", line 88, in request
response = future.result(timeout)
File "/usr/lib/python3.9/concurrent/futures/_base.py", line 445, in result
return self.__get_result()
File "/usr/lib/python3.9/concurrent/futures/_base.py", line 390, in __get_result
raise self._exception
File "/usr/local/searxng/searx/network/network.py", line 268, in request
return await self.call_client(False, method, url, **kwargs)
File "/usr/local/searxng/searx/network/network.py", line 264, in call_client
raise e
File "/usr/local/searxng/searx/network/network.py", line 249, in call_client
response = await client.request(method, url, **kwargs)
File "/usr/lib/python3.9/site-packages/httpx/_client.py", line 1513, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
File "/usr/lib/python3.9/site-packages/httpx/_client.py", line 1600, in send
response = await self._send_handling_auth(
File "/usr/lib/python3.9/site-packages/httpx/_client.py", line 1628, in _send_handling_auth
response = await self._send_handling_redirects(
File "/usr/lib/python3.9/site-packages/httpx/_client.py", line 1665, in _send_handling_redirects
response = await self._send_single_request(request)
File "/usr/lib/python3.9/site-packages/httpx/_client.py", line 1702, in _send_single_request
response = await transport.handle_async_request(request)
File "/usr/lib/python3.9/site-packages/httpx/_transports/default.py", line 308, in handle_async_request
resp = await self._pool.handle_async_request(req)
File "/usr/lib/python3.9/contextlib.py", line 137, in __exit__
self.gen.throw(typ, value, traceback)
File "/usr/lib/python3.9/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectTimeout
2022-04-25 08:56:45,718 ERROR:searx.engines.wikipedia: engine timeout
2022-04-25 08:56:45,718 ERROR:searx.engines.bing: engine timeout
2022-04-25 08:56:45,718 ERROR:searx.engines.google: engine timeout
2022-04-25 08:56:45,719 ERROR:searx.engines.qwant: engine timeout
2022-04-25 03:50:46,138 WARNING:searx.engines.qwant: ErrorContext('searx/search/processors/online.py', 96, "response = req(params['url'], **request_args)", 'httpx.ConnectTimeout', None, (None, None, 'api.qwant.com')) False
2022-04-25 03:50:46,139 ERROR:searx.engines.qwant: HTTP requests timeout (search duration : 3.4209144490014296 s, timeout: 3.0 s) : ConnectTimeout
2022-04-25 03:50:46,140 WARNING:searx.engines.google: ErrorContext('searx/search/processors/online.py', 96, "response = req(params['url'], **request_args)", 'httpx.ConnectTimeout', None, (None, None, 'www.google.com')) False
2022-04-25 03:50:46,140 ERROR:searx.engines.google: HTTP requests timeout (search duration : 3.422248149989173 s, timeout: 3.0 s) : ConnectTimeout
2022-04-25 03:50:46,140 WARNING:searx.engines.bing: ErrorContext('searx/search/processors/online.py', 96, "response = req(params['url'], **request_args)", 'httpx.ConnectTimeout', None, (None, None, 'www.bing.com')) False
2022-04-25 03:50:46,141 ERROR:searx.engines.bing: HTTP requests timeout (search duration : 3.422884088999126 s, timeout: 3.0 s) : ConnectTimeout
2022-04-25 03:50:46,141 WARNING:searx.engines.wikipedia: ErrorContext('searx/search/processors/online.py', 96, "response = req(params['url'], **request_args)", 'httpx.ConnectTimeout', None, (None, None, 'en.wikipedia.org')) False
2022-04-25 03:50:46,141 ERROR:searx.engines.wikipedia: HTTP requests timeout (search duration : 3.4234556109877303 s, timeout: 3.0 s) : ConnectTimeout```
Hi @extremelyonline ,
Sorry for the late reply... Can you please pull the latest prod image with docker-compose pull
and try again with docker-compose up -d
. I made some changes to the image... I also tried the basic docker-compose
file on my local computer and it worked... The timeout issue could be an DNS issue or any other network issue. So if it still does not work, please share more about your setup.... Like did you use the docker-compose file and the docker command on the same computer... Can you ping or CURL from inside the container:
docker-compose exec searxng sh
and from there you can install tools with apk add curl
for example and use it to debug your connection from inside the container...
Hi @mrpaulblack thank you so much! It was indeed a DNS issue. All works now.