2

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
rfay
  • 9,963
  • 1
  • 47
  • 89
honk31
  • 3,895
  • 3
  • 31
  • 30
  • It sounds like you don't have the project directory shared in docker? Or restart docker... – rfay Feb 19 '20 at 21:09
  • @rfay restarting docker/computer does not help here. if the project would not be shared with docker, how would i add it? – honk31 Feb 20 '20 at 09:17
  • 1
    You don't mention what OS your working with, but with either Windows or macOS you have a sharing section of the Docker gui config. If you're on Windows, you have to share the whole drive (like the C: drive). If you're on macOS, you need to share a path (or parent of path) where your project is, like /Users – rfay Feb 21 '20 at 07:20
  • 1
    OH, also, if you're on macOS Catalina, "Documents" is typically restricted by default, so you might have to grant full disk access to Docker for that to work. Or if you're using NFS, see https://ddev.readthedocs.io/en/stable/users/performance/#macos-nfs-setup last paragraph about full disk access for nfsd. For starters, use a directory that is *not* in Documents. – rfay Feb 21 '20 at 07:22
  • thanks @rfay. i run macOS Catalina and i do work in documents. funny enough, that other projects are running fine. but this particular project is from someone else.. anyways, i'll give it a shot in another directory and will report back here. – honk31 Feb 21 '20 at 08:21

1 Answers1

2

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.

honk31
  • 3,895
  • 3
  • 31
  • 30