Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while removing container with remote Docker context #22

Open
ldeluigi opened this issue Sep 25, 2022 · 4 comments
Open

Error while removing container with remote Docker context #22

ldeluigi opened this issue Sep 25, 2022 · 4 comments
Labels
bug Something isn't working needs repro

Comments

@ldeluigi
Copy link

Containers running this image throw errors when trying to remove them through docker compose down:

Delete "http://docker.example.com/v1.41/containers/00faf040af3d961331a939748b80e9cc151f18034b89a0cb194daee42990abd6?force=1&v=1": command [ssh -l ubuntu -- 3.234.133.243 docker system dial-stdio] has exited with exit status 1, please make sure the URL is valid, and Docker 18.09 or later is installed on the remote host: stderr=

Maybe it lacks a proper SIGTERM handling?

@eeshugerman
Copy link
Owner

I'm unable to reproduce this. Am I doing it right?

❯ docker compose  up -d
[+] Running 2/2
 ⠿ Container postgres-backup-s3-backup-1    Started                                                                                                                                                                                     0.5s
 ⠿ Container postgres-backup-s3-postgres-1  Started                                                                                                                                                                                     0.5s

❯ docker compose down
[+] Running 3/3
 ⠿ Container postgres-backup-s3-postgres-1  Removed                                                                                                                                                                                     0.3s
 ⠿ Container postgres-backup-s3-backup-1    Removed                                                                                                                                                                                     0.2s
 ⠿ Network postgres-backup-s3_default       Removed                                                                                                                                                                                     0.2s

❯ echo $?
0

Please provide your docker-compose.yml (with secrets redacted of course).

@ldeluigi
Copy link
Author

I'm using multiple compose files. Here are two of them:

version: '3.8'

services:
  web:
    build:
      context: .
      args:
        SECRET_KEY: ${SECRET_KEY:?}
    image: spellbook-backend
    expose:
      - 8000
    depends_on:
      - db
    volumes:
      - static_volume:/home/app/web/staticfiles:rw
    environment:
      SQL_ENGINE: django.db.backends.postgresql
      SQL_DATABASE: spellbook_db_prod
      SQL_USER: ${DB_USER:?}
      SQL_PASSWORD: ${DB_PASSWORD:?}
      SQL_HOST: db
      SQL_PORT: 5432
      DATABASE: postgres
    restart: always
  nginx:
    build:
      context: ./nginx
      target: base
    image: spellbook-nginx
    ports:
      - 80:80
    depends_on:
      - web
    volumes:
      - static_volume:/home/app/web/staticfiles:ro
    restart: always
  db:
    image: postgres:14-alpine
    volumes:
      - postgres_data:/var/lib/postgresql/data/
    expose:
      - 5432
    environment:
      PGPORT: 5432
      POSTGRES_USER: ${DB_USER:?}
      POSTGRES_PASSWORD: ${DB_PASSWORD:?}
      POSTGRES_DB: spellbook_db_prod
    restart: always
volumes:
  static_volume:
  postgres_data:
version: '3.8'

services:
  db-backups:
    image: eeshugerman/postgres-backup-s3:14
    depends_on:
      - db
    environment:
      SCHEDULE: '@daily'
      S3_REGION: ${AWS_S3_REGION:?}
      S3_ACCESS_KEY_ID: ${AWS_S3_ACCESS_KEY_ID:?}
      S3_SECRET_ACCESS_KEY: ${AWS_S3_SECRET_ACCESS_KEY:?}
      S3_BUCKET: ${AWS_S3_BUCKET:?}
      S3_PREFIX: backup
      POSTGRES_BACKUP_ALL: 'false'
      POSTGRES_HOST: db
      POSTGRES_DATABASE: spellbook_db_prod
      POSTGRES_USER: ${DB_USER:?}
      POSTGRES_PASSWORD: ${DB_PASSWORD:?}
      POSTGRES_EXTRA_OPTS: ''
    restart: always

@eeshugerman
Copy link
Owner

Hi, sorry for the slow response. I don't think this is related, but I'll note I don't recognize the POSTGRES_BACKUP_ALL and POSTGRES_EXTRA_OPTS environment variables. Otherwise I don't see anything of note.

Are you able to reproduce the issue with plain Docker Compose on a local machine? I don't entirely understand the error message you provided -- why does it have a URL on it?

@ldeluigi
Copy link
Author

Are you able to reproduce the issue with plain Docker Compose on a local machine? I don't entirely understand the error message you provided -- why does it have a URL on it?

I'm not. I'm using a Docker context on a remote machine (hence the url). Idk why it starts with the example domain.
When I find the time I'll try to create a minimal reproducible example. In local I can't reproduce it (everything seems fine)

@eeshugerman eeshugerman changed the title Error while Removing Error while removing container with remote Docker context Jan 29, 2023
@eeshugerman eeshugerman added the bug Something isn't working label Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs repro
Projects
None yet
Development

No branches or pull requests

2 participants