Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wsarecv: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. #209

Closed
jmdodge opened this issue May 5, 2017 · 3 comments
Labels

Comments

@jmdodge
Copy link

jmdodge commented May 5, 2017

Description
When trying to import a large (13gb uncompressed) mysql database either with fin sqli <file> or from within fin bash, I eventually receive this error: wsarecv: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

Well this is probably not a docksal issue specifically, but it does not seem uncommon for Drupal sites to have large databases, which in turn may take a very long time to import, which in turn seem to cause this error. Maybe Docksal can be configured with some default that prevents the problem.

Steps to reproduce the issue:

  1. Get a very large sql database (mine is 13gb)
  2. Configure mysql max_allowed_packet to be large enough so that it doesn't fail ( see .docksal/etc/mysql/my.cnf not respected #207 )
  3. Run fin sqli <thefilename>

Describe the results you received:

wsarecv: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

When I try to run an additional fin command, it appears that I have to restart the vm:

It looks like 'docksal' docker machine is not running.
Run 'fin vm start' to start it now? [y/n]: y
Starting "docksal"...
(docksal) Resuming VM ...
(docksal) Waiting for an IP...
Machine "docksal" was started.
Waiting for SSH to be available...
Detecting the provisioner...
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.
Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.64.100:2376": dial tcp 192.168.64.100:2376: i/o timeout
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which might stop running containers.

Configuring SMB shares...
Enter your Windows account password:
Importing ssh keys...
Truncating 'default'...
Warning: World-writable config file '/etc/mysql/my.cnf' is ignored
Truncating 'default'... [OK]
Importing...
Warning: World-writable config file '/etc/mysql/my.cnf' is ignored
read tcp 192.168.64.1:50739->192.168.64.100:2376: wsarecv: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Import failed
{ docroot } master » `fin config`                                                                                                                                                                                                                                              /c/devdesktop/sites/rogercpa-prod/docroot 1
Run 'fin vm start' to start it now? [y/n]: y
Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.64.100:2376": dial tcp 192.168.64.100:2376: i/o timeout
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which might stop running containers.

Enter your Windows account password:

Describe the results you expected:

Expected behavior: Import the database without incident.

Output of fin config:

fin config output
---------------------
COMPOSE_PROJECT_NAME_SAFE: rogercpaprod
COMPOSE_FILE:
C:/Users/jmdod/.babun/cygwin/home/jmdod/.docksal/stacks/volumes-bind.yml
C:/Users/jmdod/.babun/cygwin/home/jmdod/.docksal/stacks/stack-acquia.yml
ENV_FILE:
C:/devdesktop/sites/rogercpa-prod/.docksal/docksal.env

PROJECT_ROOT: /c/devdesktop/sites/rogercpa-prod
DOCROOT: docroot
VIRTUAL_HOST: rogercpa-prod.docksal
VIRTUAL_HOST_ALIASES: *.rogercpa-prod.docksal
IP: 192.168.64.100
MYSQL:

Docker Compose configuration
---------------------
networks: {}
services:
  cli:
    dns:
    - 192.168.64.100
    - 10.0.2.3
    environment:
      HOST_GID: '11076'
      HOST_UID: '1076'
      XDEBUG_ENABLED: '1'
    hostname: cli
    image: docksal/cli:1.2-php5
    volumes:
    - host_home:/.home:ro
    - docksal_ssh_agent:/.ssh-agent:ro
    - project_root:/var/www:rw
  db:
    dns:
    - 192.168.64.100
    - 10.0.2.3
    environment:
      MYSQL_DATABASE: default
      MYSQL_PASSWORD: user
      MYSQL_ROOT_PASSWORD: root
      MYSQL_USER: user
    hostname: db
    image: docksal/db:1.0-mysql-5.5
    ports:
    - 0:3306/tcp
    volumes:
    - project_root:/var/www:ro
  memcached:
    dns:
    - 192.168.64.100
    - 10.0.2.3
    environment:
      MEMCACHED_MEMORY_LIMIT: '128'
    hostname: memcached
    image: memcached
  solr:
    dns:
    - 192.168.64.100
    - 10.0.2.3
    hostname: solr
    image: docksal/solr:1.0-solr4
  varnish:
    depends_on:
      web:
        condition: service_started
    dns:
    - 192.168.64.100
    - 10.0.2.3
    environment:
      VARNISH_BACKEND_HOST: web
    hostname: varnish
    image: docksal/varnish:1.0-varnish4
    labels:
      io.docksal.virtual-host: varnish.rogercpa-prod.docksal
  web:
    depends_on:
      cli:
        condition: service_started
    dns:
    - 192.168.64.100
    - 10.0.2.3
    environment:
      APACHE_DOCUMENTROOT: /var/www/docroot
    hostname: web
    image: docksal/web:1.0-apache2.2
    labels:
      io.docksal.project-root: /c/devdesktop/sites/rogercpa-prod
      io.docksal.virtual-host: rogercpa-prod.docksal,*.rogercpa-prod.docksal
    volumes:
    - project_root:/var/www:ro
