How to fix Error response from daemon: 500 Internal Server Error in Docker

DockerINTERMEDIATEMEDIUMUpdated Dec 6, 2025· 295 views

This error occurs when the Docker daemon or a container registry encounters an internal failure. Common causes include registry issues, disk space problems, storage driver errors, or daemon resource exhaustion.

Quick fix

Fixes 500

# Wait and retry the operation
sleep 60
docker pull nginx:latest
  1. Check Docker Hub status for outages
  2. Check Docker daemon logs for detailed errors
  3. Verify disk space on Docker host and registry
  4. Fix DNS resolution issues
docker — error
# Wait and retry the operation
sleep 60
docker pull nginx:latest
Error response from daemon: 500 Internal Server Error

What this error means

The "500 Internal Server Error" from the Docker daemon indicates that an unexpected condition occurred that prevented the Docker daemon or a remote registry from fulfilling your request. Unlike more specific errors, a 500 error is a generic "something went wrong on the server side" message that requires investigation to determine the root cause. This error commonly appears in several scenarios: - **Image pull/push operations**: When Docker Hub or a private registry experiences temporary issues or outages - **Local registry operations**: When your self-hosted registry runs out of disk space, has permission issues, or misconfigured storage backends - **Docker API requests**: When the Docker daemon cannot respond properly due to resource exhaustion or internal state corruption - **CI/CD pipelines**: When registry operations fail due to network issues, rate limits, or transient server problems The 500 error is particularly frustrating because it doesn't tell you exactly what went wrong - you'll need to check daemon logs, registry logs, and system resources to diagnose the underlying issue.

Typical symptoms

  • Docker pull fails with 'Error response from daemon: 500 Internal Server Error'
  • Docker push operations fail intermittently with HTTP 500
  • Docker commands hang and eventually return 500 errors
  • CI/CD pipelines fail during image pull or push steps
  • Docker API requests return HTTP status 500
  • Registry operations fail but work again after retry
  • Docker login fails with 500 Internal Server Error

Common causes

  1. Docker Hub or container registry experiencing temporary outage
  2. Insufficient disk space on registry server or Docker host
  3. Storage driver errors or corruption (overlay2, devicemapper, etc.)
  4. Docker daemon resource exhaustion (memory, file descriptors)
  5. Permission issues on registry storage backend
  6. Nginx or reverse proxy in front of registry has misconfiguration
  7. Registry running out of temporary file space during layer uploads
  8. Network proxy or firewall interfering with large file transfers
  9. TLS certificate issues between Docker client and registry
  10. Corrupted or incomplete image layers on the registry

How to fix "Error response from daemon: 500 Internal Server Error"

1Check Docker Hub status for outages

Before troubleshooting locally, verify that Docker Hub is operational:

1. Visit [Docker Status Page](https://www.dockerstatus.com/) to check for active incidents
2. Check [Docker Hub Twitter](https://twitter.com/docker) for announcements

If Docker Hub shows an incident:
- Wait for the issue to be resolved
- Retry your operation after a few minutes

Quick retry test:

bash
# Wait and retry the operation
sleep 60
docker pull nginx:latest

If the error is intermittent and works on retry, it's likely a transient registry issue.

2Check Docker daemon logs for detailed errors

The 500 error is generic - check the daemon logs for more specific information:

On Linux with systemd:

bash
# View recent Docker daemon logs
sudo journalctl -u docker.service --since "10 minutes ago"

# Follow logs in real-time
sudo journalctl -u docker.service -f

On older Linux systems:

bash
# Check various log locations
tail -100 /var/log/docker.log
tail -100 /var/log/daemon.log
grep docker /var/log/messages

On Docker Desktop (Windows/macOS):
- Open Docker Desktop
- Click the bug icon or go to Troubleshoot
- Click "Get Support" > "View logs"

Enable debug logging for more details:

bash
# Add to /etc/docker/daemon.json
{
  "debug": true
}

# Restart Docker
sudo systemctl restart docker

Look for specific error messages that explain the underlying cause.

3Verify disk space on Docker host and registry

Insufficient disk space is a common cause of 500 errors:

Check Docker host disk space:

bash
# Check overall disk usage
df -h

# Check Docker-specific disk usage
docker system df

# See detailed breakdown
docker system df -v

If disk space is low, clean up Docker resources:

bash
# Remove unused containers, networks, images, and build cache
docker system prune -a

# Also remove unused volumes (careful - this deletes data!)
docker system prune -a --volumes

# Remove specific resources
docker container prune   # Remove stopped containers
docker image prune -a    # Remove unused images
docker volume prune      # Remove unused volumes

For private registries, check registry server disk space:

bash
# SSH to registry server
df -h /var/lib/registry

# Run garbage collection if using Docker Registry
docker exec registry bin/registry garbage-collect /etc/docker/registry/config.yml
4Fix DNS resolution issues

DNS problems can cause 500 errors when Docker can't properly resolve registry hostnames:

Test DNS resolution:

bash
# Test from host
nslookup registry-1.docker.io
dig registry-1.docker.io

# Test from a container
docker run --rm alpine nslookup registry-1.docker.io

Configure custom DNS in Docker daemon:

bash
# Edit /etc/docker/daemon.json
sudo tee /etc/docker/daemon.json << EOF
{
  "dns": ["8.8.8.8", "8.8.4.4"]
}
EOF

# Restart Docker
sudo systemctl restart docker

For specific containers, use --dns flag:

bash
docker run --dns 8.8.8.8 --dns 8.8.4.4 myimage
5Configure registry for non-distributable artifacts (Windows images)

When pushing or pulling Windows base images or layers with distribution restrictions, you may get 500 errors:

Allow non-distributable artifacts in daemon.json:

bash
# Edit /etc/docker/daemon.json (Linux)
# or C:\ProgramData\Docker\config\daemon.json (Windows)
{
  "allow-nondistributable-artifacts": ["myregistry.example.com:5000"]
}

Restart Docker:

bash
# Linux
sudo systemctl restart docker

# Windows (PowerShell as Administrator)
Restart-Service docker

This is commonly needed for:
- Windows Server Core images
- Windows Nano Server images
- Any image with restricted redistribution layers

6Fix Nginx proxy configuration for private registries

If you have Nginx in front of a Docker registry, large layer uploads can cause 500 errors:

Increase Nginx limits:

nginx
# In your nginx.conf or site config
server {
    listen 443 ssl;
    server_name registry.example.com;

    # Increase max body size for large layers
    client_max_body_size 0;  # 0 = no limit

    # Increase timeouts for slow uploads
    proxy_connect_timeout 900;
    proxy_send_timeout 900;
    proxy_read_timeout 900;

    # Disable buffering for large files
    proxy_buffering off;
    proxy_request_buffering off;

    location / {
        proxy_pass http://registry:5000;
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Check Nginx temp directory space:

bash
# Nginx stores request bodies in temp directory
df -h /var/lib/nginx/tmp
# or
df -h /var/cache/nginx
7Check for storage driver issues

Storage driver problems can cause internal errors:

Check current storage driver:

bash
docker info | grep "Storage Driver"

Common storage driver issues:

overlay2 (most common):

bash
# Check for filesystem errors
sudo dmesg | grep -i "overlay\|ext4\|xfs"

# Verify overlay module is loaded
lsmod | grep overlay

devicemapper:

bash
# Check thin pool space
docker info | grep -i "pool\|data\|metadata"

# If thin pool is full, extend it or prune
docker system prune -a

If storage driver is corrupted:

bash
# WARNING: This removes all containers and images!
# Stop Docker
sudo systemctl stop docker

# Remove Docker data directory
sudo rm -rf /var/lib/docker

# Restart Docker (will recreate with fresh storage)
sudo systemctl start docker
8Restart Docker daemon and retry

Sometimes the Docker daemon gets into a bad state and needs a restart:

Restart Docker service:

bash
# Linux
sudo systemctl restart docker

# Check it's running properly
sudo systemctl status docker
docker info

For Docker Desktop:
1. Right-click Docker icon in system tray
2. Select "Restart Docker Desktop"
3. Wait for the green "running" status

If restart doesn't help, try a full reset:

bash
# Stop Docker
sudo systemctl stop docker

# Clear Docker state (preserves images/containers)
sudo rm -f /var/run/docker.pid
sudo rm -f /var/run/docker.sock

# Start Docker
sudo systemctl start docker

For persistent issues:

bash
# Check for zombie processes
ps aux | grep -i docker

# Kill stuck processes if necessary
sudo pkill -9 -f dockerd
sudo systemctl start docker
9Test with Docker Hub login

Authentication issues can sometimes manifest as 500 errors:

Re-authenticate with Docker Hub:

bash
# Logout first
docker logout

# Login again
docker login

# Test a pull
docker pull hello-world

For private registries:

bash
docker logout myregistry.example.com
docker login myregistry.example.com

Check credentials storage:

bash
# View Docker config
cat ~/.docker/config.json

# If using credential helpers, verify they work
docker-credential-desktop list  # macOS/Windows
docker-credential-secretservice list  # Linux

If login itself fails with 500, the issue is likely on the registry side.

Advanced notes

Understanding Docker Registry HTTP Errors:

The Docker Registry API follows HTTP semantics:
- 400-499: Client errors (your request is wrong)
- 500-599: Server errors (registry/daemon issue)

A 500 specifically means "the server encountered an unexpected condition" - it's the registry or daemon's way of saying "something broke internally."

Debugging Private Registry 500 Errors:

If running your own registry, check the registry container logs:

bash
# View registry logs
docker logs registry 2>&1 | tail -100

# Enable debug logging in registry config
# /etc/docker/registry/config.yml
log:
  level: debug
  formatter: text

Common private registry issues:
- S3/Azure/GCS storage backend connection failures
- Filesystem permission issues on /var/lib/registry
- Redis connection issues (if using Redis cache)
- Database connection issues (for Notary/content trust)

Storage Backend Troubleshooting:

For S3-backed registries:

yaml
# config.yml - add logging
storage:
  s3:
    accesskey: ...
    secretkey: ...
    region: us-east-1
    bucket: my-registry-bucket
  # Add maintenance to check storage health
  maintenance:
    uploadpurging:
      enabled: true
      age: 168h
      interval: 24h
      dryrun: false

Rate Limiting and Retry Logic:

Docker Hub has rate limits that can cause intermittent failures:
- Anonymous users: 100 pulls per 6 hours
- Authenticated users: 200 pulls per 6 hours
- Paid plans: Higher limits

Implement retry logic in scripts:

bash
#!/bin/bash
MAX_RETRIES=3
RETRY_DELAY=30

for i in $(seq 1 $MAX_RETRIES); do
  docker pull myimage:latest && break
  echo "Attempt $i failed, waiting ${RETRY_DELAY}s..."
  sleep $RETRY_DELAY
done

Docker Daemon Resource Limits:

The daemon can hit resource limits causing 500-like failures:

bash
# Check file descriptor limits
cat /proc/$(pidof dockerd)/limits | grep "open files"

# Increase if needed in /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536

Kernel and Driver Issues:

Some 500 errors are caused by kernel issues:

bash
# Check kernel messages for Docker-related errors
dmesg | grep -i "docker\|overlay\|cgroup"

# Check if required kernel modules are loaded
lsmod | grep -E "overlay|br_netfilter|ip_tables"

For persistent issues with no clear cause:

1. Upgrade Docker to the latest version
2. Check if the issue is reproducible on a fresh Docker installation
3. Test with a different storage driver
4. Check for kernel/driver updates
5. File a bug report with Docker if the issue persists

Frequently asked questions

What does "500" mean?
The "500 Internal Server Error" from the Docker daemon indicates that an unexpected condition occurred that prevented the Docker daemon or a remote registry from fulfilling your request. Unlike more specific errors, a 500 error is a generic "something went wrong on the server side" message that requires investigation to determine the root cause. This error commonly appears in several scenarios: - Image pull/push operations: When Docker Hub or a private registry experiences temporary issues or outages - Local registry operations: When your self-hosted registry runs out of disk space, has permission issues, or misconfigured storage backends - Docker API requests: When the Docker daemon cannot respond properly due to resource exhaustion or internal state corruption - CI/CD pipelines: When registry operations fail due to network issues, rate limits, or transient server problems The 500 error is particularly frustrating because it doesn't tell you exactly what went wrong - you'll need to check daemon logs, registry logs, and system resources to diagnose the underlying issue.
How do I fix "500"?
This error occurs when the Docker daemon or a container registry encounters an internal failure. Common causes include registry issues, disk space problems, storage driver errors, or daemon resource exhaustion.
What causes "500"?
Docker Hub or container registry experiencing temporary outage Insufficient disk space on registry server or Docker host Storage driver errors or corruption (overlay2, devicemapper, etc.)
Is the "500" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading