"tls: oversized record received with length 20527" trying to "docker run" from Win10 WSL Bash only "tls: oversized record received with length 20527" trying to "docker run" from Win10 WSL Bash only windows windows

"tls: oversized record received with length 20527" trying to "docker run" from Win10 WSL Bash only


Solution

As this freaked me out a bit, I made another Google session and found the solution down in the comments of this side:* https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly

In a nutshell:* The issue I've described comes from an default but outdated docker.io installation, instead of the latest and maintained docker-ce installation.

Once I've removed the old one with (the trailing * is intended!):

sudo apt-get remove --purge docker*

and installed the latest docker-ce one -- according to the procedure described on the page above -- the TLS issue was gone!

Happy docking.


The proposed solution

sudo apt-get remove --purge docker*

didn't work for me since as soon as I tried to run the apt-get remove command I got the following error:

No process in pidfile '/var/run/docker-ssd.pid' found running; none killed.invoke-rc.d: initscript docker, action "stop" failed.

So I had to manually uninstall docker by executing this:

sudo rm /var/lib/dpkg/info/docker.io.*sudo rm /var/cache/apt/archives/docker.io*sudo rm /etc/default/dockersudo rm /etc/init.d/dockersudo rm /etc/init/docker.conf

and after that I just followed the instruction here:

https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly

Problem fixed.


Here are the steps to solve the problem:

  1. Remove docker.io (if present) and related packages from WSL (Ubuntu):

    sudo apt-get remove docker.iosudo apt-get remove docker*

    Note: In case of errors (function not implemented), try to upgrade WSL by (it'll take a while):

    sudo -S apt-mark hold procps strace sudosudo -S env RELEASE_UPGRADER_NO_SCREEN=1 do-release-upgrade
  2. Install Docker CE in WSL (Ubuntu):

    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"sudo apt-get updatesudo apt-get install docker-ce
  3. Expose daemon without TLS in your Docker app on Windows.

  4. Connect to it by defining DOCKER_HOST variable in WSL:

    export DOCKER_HOST=:2375

Related: