Skip to content

Troubleshooting Docker

James Winegar edited this page Sep 7, 2020 · 8 revisions

Docker timeout error Windows

If you're trying to pull the container in Windows and get a timeout error, restart Docker. Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) https://forums.docker.com/t/error-response-from-daemon-get-https-registry-1-docker-io-v2/23741/12

Docker container exited with code 139 on Windows

This is caused by Docker not being able to effectively communicate with the Windows Subsystem for Linux (WSL) in Windows 10 build 2004+

You'll need to modify your .wslconfig file. Steps:

  1. Open the following location in Windows Explorer (WIN+E): %USERPROFILE%
    • Note: %USERPROFILE% is equivalent to C:\Users\<your user name>
  2. Create the following file if it does not already exist: .wslconfig
  3. Add the following code to the file:
[wsl2]
kernelCommandLine = vsyscall=emulate
  1. Save and close the file
  2. In Powershell run the following to fully cycle wsl
wsl --shutdown
wsl reboot

Docker port conflict

I had a port conflict between hbase in the docker image and Sophos antivirus on my Mac, but seemed to be able to resolve it by mapping hbase to a different local port. Hopefully that doesn't create problems down the line, but it seems to work for now. Mentioning in case anybody else has a port conflict error when running docker-compose up.

ssh into Docker

How do I ssh into the Docker container once it's running? ssh 127.0.0.1:8022 gives me a "Could not resolve hostname" error, as does port 22, as does ssh docker.w261:8022 I applied the hostname mapping per the w261-environment repo.

I got to a bash shell with this. https://stackoverflow.com/questions/30172605/how-do-i-get-into-a-docker-container . It looks like the ssh daemon isn't enabled by default

b'Drive has not been shared'

In case anyone encounters this error while setting up docker environment: "ERROR: for w261-environment_quickstart.cloudera_1 Cannot create container for service quickstart.cloudera: b'Drive has not been shared'"

Solution is to go to docker settings -> Shared Drives and check the box against 'C' to enable sharing C drive between local and docker instance.

Enable Virtualization on Windows to install Docker

If you are required to do so, it needs to be done in BIOS:

  1. Figure out how to get into BIOS on your Windows machine (most likely by continuously pressing F1 after initializing reboot)
  2. Find Virtualization Technology item in one of the menus (sometimes it's in Config Settings, sometimes it's in Security Settings) and enable it.
  3. Reboot.

For Windows: Docker port binding issues

Error: driver failed programming external connectivity... Bind for 0.0.0.0:50070: unexpected error Permission denied

Solution: https://stackoverflow.com/questions/54217076/docker-port-bind-fails-why-a-permission-denied?rq=1#answer-55471778

This issue is due to ports reserved by Hyper-V.

# Display the reserved ports ports. 
netsh interface ipv4 show excludedportrange protocol=tcp
# To free the ports, disable Hyper-V . Restart when prompted
dism.exe /Online /Disable-Feature:Microsoft-Hyper-V
#Reserve Ports
netsh int ipv4 add excludedportrange protocol=tcp startport=50070 numberofports=1
netsh int ipv4 add excludedportrange protocol=tcp startport=50075 numberofports=1
#Enable Hyper-V
dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All

Docker on a droplet

My battle is over - finally connected to the class image. Again, for posterity: I am running on a droplet with Ubuntu 16.04. I installed docker via these instructions (https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04). First error indicated that my docker-compose installation did not support version: '3' parameter in our docker-compose.yml file, so I changed to version: '2' The next error was ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information. and it turns out the tty: true parameter of the docker-compose.yml file needs to be turned to tty: false. For whatever reason (not sure if Ubuntu or PuTTY) it gets hung up on a specific line (I believe where the colored console output would have been a color it can't write [guessing]): docker/compose#3633 Lastly, I ran in detached mode docker-compose up -d which at least expedited things, but also bypassed the console/color issue entirely.