version: '2.1'
volumes:
  docksal_ssh_agent:
    external: true
  host_home:
    driver: local
    driver_opts:
      device: /c/Users/jmdod/.babun/cygwin/home/jmdod
      o: bind
      type: none
  project_root:
    driver: local
    driver_opts:
      device: /c/devdesktop/sites/rogercpa-prod
      o: bind
      type: none

---------------------


Output of fin sysinfo:

fin sysinfo output
███  OS & BASICS
CYGWIN_NT-10.0-WOW REM-LT-30 1.7.35(0.287/5/3) 2015-03-04 12:07 i686 Cygwin
Microsoft Windows [Version 10.0.10586]
fin version: 1.6.0
Mode:  VirtualBox VM
███  INSTANCES
NAME      ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER        ERRORS
docksal   *        virtualbox   Running   tcp://192.168.64.100:2376           v17.04.0-ce
███  DOCKER
DOCKER_HOST:    tcp://192.168.64.100:2376

Docker: Client:
Version:      17.04.0-ce
API version:  1.28
Go version:   go1.7.5
Git commit:   4845c56
Built:        Wed Apr  5 23:33:17 2017
OS/Arch:      windows/amd64

Server:
Version:      17.04.0-ce
API version:  1.28 (minimum version 1.12)
Go version:   go1.7.5
Git commit:   4845c56
Built:        Wed Apr  5 18:45:47 2017
OS/Arch:      linux/amd64
Experimental: false
███  DOCKER COMPOSE
Docker Compose: docker-compose version 1.12.0, build ee0f34e1
docker-py version: 2.2.1
CPython version: 2.7.13
OpenSSL version: OpenSSL 1.0.2j  26 Sep 2016
███  DOCKER MACHINE
docker-machine.exe version 0.10.0, build 76ed2a6
███  DOCKER: IMAGES
REPOSITORY            TAG                 IMAGE ID            CREATED             SIZE
memcached             latest              c483d9f54256        11 days ago         83.7MB
docksal/cli           1.2-php5            11f47dc7d024        4 weeks ago         845MB
docksal/cli           1.2-php7            aef362412c9f        4 weeks ago         787MB
docksal/vhost-proxy   1.0                 2c8a8b1e62c4        2 months ago        164MB
docksal/dns           1.0                 20c7a535479d        3 months ago        61.6MB
docksal/ssh-agent     1.0                 148220cc033d        3 months ago        12.2MB
docksal/web           1.0-apache2.2       a9c03f8a5f0f        3 months ago        188MB
docksal/db            1.0-mysql-5.5       9fb8c0aed5fc        3 months ago        255MB
docksal/solr          1.0-solr4           fa6b236caf06        4 months ago        546MB
docksal/varnish       1.0-varnish4        35dae6b91ff9        4 months ago        99.5MB
███  DOCKER: CONTAINERS
CONTAINER ID        IMAGE                     COMMAND                  CREATED             STATUS              PORTS                                      NAMES
ea68e3f5b946        docksal/ssh-agent:1.0     "/run.sh ssh-agent"      2 days ago          Up About a minute                                              docksal-ssh-agent
ce186d905c8b        docksal/dns:1.0           "/opt/entrypoint.s..."   2 days ago          Up About a minute   192.168.64.100:53->53/udp                  docksal-dns
e6f03cadf570        docksal/vhost-proxy:1.0   "/usr/local/bin/st..."   2 days ago          Up About a minute   0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   docksal-vhost-proxy
███  VIRTUALBOX
5.1.18r114002
███  NETWORK INTERFACES
Name:            VirtualBox Host-Only Ethernet Adapter #3
GUID:            f825051f-32bb-4377-b706-9a921f450133
DHCP:            Enabled
IPAddress:       169.254.123.100
NetworkMask:     255.255.0.0
IPV6Address:     fe80:0000:0000:0000:b1e3:f495:06a7:7b64
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 0a:00:27:00:00:10
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter #3

Name:            VirtualBox Host-Only Ethernet Adapter #5
GUID:            0e96f965-9aaf-413e-af09-b35baf49b0e5
DHCP:            Disabled
IPAddress:       192.168.64.1
NetworkMask:     255.255.255.0
IPV6Address:     fe80:0000:0000:0000:683d:668b:4b75:49d5
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 0a:00:27:00:00:31
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter #5

Name:            VirtualBox Host-Only Ethernet Adapter #4
GUID:            f79d79af-3834-4ae9-aea1-22b981310a13
DHCP:            Disabled
IPAddress:       192.168.33.1
NetworkMask:     255.255.255.0
IPV6Address:     fe80:0000:0000:0000:c887:49e0:b4d4:6af4
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 0a:00:27:00:00:0f
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter #4

███  MOUNTS
tmpfs on / type tmpfs (rw,relatime,size=917692k)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)
tmpfs on /dev/shm type tmpfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/sda1 on /mnt/sda1 type ext4 (rw,relatime,data=ordered)
cgroup on /sys/fs/cgroup type tmpfs (rw,relatime,mode=755)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu type cgroup (rw,relatime,cpu)
cgroup on /sys/fs/cgroup/cpuacct type cgroup (rw,relatime,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,relatime,net_cls)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,relatime,perf_event)
cgroup on /sys/fs/cgroup/net_prio type cgroup (rw,relatime,net_prio)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,relatime,hugetlb)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,relatime,pids)
/dev/sda1 on /mnt/sda1/var/lib/docker/aufs type ext4 (rw,relatime,data=ordered)
none on /mnt/sda1/var/lib/docker/aufs/mnt/c04f2ffffd9c85b211135dd4527e29190f63ca22b3f889eac94e34e8dfbb3c00 type aufs (rw,relatime,si=6d28f0a00c399345,dio,dirperm1)
none on /mnt/sda1/var/lib/docker/aufs/mnt/1b281cab525e0948fe91141f6766e4a8c37022c11d66a6bfb13a49d859d2c757 type aufs (rw,relatime,si=6d28f0a00cda3345,dio,dirperm1)
none on /mnt/sda1/var/lib/docker/aufs/mnt/bf8ea38d5422f475f3eaebe3c690e63e4ffa802967f3851abf887dbb52298e27 type aufs (rw,relatime,si=6d28f0a00c605345,dio,dirperm1)
shm on /mnt/sda1/var/lib/docker/containers/ea68e3f5b9469c0a0791d64d2da6ed0d9d03bc033927b304659f634d2c9c487d/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k)
shm on /mnt/sda1/var/lib/docker/containers/ce186d905c8b634c59446a92db46671c00510e52c66ce14df940fca265479e36/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k)
shm on /mnt/sda1/var/lib/docker/containers/e6f03cadf5703e380ee37bd5ed22fc0ef7975ace95b57438730a89977c2a193b/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k)
nsfs on /var/run/docker/netns/62c3d45fb5b6 type nsfs (rw)
nsfs on /var/run/docker/netns/ba1ba9ec70d2 type nsfs (rw)
nsfs on /var/run/docker/netns/c78482fa53bc type nsfs (rw)
//192.168.64.1/c on /c type cifs (rw,relatime,vers=1.0,sec=ntlm,cache=strict,username=jmdod,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.64.1,file_mode=0777,dir_mode=0777,nounix,serverino,mapposix,nobrl,mfsymlinks,noperm,rsize=61440,wsize=65536,actimeo=1)

@achekulaev
Copy link
Member

achekulaev commented May 6, 2017

Thanks for testing such edge cases. We rarely have ability to push Docksal and Docker to such limits.
Could you provide output of fin vm hdd ?

@jmdodge
Copy link
Author

jmdodge commented May 8, 2017

For others looking, I want to add that I figured out a workaround for this issue:
If I perform a mysql import from inside fin bash and then run the import job as a background task, (this is done by hitting ctrl-z and then bg %1, or by adding an & to the end of the original command) I am able to get the job to complete.

I think this is because there is some network traffic able to go back and forth via the terminal that prevents the timeout from occurring.

I don't seem to have fin vm hdd available to me. I have:

  vm <command>                  Docksal's Virtualbox machine commands (fin help vm)
    start, stop, restart, status, ls, ssh, remove, ip, env, ram, stats

When I try fin vm hd, I get Unknown command.

@achekulaev - I want to add that I think this may be less of an edge case than you might assume. In the last couple years, I have dealt with several Drupal sites that had databases large enough to produce this kind of timeout, although certainly it's not the norm.

@achekulaev
Copy link
Member

It is hard to test and importing has been rewritten since then and this should work properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants