honk31
honk31

Reputation: 4377

ddev start: web container failed (macOS Catalina using Documents folder for site)

when entering ddev start in terminal, i get the error

Failed to start xxx: web container failed: log=, err=container exited, please use 'ddev logs -s web` to find out why it failed 

the error log goes

...
+ disable_xdebug
Disabled xdebug
+ ls /var/www/html
ls: cannot open directory '/var/www/html': Stale file handle
/var/www/html does not seem to be healthy/mounted; docker may not be mounting it., exiting
+ echo '/var/www/html does not seem to be healthy/mounted; docker may not be mounting it., exiting'
+ exit 101

and i dunno what to do here. the directory /var/www does not exist and it does not help to create it. searching the web does not bring any valuable information, only thing i found is this

ls /var/www/html >/dev/null || (echo "/var/www/html does not seem to be healthy/mounted; docker may not be mounting it., exiting" && exit 101)

but i have no clue, what it means, nor does it explain, what to do.. this is project related, i have docker/ddev running fine in other projects, but this one is haunted or something..

my config.yaml

APIVersion: v1.12.2
name: xxx
type: php
docroot: public
php_version: "7.2"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
mariadb_version: "10.2"
nfs_mount_enabled: true
provider: default
use_dns_when_possible: true
timezone: ""

docker-compose.yaml

web:
container_name: ddev-${DDEV_SITENAME}-web
build:
  context: '/Users/jnz/Documents/xxx/.ddev/.webimageBuild'
  args:
    BASE_IMAGE: $DDEV_WEBIMAGE
    username: 'jb'
    uid: '504'
    gid: '20'
image: ${DDEV_WEBIMAGE}-built
cap_add:
  - SYS_PTRACE
volumes:
  - type: volume
    source: nfsmount
    target: /var/www/html

    volume:
      nocopy: true

  - ".:/mnt/ddev_config:ro"
  - ddev-global-cache:/mnt/ddev-global-cache

  - ddev-ssh-agent_socket_dir:/home/.ssh-agent


restart: "no"
user: "$DDEV_UID:$DDEV_GID"
hostname: xxx-web

links:
  - db:db

# ports is list of exposed *container* ports
ports:
  - "127.0.0.1:$DDEV_HOST_WEBSERVER_PORT:80"
  - "127.0.0.1:$DDEV_HOST_HTTPS_PORT:443"
environment:
  - DOCROOT=$DDEV_DOCROOT
  - DDEV_PHP_VERSION=$DDEV_PHP_VERSION
  - DDEV_WEBSERVER_TYPE=$DDEV_WEBSERVER_TYPE
  - DDEV_PROJECT_TYPE=$DDEV_PROJECT_TYPE
  - DDEV_ROUTER_HTTP_PORT=$DDEV_ROUTER_HTTP_PORT
  - DDEV_ROUTER_HTTPS_PORT=$DDEV_ROUTER_HTTPS_PORT
  - DDEV_XDEBUG_ENABLED=$DDEV_XDEBUG_ENABLED
  - DOCKER_IP=127.0.0.1
  - HOST_DOCKER_INTERNAL_IP=
  - DEPLOY_NAME=local
  - VIRTUAL_HOST=$DDEV_HOSTNAME
  - COLUMNS=$COLUMNS
  - LINES=$LINES
  - TZ=
  # HTTP_EXPOSE allows for ports accepting HTTP traffic to be accessible from <site>.ddev.site:<port>
  # To expose a container port to a different host port, define the port as hostPort:containerPort
  - HTTP_EXPOSE=${DDEV_ROUTER_HTTP_PORT}:80,${DDEV_MAILHOG_PORT}:8025
  # You can optionally expose an HTTPS port option for any ports defined in HTTP_EXPOSE.
  # To expose an HTTPS port, define the port as securePort:containerPort.
  - HTTPS_EXPOSE=${DDEV_ROUTER_HTTPS_PORT}:80
  - SSH_AUTH_SOCK=/home/.ssh-agent/socket
  - DDEV_PROJECT=xxx
labels:
  com.ddev.site-name: ${DDEV_SITENAME}
  com.ddev.platform: ddev
  com.ddev.app-type: php
  com.ddev.approot: $DDEV_APPROOT

external_links:
- "ddev-router:xxx.ddev.site"

healthcheck:
  interval: 1s
  retries: 10
  start_period: 10s
  timeout: 120s

Upvotes: 2

Views: 2041

Answers (1)

honk31
honk31

Reputation: 4377

So as @rfay pointed out in the comments, the problem was caused by macOS catalina directory restrictions.

i had to go to system settings > security > privacy > files & folders and add /sbin/nfsd. it now has full hd access.

besides that i granted docker access to documents.

now ddev is up and running, even in folders inside User/xxx/Documents.

Upvotes: 2

Related Questions