Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker 409 Client error. How to get real error and see the real log in container?

I am struggling with docker and akka.net

I am always getting this error but I do not know how to check what throws this error? Is it possible to check logoutput of the container or somehow see the output?

Error:

Exception in thread Thread-9:
Traceback (most recent call last):
  File "site-packages\docker\api\client.py", line 246, in _raise_for_status
  File "site-packages\requests\models.py", line 940, in raise_for_status
requests.exceptions.HTTPError: 409 Client Error: Conflict for url: http+docker://localnpipe/v1.30/containers/4d9d4008ccc0abacbee66357ff73e351df9997d7ec0cda8d0e0a696edf489eed/attach?logs=0&stdout=1&stderr=1&stream=1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "threading.py", line 916, in _bootstrap_inner
  File "threading.py", line 864, in run
  File "compose\cli\log_printer.py", line 233, in watch_events
  File "compose\container.py", line 215, in attach_log_stream
  File "compose\container.py", line 307, in attach
  File "site-packages\docker\utils\decorators.py", line 19, in wrapped
  File "site-packages\docker\api\container.py", line 57, in attach
  File "site-packages\docker\api\client.py", line 385, in _read_from_socket
  File "site-packages\docker\api\client.py", line 296, in _get_raw_response_socket
  File "site-packages\docker\api\client.py", line 248, in _raise_for_status
  File "site-packages\docker\errors.py", line 19, in create_api_error_from_http_exception
  File "site-packages\requests\models.py", line 880, in json
  File "site-packages\requests\models.py", line 828, in content
  File "site-packages\requests\models.py", line 750, in generate
  File "site-packages\urllib3\response.py", line 494, in stream
  File "site-packages\urllib3\response.py", line 442, in read
  File "http\client.py", line 449, in read
  File "http\client.py", line 493, in readinto
  File "site-packages\docker\transport\npipesocket.py", line 209, in readinto
  File "site-packages\docker\transport\npipesocket.py", line 20, in wrapped
RuntimeError: Can not reuse socket after connection was closed.
like image 645
senzacionale Avatar asked Dec 06 '25 18:12

senzacionale


1 Answers

If you want to see logs from service use docker-compose logs service_name, where service_name is key provided in services in docker-compose.yaml There are useful options like -f or --tail, more in docs

like image 93
Konrad Avatar answered Dec 09 '25 11:12

Konrad