I am getting this error, anyone who can help
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting “/home/littlerobotlabs/n8n-docker-caddy/caddy_config/Caddyfile” to rootfs at “/etc/caddy/Caddyfile”: create mountpoint for /etc/caddy/Caddyfile mount: cannot create subdirectories in “/var/lib/docker/overlay2/d9ded4ddc2bc77d350bf4e29470bb695126f056b313d2a216cae3c0e4327f1b4/merged/etc/caddy/Caddyfile”: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
Hey @Harshpal_Khurana,
Could you share your yml
file too please? This might be happening because Docker is trying to mount a file onto a directory (or vice versa), which causes a conflict—especially if it’s using /var
without proper permissions.
Thanks,
Samuel
This what my yml looks like
version: “3.7”
services:
caddy:
image: caddy:latest
restart: unless-stopped
ports:
- “80:80”
- “443:443”
volumes:
- caddy_data:/data
- ${DATA_FOLDER}/caddy_config:/config
- ${DATA_FOLDER}/caddy_config/Caddyfile:/etc/caddy/Caddyfile
n8n:
image: docker.n8n.io/n8nio/n8n
restart: always
ports:
- 5678:5678
environment:
- N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
- N8N_PORT=5678
- N8N_PROTOCOL=https
- NODE_ENV=production
- WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
- GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
volumes:
- n8n_data:/home/node/.n8n
- ${DATA_FOLDER}/local_files:/files
volumes:
caddy_data:
external: true
n8n_data:
external: true
~
~
~
~
Thanks, was you following any guide also? @Harshpal_Khurana
@Harshpal_Khurana
btw you can probably do this
Mount the whole config directory instead:
- ${DATA_FOLDER}/caddy_config:/etc/caddy
Then make sure your Caddyfile is located inside that folder (${DATA_FOLDER}/caddy_config/Caddyfile).
Hope that helps,
Samuel
I am new to DigitalOcean and n8n, How can I do it?
@Harshpal_Khurana was you following this? Digital Ocean | n8n Docs it appear thats correct the yml, so, I would probably say remove that instance, create another droplet and see if you get same error, you shound’t if you follow the guide. Can maybe jump on a screenshare if you like?
Best regards,
Samuel