Score:0

Docker containers keep shutting down

my flag

I ran docker-compose up on two docker containers and both ended up shutting down. I am not sure what's causing this, but I am wondering if there's a way to fix it. Both keeps shutting down after roughly 1-2 hours. I want to dockerize the application for production, but right now because it keeps shutting down, I can't.

This is my php docker container:

mariadb_1  | 2021-09-07 14:46:53 0 [Note] mysqld (initiated by: unknown): Normal shutdown
mariadb_1  | 2021-09-07 14:46:53 0 [Note] Event Scheduler: Purging the queue. 0 events
mariadb_1  | 2021-09-07 14:46:53 0 [Note] InnoDB: FTS optimize thread exiting.
redis_1    | 1:signal-handler (1631026013) Received SIGTERM scheduling shutdown...
Exception in thread Thread-13:
Traceback (most recent call last):
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests/adapters.py", line 449, in send
  File "urllib3/connectionpool.py", line 727, in urlopen
  File "urllib3/util/retry.py", line 403, in increment
  File "urllib3/packages/six.py", line 734, in reraise
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "threading.py", line 926, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "compose/cli/log_printer.py", line 166, in tail_container_logs
  File "compose/cli/log_printer.py", line 197, in wait_on_exit
  File "compose/container.py", line 277, in wait
  File "docker/utils/decorators.py", line 19, in wrapped
  File "docker/api/container.py", line 1302, in wait
  File "docker/utils/decorators.py", line 46, in inner
  File "docker/api/client.py", line 224, in _post
  File "requests/sessions.py", line 578, in post
  File "requests/sessions.py", line 530, in request
  File "requests/sessions.py", line 643, in send
  File "requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

Exception in thread Thread-15:
Traceback (most recent call last):
  File "urllib3/response.py", line 696, in _update_chunk_length
ValueError: invalid literal for int() with base 16: b''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "urllib3/response.py", line 436, in _error_catcher
  File "urllib3/response.py", line 763, in read_chunked
  File "urllib3/response.py", line 700, in _update_chunk_length
http.client.IncompleteRead: IncompleteRead(0 bytes read)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests/models.py", line 751, in generate
  File "urllib3/response.py", line 571, in stream
  File "urllib3/response.py", line 792, in read_chunked
  File "contextlib.py", line 130, in __exit__
  File "urllib3/response.py", line 454, in _error_catcher
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "threading.py", line 926, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "compose/cli/log_printer.py", line 166, in tail_container_logs
  File "compose/cli/log_printer.py", line 197, in wait_on_exit
  File "compose/container.py", line 277, in wait
  File "docker/utils/decorators.py", line 19, in wrapped
  File "docker/api/container.py", line 1302, in wait
  File "docker/utils/decorators.py", line 46, in inner
  File "docker/api/client.py", line 224, in _post
  File "requests/sessions.py", line 578, in post
  File "requests/sessions.py", line 530, in request
  File "requests/sessions.py", line 685, in send
  File "requests/models.py", line 829, in content
  File "requests/models.py", line 754, in generate
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))

Exception in thread Thread-10:
Traceback (most recent call last):
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests/adapters.py", line 449, in send
  File "urllib3/connectionpool.py", line 727, in urlopen
  File "urllib3/util/retry.py", line 403, in increment
  File "urllib3/packages/six.py", line 734, in reraise
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "threading.py", line 926, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "compose/cli/log_printer.py", line 166, in tail_container_logs
  File "compose/cli/log_printer.py", line 197, in wait_on_exit
  File "compose/container.py", line 277, in wait
  File "docker/utils/decorators.py", line 19, in wrapped
  File "docker/api/container.py", line 1302, in wait
  File "docker/utils/decorators.py", line 46, in inner
  File "docker/api/client.py", line 224, in _post
  File "requests/sessions.py", line 578, in post
  File "requests/sessions.py", line 530, in request
  File "requests/sessions.py", line 643, in send
  File "requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

Exception in thread Thread-14:
Traceback (most recent call last):
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests/adapters.py", line 449, in send
  File "urllib3/connectionpool.py", line 727, in urlopen
  File "urllib3/util/retry.py", line 403, in increment
  File "urllib3/packages/six.py", line 734, in reraise
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "threading.py", line 926, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "compose/cli/log_printer.py", line 166, in tail_container_logs
  File "compose/cli/log_printer.py", line 197, in wait_on_exit
  File "compose/container.py", line 277, in wait
  File "docker/utils/decorators.py", line 19, in wrapped
  File "docker/api/container.py", line 1302, in wait
  File "docker/utils/decorators.py", line 46, in inner
  File "docker/api/client.py", line 224, in _post
  File "requests/sessions.py", line 578, in post
  File "requests/sessions.py", line 530, in request
  File "requests/sessions.py", line 643, in send
  File "requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

Exception in thread Thread-11:
Traceback (most recent call last):
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests/adapters.py", line 449, in send
  File "urllib3/connectionpool.py", line 727, in urlopen
  File "urllib3/util/retry.py", line 403, in increment
  File "urllib3/packages/six.py", line 734, in reraise
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "threading.py", line 926, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "compose/cli/log_printer.py", line 166, in tail_container_logs
  File "compose/cli/log_printer.py", line 197, in wait_on_exit
  File "compose/container.py", line 277, in wait
  File "docker/utils/decorators.py", line 19, in wrapped
  File "docker/api/container.py", line 1302, in wait
  File "docker/utils/decorators.py", line 46, in inner
  File "docker/api/client.py", line 224, in _post
  File "requests/sessions.py", line 578, in post
  File "requests/sessions.py", line 530, in request
  File "requests/sessions.py", line 643, in send
  File "requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

Exception in thread Thread-12:
Traceback (most recent call last):
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests/adapters.py", line 449, in send
  File "urllib3/connectionpool.py", line 727, in urlopen
  File "urllib3/util/retry.py", line 403, in increment
  File "urllib3/packages/six.py", line 734, in reraise
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "threading.py", line 926, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "compose/cli/log_printer.py", line 166, in tail_container_logs
  File "compose/cli/log_printer.py", line 197, in wait_on_exit
  File "compose/container.py", line 277, in wait
  File "docker/utils/decorators.py", line 19, in wrapped
  File "docker/api/container.py", line 1302, in wait
  File "docker/utils/decorators.py", line 46, in inner
  File "docker/api/client.py", line 224, in _post
  File "requests/sessions.py", line 578, in post
  File "requests/sessions.py", line 530, in request
  File "requests/sessions.py", line 643, in send

This is my Docker-Traefik container:

traefik    | time="2021-09-07T14:46:53Z" level=debug msg="Entry point traefik closed" entryPointName=traefik
traefik    | time="2021-09-07T14:46:53Z" level=debug msg="Entry point other closed" entryPointName=other
traefik    | time="2021-09-07T14:46:53Z" level=debug msg="Entry point gulp-ui closed" entryPointName=gulp-ui
traefik    | time="2021-09-07T14:46:53Z" level=info msg="Server stopped"
traefik    | time="2021-09-07T14:46:53Z" level=info msg="Shutting down"
Exception in thread Thread-3:
Traceback (most recent call last):
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests/adapters.py", line 449, in send
  File "urllib3/connectionpool.py", line 727, in urlopen
  File "urllib3/util/retry.py", line 403, in increment
  File "urllib3/packages/six.py", line 734, in reraise
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "threading.py", line 926, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "compose/cli/log_printer.py", line 166, in tail_container_logs
  File "compose/cli/log_printer.py", line 197, in wait_on_exit
  File "compose/container.py", line 277, in wait
  File "docker/utils/decorators.py", line 19, in wrapped
  File "docker/api/container.py", line 1302, in wait
  File "docker/utils/decorators.py", line 46, in inner
  File "docker/api/client.py", line 224, in _post
  File "requests/sessions.py", line 578, in post
  File "requests/sessions.py", line 530, in request
  File "requests/sessions.py", line 643, in send
  File "requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

