How to fix Error response from daemon: invalid argument in Docker

DockerINTERMEDIATEMEDIUMUpdated Dec 1, 2025· 192 views

This generic Docker error occurs when the daemon receives malformed input, such as incompatible storage driver configurations, invalid volume mount options, incorrect port mappings, or filesystem compatibility issues.

Quick fix

Fixes Error response from daemon: invalid argument

# View recent Docker daemon logs
sudo journalctl -u docker.service -n 100 --no-pager

# Try running dockerd directly to see verbose errors
sudo dockerd --debug

# Check Docker info for storage driver details
docker info
  1. Check the full error message and Docker logs
  2. Verify XFS filesystem d_type support (storage driver issues)
  3. Fix volume mount issues (CIFS/NFS)
  4. Verify command syntax and argument order
docker — error
# View recent Docker daemon logs
sudo journalctl -u docker.service -n 100 --no-pager
# Try running dockerd directly to see verbose errors
sudo dockerd --debug
# Check Docker info for storage driver details
docker info
Error response from daemon: invalid argument

What this error means

The "Error response from daemon: invalid argument" message is a generic error that Docker returns when it cannot process a request due to malformed or incompatible parameters. Unlike specific error codes, this error can originate from various subsystems within Docker. The most common scenarios triggering this error include: - Storage driver incompatibility (e.g., overlay on XFS without d_type support) - Invalid volume mount specifications (CIFS/NFS mounts with incorrect options) - Malformed port mappings or container run arguments - Filesystem operations that fail due to kernel or driver limitations - Docker daemon configuration conflicts Because this error is generic, troubleshooting requires examining the full error context and Docker logs to identify which component is failing and why.

Typical symptoms

  • Docker commands fail with 'Error response from daemon: invalid argument'
  • Container creation or startup fails without a specific error code
  • Volume mounts fail when using CIFS, NFS, or network filesystems
  • Docker build or run commands exit unexpectedly
  • docker cp command fails when copying files to/from containers
  • Docker daemon fails to start after system or kernel updates
  • Port mapping arguments rejected with invalid argument error

Common causes

  1. XFS filesystem without d_type support when using overlay storage driver
  2. Invalid or incompatible volume mount options (CIFS/NFS configuration)
  3. Malformed port mapping syntax in docker run or docker-compose
  4. Storage driver conflicts after Docker or kernel upgrade
  5. Missing kernel modules required by the storage driver
  6. Incorrect command syntax (options after image name, missing spaces)
  7. Host network mode used with port bindings (incompatible)
  8. Corrupted Docker data directory or state
  9. Path issues on Windows (drive letters in volume paths)
  10. Docker-in-Docker (DinD) volume mount conflicts

How to fix "Error response from daemon: invalid argument"

1Check the full error message and Docker logs

First, examine the complete error output and Docker daemon logs for more context:

bash
# View recent Docker daemon logs
sudo journalctl -u docker.service -n 100 --no-pager

# Try running dockerd directly to see verbose errors
sudo dockerd --debug

# Check Docker info for storage driver details
docker info

The error message may include additional context like:
- "mkdir /var/lib/docker/overlay/...: invalid argument" (storage driver issue)
- "error while mounting volume": invalid argument" (volume mount issue)
- A specific path or operation that failed

2Verify XFS filesystem d_type support (storage driver issues)

If the error mentions overlay or storage driver issues, check your XFS filesystem configuration:

bash
# Check Docker's storage driver info
docker info | grep -A 5 "Storage Driver"

Look for:
- Storage Driver: overlay or overlay2
- Backing Filesystem: xfs
- Supports d_type: false (this is the problem!)

If d_type is false, you have two options:

Option 1: Reformat the XFS filesystem with ftype=1 (destructive):

bash
# Warning: This erases all data!
mkfs.xfs -n ftype=1 /dev/your_device

Option 2: Use a different storage driver:

bash
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<EOF
{
  "storage-driver": "devicemapper"
}
EOF
sudo systemctl restart docker
3Fix volume mount issues (CIFS/NFS)

For CIFS/SMB network volume errors, ensure you include the addr option when using hostnames:

bash
# Wrong: Using hostname without addr option
docker volume create --driver local \
  --opt type=cifs \
  --opt device=//myserver/share \
  --opt o=username=user,password=pass myvolume

# Correct: Include addr option for hostname resolution
docker volume create --driver local \
  --opt type=cifs \
  --opt device=//myserver/share \
  --opt o=addr=myserver,username=user,password=pass myvolume

For NFS mounts, use proper quoting with the --mount flag:

bash
docker run --mount 'type=volume,dst=/data,volume-driver=local,volume-opt=type=nfs,volume-opt=device=:/path/to/share,"volume-opt=o=addr=10.0.0.1,rw,nfsvers=4"' myimage

Use IP addresses instead of hostnames when possible to avoid DNS issues.

4Verify command syntax and argument order

Docker is strict about command syntax. Common mistakes include:

Wrong: Options after image name

bash
docker run nginx -p 8080:80  # Wrong!

