web関連

【docker】エラー「Failed to execute script docker-compose」

dockerが固まって、dockerコマンドを打っても…Failed to execute script docker-composeというエラーが返ってきて来た時の備忘録。

エラー内容

最初、別のエラーが出てたが何度もdockerコマンドを叩いていたら以下のエラー内容に変わった。

  1. docker-compose downコマンド実行。

    PS C:\Users\ユーザー名\wordpress> docker-compose down      
    Traceback (most recent call last):
      File "docker\api\client.py", line 268, in _raise_for_status
      File "requests\models.py", line 941, in raise_for_status
    requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localnpipe/version        
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):      
      File "docker\api\client.py", line 214, in _retrieve_server_version
      File "docker\api\daemon.py", line 181, in version
      File "docker\api\client.py", line 274, in _result
      File "docker\api\client.py", line 270, in _raise_for_status
      File "docker\errors.py", line 31, in create_api_error_from_http_exception     
    docker.errors.APIError: 500 Server Error for http+docker://localnpipe/version: Internal Server Error ("b'i/o timeout'") 
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):      
      File "docker-compose", line 3, in <module>
      File "compose\cli\main.py", line 81, in main
      File "compose\cli\main.py", line 200, in perform_command
      File "compose\cli\command.py", line 60, in project_from_options
      File "compose\cli\command.py", line 152, in get_project
      File "compose\cli\docker_client.py", line 41, in get_client
      File "compose\cli\docker_client.py", line 170, in docker_client
      File "docker\api\client.py", line 197, in __init__
      File "docker\api\client.py", line 221, in _retrieve_server_version
    docker.errors.DockerException: Error while fetching server API version: 500 Server Error for http+docker://localnpipe/version: Internal Server Error ("b'i/o timeout'")
    [18116] Failed to execute script docker-compose
  2. docker-compose down --remove-orphansコマンド実行。

    PS C:\Users\ユーザー名\wordpress> docker-compose down --remove-orphans
    Traceback (most recent call last):
      File "docker\api\client.py", line 268, in _raise_for_status
      File "requests\models.py", line 941, in raise_for_status
    requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localnpipe/version        
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):      
      File "docker\api\client.py", line 214, in _retrieve_server_version
      File "docker\api\daemon.py", line 181, in version
      File "docker\api\client.py", line 274, in _result
      File "docker\api\client.py", line 270, in _raise_for_status
      File "docker\errors.py", line 31, in create_api_error_from_http_exception     
    docker.errors.APIError: 500 Server Error for http+docker://localnpipe/version: Internal Server Error ("b'i/o timeout'") 
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):      
      File "docker-compose", line 3, in <module>
      File "compose\cli\main.py", line 81, in main
      File "compose\cli\main.py", line 200, in perform_command
      File "compose\cli\command.py", line 60, in project_from_options
      File "compose\cli\command.py", line 152, in get_project
      File "compose\cli\docker_client.py", line 41, in get_client
      File "compose\cli\docker_client.py", line 170, in docker_client
      File "docker\api\client.py", line 197, in __init__
      File "docker\api\client.py", line 221, in _retrieve_server_version
    docker.errors.DockerException: Error while fetching server API version: 500 Server Error for http+docker://localnpipe/version: Internal Server Error ("b'i/o timeout'")
    [23672] Failed to execute script docker-compose
  3. docker-compose upコマンド実行。

    PS C:\Users\ユーザー名\wordpress> docker-compose up        
    Traceback (most recent call last):
      File "docker\api\client.py", line 268, in _raise_for_status
      File "requests\models.py", line 941, in raise_for_status
    requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localnpipe/version        
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):      
      File "docker\api\client.py", line 214, in _retrieve_server_version
      File "docker\api\daemon.py", line 181, in version
      File "docker\api\client.py", line 274, in _result
      File "docker\api\client.py", line 270, in _raise_for_status
      File "docker\errors.py", line 31, in create_api_error_from_http_exception     
    docker.errors.APIError: 500 Server Error for http+docker://localnpipe/version: Internal Server Error ("b'i/o timeout'") 
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):      
      File "docker-compose", line 3, in <module>
      File "compose\cli\main.py", line 81, in main
      File "compose\cli\main.py", line 200, in perform_command
      File "compose\cli\command.py", line 60, in project_from_options
      File "compose\cli\command.py", line 152, in get_project
      File "compose\cli\docker_client.py", line 41, in get_client
      File "compose\cli\docker_client.py", line 170, in docker_client
      File "docker\api\client.py", line 197, in __init__
      File "docker\api\client.py", line 221, in _retrieve_server_version
    docker.errors.DockerException: Error while fetching server API version: 500 Server Error for http+docker://localnpipe/version: Internal Server Error ("b'i/o timeout'")
    [8420] Failed to execute script docker-compose

対処方法

実際に対処した時の流れ。

  1. widowsタスクバーのdockerアイコンを右クリックし「Quit Docker Desktop」で強制終了。
  2. 反応が無いのでタスクマネージャーから強制終了。
  3. Docker Desktopを再起動。
  4. 動いた、終わり。

wsl --statusコマンド自体は通ったので、以下の時とは異なることが確認出来た。

Leave a Comment

入力エリアすべてが必須項目です。メールアドレスが公開されることはありません。

内容をご確認の上、送信してください。

CAPTCHA