docksal icon indicating copy to clipboard operation
docksal copied to clipboard

Unable to fin start a Docksal project

Open kwiechmann opened this issue 4 years ago • 5 comments

Hi FFW!!!

Description

Background: Docker Desktop for Macintosh/Windows now requires a licensing fee. If possible, would like to stick with Docksal but need to convert to using VirtualBox or Docker CE. Not been able to do so far. In Issue #1361, there was discussion around dropping VirtualBox support because boot2docker is well past EOL. Was VirtualBox support dropped from docksal or not? If not, are there new installation instructions? The installation page still shows VirtualBox instructions.

Using HyperKit is not an option as the company's Cisco VPN and HyperKit conflict.

Scope: Working with 80 plus sites built with Docksal.

Steps to reproduce the issue:

  • cat more ~/.docksal/docksal.env
DOCKSAL_UUID=EFFE1FA3-59E0-4630-910A-81B167C7B589 DOCKSAL_VOLUMES="bind" DOCKSAL_VHOST_PROXY_IP="0.0.0.0" DOCKSAL_DNS_DISABLED="1" DOCKSAL_DNS_UPSTREAM="10.0.0.1" DOCKER_NATIVE="0"
- fin system stop; fin system start

Describe the results you received:

% fin system stop; fin system start Stopping Docksal VM... Stopping "docksal"... Machine "docksal" was stopped. Clearing DNS cache... Removing NFS exports... Writing and applying /etc/exports... Configuring network settings... Configuring network settings... Starting "docksal"... (docksal) Check network to re-create if needed... (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. Configuring network settings... Configuring NFS shares... Writing /etc/exports... Restarting nfsd... Mounting NFS shares... Mounting local /Users to /Users mount.nfs: access denied by server while mounting 192.168.64.1:/Users exit status 32 Retrying mounting local /Users to /Users mount.nfs: access denied by server while mounting 192.168.64.1:/Users exit status 32 ERROR: NFS share mount failed. Try fin vm mount or fin vm restart. Resetting Docksal system services... * proxy * dns Clearing DNS cache... * ssh-agent Identity added: id_rsa (id_rsa)

More details if vers=3

Mounting NFS shares... Mounting local /Users to /Users sudo mount -t nfs -vvvv -o vers=3,nolock,noacl,nocto,noatime,nodiratime,actimeo=1 192.168.64.1:/Users /Users mount.nfs: trying 192.168.64.1 prog 100003 vers 3 prot TCP port 2049 mount.nfs: portmap query retrying: RPC: Unable to receive - Connection reset by peer mount.nfs: portmap query failed: RPC: Program not registered mount.nfs: timeout set for Fri Jan 7 15:49:30 2022 mount.nfs: trying text-based options 'vers=3,nolock,noacl,nocto,actimeo=1,addr=192.168.64.1' mount.nfs: prog 100003, trying vers=3, prot=6 mount.nfs: prog 100003, trying vers=3, prot=17 mount.nfs: requested NFS version or transport protocol is not supported exit status 32

More details if vers=4

Mounting NFS shares... Mounting local /Users to /Users sudo mount -t nfs -vvvv -o vers=4,nolock,noacl,nocto,noatime,nodiratime,actimeo=1 192.168.64.1:/Users /Users mount.nfs: timeout set for Fri Jan 7 15:30:55 2022 mount.nfs: trying text-based options 'nolock,noacl,nocto,actimeo=1,vers=4,addr=192.168.64.1,clientaddr=192.168.64.108' mount.nfs: mount(2): Connection reset by peer mount.nfs: Connection reset by peer exit status 32

Describe the results you expected:

/Users is mounted

Output of fin config:

fin config output
%  fin config output
---------------------
COMPOSE_PROJECT_NAME_SAFE: fusion-152
COMPOSE_FILE:
/Users/kwiechma/.docksal/stacks/volumes-bind.yml
/Users/kwiechma/.docksal/stacks/stack-default.yml
/Users/kwiechma/projects/janssen/platforms/fusion-1.5.2/.docksal/docksal.yml
ENV_FILE:
/Users/kwiechma/projects/janssen/platforms/fusion-1.5.2/.docksal/docksal.env

PROJECT_ROOT: /Users/kwiechma/projects/janssen/platforms/fusion-1.5.2
DOCROOT: docroot
VIRTUAL_HOST: jjfusion.docksal.site
VIRTUAL_HOST_ALIASES: *.jjfusion.docksal.site
IP: 192.168.64.100
MYSQL:

Docker Compose configuration
---------------------
services:
  cli:
    dns:
    - 10.0.0.1
    - 9.9.9.9
    environment:
      BLACKFIRE_CLIENT_ID: null
      BLACKFIRE_CLIENT_TOKEN: null
      COMPOSER_ALLOW_XDEBUG: '0'
      COMPOSER_DEFAULT_VERSION: null
      COMPOSER_DISABLE_XDEBUG_WARN: '0'
      DOCROOT: docroot
      DRUSH_ALLOW_XDEBUG: '0'
      DRUSH_OPTIONS_URI: jjfusion.docksal.site
      GIT_USER_EMAIL: [email protected]
      GIT_USER_NAME: Wiechmann, Kevin [ITSUS]
      HOST_GID: '20'
      HOST_UID: '502'
      MYSQL_DATABASE: default
      MYSQL_HOST: db
      MYSQL_PASSWORD: user
      MYSQL_ROOT_PASSWORD: root
      MYSQL_USER: user
      PHP_IDE_CONFIG: null
      SECRET_ACAPI_EMAIL: null
      SECRET_ACAPI_KEY: null
      SECRET_ACQUIACLI_KEY: null
      SECRET_ACQUIACLI_SECRET: null
      SECRET_PLATFORMSH_CLI_TOKEN: null
      SECRET_SSH_PRIVATE_KEY: null
      SECRET_TERMINUS_TOKEN: null
      SSH_AUTH_SOCK: /.ssh-agent/proxy-socket
      VIRTUAL_HOST: jjfusion.docksal.site
      XDEBUG_CONFIG: client_host=192.168.64.1 remote_host=192.168.64.1
      XDEBUG_ENABLED: '0'
    healthcheck:
      interval: 10s
    hostname: cli
    image: docksal/cli:1.0-php5
    labels:
      io.docksal.shell: bash
      io.docksal.user: docker
    logging:
      options:
        max-file: '10'
        max-size: 1m
    volumes:
    - docksal_ssh_agent:/.ssh-agent:ro
    - cli_home:/home/docker:rw
    - project_sites:/sites:rw
    - /tmp/.docksal/fusion-152:/tmp/.docksal/fusion-152:ro
    - project_root:/var/www:rw,nocopy,cached
  db:
    dns:
    - 10.0.0.1
    - 9.9.9.9
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: null
      MYSQL_DATABASE: default
      MYSQL_INITDB_SKIP_TZINFO: null
      MYSQL_ONETIME_PASSWORD: null
      MYSQL_PASSWORD: user
      MYSQL_RANDOM_ROOT_PASSWORD: null
      MYSQL_ROOT_PASSWORD: root
      MYSQL_USER: user
    healthcheck:
      interval: 10s
    hostname: db
    image: docksal/db:1.0-mysql-5.5
    logging:
      options:
        max-file: '10'
        max-size: 1m
    ports:
    - published: 55001
      target: 3306
    volumes:
    - db_data:/var/lib/mysql:rw
    - project_root:/var/www:ro,nocopy,cached
  memcached:
    environment:
      MEMCACHED_MEMORY_LIMIT: '128'
    hostname: memcached
    image: memcached:1.4-alpine
  web:
    depends_on:
      cli:
        condition: service_started
    dns:
    - 10.0.0.1
    - 9.9.9.9
    environment:
      APACHE_BASIC_AUTH_PASS: null
      APACHE_BASIC_AUTH_USER: null
      APACHE_DOCUMENTROOT: /var/www/docroot
      APACHE_FCGI_HOST_PORT: cli:9000
    healthcheck:
      interval: 10s
    hostname: web
    image: docksal/web:1.0-apache2.2
    labels:
      io.docksal.cert-name: none
      io.docksal.permanent: "false"
      io.docksal.project-root: /Users/kwiechma/projects/janssen/platforms/fusion-1.5.2
      io.docksal.virtual-host: jjfusion.docksal.site,*.jjfusion.docksal.site,jjfusion.docksal.site.*
    logging:
      options:
        max-file: '10'
        max-size: 1m
    volumes:
    - project_sites:/sites:ro
    - project_root:/var/www:ro,nocopy,cached
version: '2.1'
volumes:
  cli_home: {}
  db_data: {}
  docksal_ssh_agent:
    external: true
    name: docksal_ssh_agent
  project_root:
    driver: local
    driver_opts:
      device: /Users/kwiechma/projects/janssen/platforms/fusion-1.5.2
      o: bind
      type: none
  project_sites:
    driver: local
    driver_opts:
      device: /Users/kwiechma/projects/janssen/sites
      o: bind
      type: none

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

Output of fin sysinfo:

fin sysinfo output
%  fin sysinfo output   
ā–ˆā–ˆā–ˆ  FIN
fin version: 1.107.1

ā–ˆā–ˆā–ˆ  OS
Darwin macOS 11.6
Darwin WITSC02GD336MD6 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64

ā–ˆā–ˆā–ˆ  ENVIRONMENT
MODE : VirtualBox VM
DOCKER_HOST : tcp://192.168.64.111:2376

ā–ˆā–ˆā–ˆ  NFS
DOCKSAL_NFS_PATH : /Users

nfsd service is enabled
nfsd is running (pid 41815, 8 threads)

NFS EXPORTS
----------

# <ds-nfs docksal
/Users 192.168.64.100 -alldirs -maproot=0:0
# ds-nfs>
----------

Exports list on localhost:
/Users                              192.168.64.100

ā–ˆā–ˆā–ˆ  DOCKER
EXPECTED CLIENT VERSION: 20.10.7
EXPECTED SERVER VERSION: 19.03.5

Client:
Version:           20.10.7
API version:       1.40
Go version:        go1.16.4
Git commit:        f0df350
Built:             Wed Jun  2 11:56:22 2021
OS/Arch:           darwin/amd64
Context:           default
Experimental:      true

Server: Docker Engine - Community
Engine:
Version:          19.03.5
API version:      1.40 (minimum version 1.12)
Go version:       go1.12.12
Git commit:       633a0ea838
Built:            Wed Nov 13 07:28:45 2019
OS/Arch:          linux/amd64
Experimental:     false
containerd:
Version:          v1.2.10
GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339
runc:
Version:          1.0.0-rc8+dev
GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
docker-init:
Version:          0.18.0
GitCommit:        fec3683

ā–ˆā–ˆā–ˆ  DOCKER COMPOSE
EXPECTED VERSION: 1.29.2
docker-compose version 1.29.2, build 5becea4c
docker-py version: 5.0.0
CPython version: 3.9.0
OpenSSL version: OpenSSL 1.1.1h  22 Sep 2020

ā–ˆā–ˆā–ˆ  DOCKER MACHINE
EXPECTED VERSION: 0.16.2
docker-machine version 0.16.2, build bd45ab13

NAME      ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER     ERRORS
docksal   *        virtualbox   Running   tcp://192.168.64.111:2376           v19.03.5   

ERROR:  Docksal VM IP mismatch
       Expected IP: 192.168.64.100
       Actual IP  : 192.168.64.111
       Try resetting the VM: fin system stop; fin system start

ā–ˆā–ˆā–ˆ  DOCKSAL: PROJECTS
project   STATUS    virtual host   project root

ā–ˆā–ˆā–ˆ  DOCKSAL: VIRTUAL HOSTS
No virtual hosts found

ā–ˆā–ˆā–ˆ  DOCKSAL: NETWORKING

DOCKSAL_IP: 192.168.64.100
DOCKSAL_HOST_IP: 192.168.64.1
DOCKSAL_VHOST_PROXY_IP: 0.0.0.0
DOCKSAL_DNS_IP: 
DOCKSAL_DNS_DISABLED: 1
DOCKSAL_NO_DNS_RESOLVER: 1
DOCKSAL_DNS_UPSTREAM: 10.0.0.1
DOCKSAL_DNS_DOMAIN: docksal.site

ā–ˆā–ˆā–ˆ  DOCKSAL: CONNECTIVITY

Host to 192.168.64.100: 	FAIL
Container to 192.168.64.100: 	FAIL
Container to 192.168.64.1: 	FAIL

Checking connectivity to http://dns-test.docksal.site...
Host: FAIL

Debug info:
----------
+ cat /etc/resolv.conf
+ grep 192.168.64.100
+ ping -c 1 -W 1 dns-test.docksal
ping: cannot resolve dns-test.docksal: Unknown host
+ nslookup -timeout=1 dns-test.docksal 192.168.64.100
;; connection timed out; no servers could be reached

+ set +x
----------

Containers: FAIL

ā–ˆā–ˆā–ˆ  DOCKER: RUNNING CONTAINERS
CONTAINER ID   IMAGE                     COMMAND                  CREATED         STATUS                   PORTS                                      NAMES
8cc31ef15c03   docksal/ssh-agent:1.3     "docker-entrypoint.s…"   3 minutes ago   Up 3 minutes (healthy)                                              docksal-ssh-agent
bbb087801526   docksal/vhost-proxy:1.7   "docker-entrypoint.s…"   3 minutes ago   Up 3 minutes (healthy)   0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   docksal-vhost-proxy

ā–ˆā–ˆā–ˆ  DOCKER: NETWORKS
NETWORK ID     NAME                 DRIVER    SCOPE
3887e1770f7b   _default             bridge    local
998acf2b6573   bridge               bridge    local
5f1a97608b26   fusion-152_default   bridge    local
6f1a1d3a74bc   host                 host      local
c29a8e899b8a   none                 null      local

ā–ˆā–ˆā–ˆ  VIRTUALBOX
EXPECTED VERSION: 6.1.22
6.1.30r148432

ā–ˆā–ˆā–ˆ  DOCKSAL MOUNTS
ERROR:  Mounts matching 192.168.64* were not found!

ā–ˆā–ˆā–ˆ  HDD Usage
Filesystem                Size      Used Available Use% Mounted on
/dev/sda1                46.1G    324.0M     43.4G   1% /mnt/sda1

Local developerment workstation as managed by central IT:

• Big Sur, version 11.6 • MacBook Pro (16-inch, 2019) • 32 GB RAM • 1 TB SSD

kwiechmann avatar Jan 10 '22 21:01 kwiechmann

Found that the DOCKSAL_IP address keeps moving whenever the docksal container is recreated. Hacked Docksal's fin to allow any hosts on the 192.168.64.0 network to NFS mount.

# @TODO: Improve security by restricting to just a single fixed IP.
# is_mac_vbox && exports="${exports}$share_export ${DOCKSAL_IP} -alldirs -maproot=0:0\n"
is_mac_vbox && exports="${exports}$share_export -network 192.168.64.0 -mask 255.255.255.0  -alldirs -maproot=0:0\n"

Because the IP moves and DNS is turned off, /etc/hosts needs to be updated.

kwiechmann avatar Jan 11 '22 17:01 kwiechmann

Same problem with starting Docksal on VirtualBox. I am using

  • macOS 12.2.1 (21D62)
  • VirtualBox 6.1.32 r149290 (Qt5.6.3)
  • fin 1.107.1
  • DOCKER_NATIVE="0"
fin system start
Configuring network settings...
Creating docker machine 'docksal'...
Running pre-create checks...
Creating machine...
(docksal) Downloading /Users/bartlomiej.kwiatek/.docker/machine/cache/boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v19.03.12/boot2docker.iso...
(docksal) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
(docksal) Creating VirtualBox VM...
(docksal) Creating SSH key...
(docksal) Starting the VM...
(docksal) Check network to re-create if needed...
(docksal) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...

This machine has been allocated an IP address, but Docker Machine could not
reach it successfully.

SSH for the machine should still work, but connecting to exposed ports, such as
the Docker daemon port (usually <ip>:2376), may not work properly.

You may need to add the route manually, or use another related workaround.

This could be due to a VPN, proxy, or host file configuration issue.

You also might want to clear any VirtualBox host only interfaces you are not using.
Checking connection to Docker...
Error creating machine: Error checking the host: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.64.101:2376": dial tcp 192.168.64.101: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.

 ERROR:  Proper creation of virtual machine has failed
         For details please refer to the log above.
         It is recommended to remove malfunctioned virtual machine.
Remove docksal? [y/n]: y
About to remove docksal
WARNING: This action will delete both local reference and remote instance.
Successfully removed docksal

Flower7C3 avatar Feb 19 '22 14:02 Flower7C3

@Flower7C3 you issues is likely was likely solved in https://github.com/docksal/docksal/pull/1622

Found that the DOCKSAL_IP address keeps moving whenever the docksal container is recreated.

@kwiechmann That... should not be happening.

Try the most recent develop version and see whether this issues goes away (it will ask you to update VirtualBox to v6.1.32):

DOCKSAL_VERSION=develop fin update

lmakarov avatar Feb 21 '22 23:02 lmakarov

@kwiechmann you may need to drop the VM and start fresh.

fin vm rm
fin system start

This will reset the VirtualBox network/DHCP server, which is responsible for issuing IP addresses.

lmakarov avatar Feb 21 '22 23:02 lmakarov

@kwiechmann I'm going to close this due to inactivity. Feel free to followup here if there still is an issue.

lmakarov avatar Apr 19 '22 16:04 lmakarov