Correct: Options before image name

bash
docker run -p 8080:80 nginx  # Correct

Wrong: Missing space in port mapping

bash
docker run -p 4242:4242nginx  # Wrong - no space before image

Correct: Proper spacing

bash
docker run -p 4242:4242 nginx  # Correct

Wrong: Port range to single port

bash
docker run -p 8080-8090:80 nginx  # Invalid - range to single port

Correct: Matching ranges

bash
docker run -p 8080-8090:80-90 nginx  # Correct - matching ranges
5Check for network mode conflicts

Using host network mode with port bindings causes an invalid argument error:

Wrong:

yaml
# docker-compose.yml
services:
  web:
    network_mode: host
    ports:
      - "8080:80"  # Invalid with host network!

Correct: Remove port bindings when using host mode (ports are already exposed):

yaml
services:
  web:
    network_mode: host
    # No ports needed - container uses host's network directly

Or remove host mode to use port mappings:

yaml
services:
  web:
    ports:
      - "8080:80"
6Fix Windows path issues

On Windows (especially Docker Toolbox), volume paths need special handling:

Wrong: Standard Windows path

bash
docker run -v c:\Users\me\data:/data myimage

Correct: Unix-style path with leading slash

bash
docker run -v /c/Users/me/data:/data myimage

Or use forward slashes and proper escaping:

bash
docker run -v "//c/Users/me/data:/data" myimage

In PowerShell, use ${PWD} for the current directory:

powershell
docker run -v "${PWD}:/app" myimage
7Clean up Docker state (if other fixes fail)

If the error persists, Docker's internal state may be corrupted:

bash
# Stop Docker
sudo systemctl stop docker

# Remove Docker's data (WARNING: deletes all containers and images!)
sudo rm -rf /var/lib/docker

# Restart Docker
sudo systemctl start docker

Alternatively, use Docker's prune commands for a less destructive cleanup:

bash
docker system prune --all --volumes

For Docker Desktop, use the "Reset to factory defaults" option in Settings > Troubleshoot.

8Verify the fix

After applying fixes, verify Docker is working correctly:

bash
# Check Docker daemon status
sudo systemctl status docker

# View Docker configuration
docker info

# Test container creation
docker run --rm hello-world

# Test volume mounts (if that was the issue)
docker run --rm -v /tmp:/test alpine ls /test

If the error mentioned a specific operation (like docker cp), test that operation specifically to confirm the fix.

Advanced notes

Understanding XFS d_type:
The d_type (directory entry type) feature allows the filesystem to store file type information in directory entries. The overlay/overlay2 storage driver requires this for efficient operation. XFS filesystems created without ftype=1 (default before XFS v5) don't support d_type.

Check your XFS format:

bash
xfs_info /dev/your_device | grep ftype

- ftype=1 means d_type is supported
- ftype=0 means you need to reformat or use a different storage driver

Docker-in-Docker (DinD) Considerations:
Running DinD with host volume mounts can fail with "invalid argument" because the overlay2 driver has trouble with layered filesystems:

bash
# This often fails:
docker run --privileged -v /host/path:/var/lib/docker docker:dind

# Workaround: Don't mount /var/lib/docker, or use a different path
docker run --privileged docker:dind

Kernel Module Requirements:
Some storage drivers require specific kernel modules:

bash
# For overlay2
sudo modprobe overlay

# Check if loaded
lsmod | grep overlay

YAML Parsing Gotchas in Docker Compose:
Ports below 60 in HOST:CONTAINER format may be parsed as base-60 values by YAML. Always quote port mappings:

yaml
ports:
  - "22:22"    # Correct - quoted string
  - 22:22      # Risky - may be parsed incorrectly

Debugging Generic Errors:
When "invalid argument" provides no additional context, increase Docker's verbosity:

bash
# Start daemon with debug logging
sudo dockerd --debug --log-level=debug

# Or add to daemon.json
{
  "debug": true,
  "log-level": "debug"
}

Frequently asked questions

What does "Error response from daemon: invalid argument" mean?
The "Error response from daemon: invalid argument" message is a generic error that Docker returns when it cannot process a request due to malformed or incompatible parameters. Unlike specific error codes, this error can originate from various subsystems within Docker. , overlay on XFS without d_type support) - Invalid volume mount specifications (CIFS/NFS mounts with incorrect options) - Malformed port mappings or container run arguments - Filesystem operations that fail due to kernel or driver limitations - Docker daemon configuration conflicts Because this error is generic, troubleshooting requires examining the full error context and Docker logs to identify which component is failing and why.
How do I fix "Error response from daemon: invalid argument"?
This generic Docker error occurs when the daemon receives malformed input, such as incompatible storage driver configurations, invalid volume mount options, incorrect port mappings, or filesystem compatibility issues.
What causes "Error response from daemon: invalid argument"?
XFS filesystem without d_type support when using overlay storage driver Invalid or incompatible volume mount options (CIFS/NFS configuration) Malformed port mapping syntax in docker run or docker-compose
Is the "Error response from daemon: invalid argument" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading