Report this

What is the reason for this report?

Docker compose push return 400 unexpected end of JSON input: ""

Posted on September 10, 2021

I have set up the docker registry at DigitalOcean to deploy my django application. I have installed the doctl and setup the API credentials. If I run the command as: doctl auth list i can see my auth as the current one, which has the Read and Write permission. But now, when I try to run the command as:

docker-compose -f docker-compose.staging.yml push

I get the error as:

ERROR: error parsing HTTP 400 response body: unexpected end of JSON
input: ""

Here’s my docker-compose.staging.yml file:

version: '3.8'
    services:
      web:
        build:
          context: ./app
          dockerfile: Dockerfile.prod
        image: registry.digitalocean.com/pythonist-do:web
        command: gunicorn Pythonist.wsgi:application --bind 0.0.0.0:8000
        volumes:
          - static_volume:/home/app/web/staticfiles
          - media_volume:/home/app/web/mediafiles
        expose:
          - 8000
        env_file:
          - ./.env.staging
      nginx-proxy:
        container_name: nginx-proxy
        build: nginx
        image: registry.digitalocean.com/pythonist-do:nginx-proxy
        restart: always
        ports:
          - 443:443
          - 80:80
        volumes:
          - static_volume:/home/app/web/staticfiles
          - media_volume:/home/app/web/mediafiles
          - certs:/etc/nginx/certs
          - html:/usr/share/nginx/html
          - vhost:/etc/nginx/vhost.d
          - /var/run/docker.sock:/tmp/docker.sock:ro
        depends_on:
          - web
      nginx-proxy-letsencrypt:
        image: jrcs/letsencrypt-nginx-proxy-companion
        env_file:
          - ./.env.staging.proxy-companion
        volumes:
          - /var/run/docker.sock:/var/run/docker.sock:ro
          - certs:/etc/nginx/certs
          - html:/usr/share/nginx/html
          - vhost:/etc/nginx/vhost.d
          - acme:/etc/acme.sh
        depends_on:
          - nginx-proxy
    
    volumes:
      static_volume:
      media_volume:
      certs:
      html:
      vhost:
      acme:


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

This may be a policy configuration error on the repository. You can try decreasing the security for the repo. I’d also recommend being sure the user that you are pushing as has the right permissions.

Hope it helps! Best, Bobby

I ran into this and found the way to fix the error is use your registry name in the tag along with registry.digitalocean.com.

For example: registry.digitalocean.com/myregname/image:tag

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.