ubuntu@production:~/repo/Docker-Traefik$ 

These are my docker-compose files:

version: '3.7'
services:
 php:
  image: diana/${PROJECT}.php:tg1
  build:
   context: .
   dockerfile: './docker/php/Dockerfile'
  depends_on:
   - redis
   - mariadb
  command:
   - /bin/bash
   - -c
   - umask 000 && ./php-fpm-build.sh && php-fpm
  networks:
   - backend
  volumes:
   - ./matthews.com/:/var/www/:consistent
   - ./matthews.com/node_modules/:/var/www/node_modules/:cached
   - ./matthews.com/vendor/:/var/www/vendor/:cached
   - ./logs/php/:/var/log/matthews/:cached

 apache:
  image: diana/common.apache:tg1
  build: './docker/apache/'
  depends_on:
   - php
  networks:
   - frontend
   - backend
   - traefik
  labels:
   - traefik.http.routers.${COMPOSE_PROJECT_NAME}-apache.rule=${HTTPRULE}
   - traefik.http.routers.${COMPOSE_PROJECT_NAME}-apache.service=${COMPOSE_PROJECT_NAME}-apache
   - traefik.http.routers.${COMPOSE_PROJECT_NAME}-apache.entryPoints=web
   - traefik.http.services.${COMPOSE_PROJECT_NAME}-apache.loadbalancer.server.port=80

   - traefik.http.routers.${COMPOSE_PROJECT_NAME}-apache-ssl.rule=${HTTPRULE}
   - traefik.http.routers.${COMPOSE_PROJECT_NAME}-apache-ssl.entryPoints=websecure
   - traefik.http.routers.${COMPOSE_PROJECT_NAME}-apache-ssl.service=${COMPOSE_PROJECT_NAME}-apache-ssl
   - traefik.http.routers.${COMPOSE_PROJECT_NAME}-apache-ssl.tls=true
   - traefik.http.services.${COMPOSE_PROJECT_NAME}-apache-ssl.loadbalancer.server.port=80

   - traefik.enable=true
   - traefik.docker.network=webgateway
   - traefik.port=80
  volumes:
   - ./matthews.com/public:/var/www/public
   - ./docker/php/php.ini:/usr/local/etc/php/php.ini

 mariadb:
  image: diana/common.mariadb:tg1
  build: './docker/mariadb/'
  restart: always
  environment:
   MYSQL_ROOT_PASSWORD: ${ROOT_PASS}
   MYSQL_DATABASE: ${PROJECT}
   MYSQL_USER: ${PROJECT}
   MYSQL_PASSWORD: ${MARIADB_PASS}
   DBDUMP: ${DBDUMP}
   DATABASE: ${PROJECT}
  volumes:
   - db-data:/var/lib/mysql
   - ./docker/mariadb/import-dump.sh:/docker-entrypoint-initdb.d/a-import-dump.sh
  networks:
   - backend
  ports:
   - ${MARIADB_DEVPORT}:3306

volumes:
 db-data:

networks:
 frontend:
 backend:
 traefik:
  external:
   name: webgateway

And another:

version: "3.3"

services:

  traefik:
    image: matthewsdocker/traefik-dev:1.0.0.1
    container_name: "traefik"
    command:
      - /bin/sh
      - -c
      - sh /configuration/ssl-download.sh  && sh ./entrypoint.sh traefik
    build:
      context: .
      dockerfile: './docker/traefik/Dockerfile'

    restart: always
    
    ports:
      - "80:80"
      - "81:81"
      - "82:82"
      - "443:443"
      - "4431:4431"
      - "8080:8080"
      - "6001:6001"
      - "3000:3000"
      - "3001:3001"
      - "3002:3002"

    volumes:
      - ./configuration:/configuration
      - ./traefik.yml:/etc/traefik/traefik.yml
      - /var/run/docker.sock:/var/run/docker.sock:ro

    networks: 
      - webgateway

networks:
  webgateway:
    external: true
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.