1

havent had much luck with stackoverflow lately :( but what heck lets give it one more go:

Okay, this is the issue: I am running a laravel sail "docker-compose.yml" on an AWS "t2.micro" free tier EC2 Instance and when I spin up the "docker-compose.yml file this is what I get:

    sudo ./vendor/bin/sail up -d                                                                                                                                                         1 ⚙
Creating db_transport ... 
Creating db_common    ... 
Creating tudo_meilisearch_1 ... 
Creating tudo_redis_1       ... 
Creating tudo_selenium_1    ... 
Creating db_courier         ... 
Creating tudo_mailhog_1     ... 
Creating db_service         ... 
Creating phpmyadmin         ... 
Creating db_order           ... 

ERROR: for db_common  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for tudo_redis_1  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for tudo_selenium_1  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for tudo_meilisearch_1  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for db_order  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for db_courier  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for db_service  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for phpmyadmin  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for db_transport  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for tudo_mailhog_1  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for mysql  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for redis  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for selenium  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for meilisearch  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for mysql3  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for mysql5  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for mysql4  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for phpmyadmin  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for mysql2  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)

ERROR: for mailhog  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)
ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60).

Here is my docker-compose.yml

# For more information: https://laravel.com/docs/sail
version: '3'
services:
    laravel.test:
        build:
            context: ./vendor/laravel/sail/runtimes/8.0
            dockerfile: Dockerfile
            args:
                WWWGROUP: '${WWWGROUP}'
        container_name: tudo_laravel
        image: sail-8.0/app
        ports:
            - '${APP_PORT:-80}:80'
        environment:
            WWWUSER: '${WWWUSER}'
            LARAVEL_SAIL: 1
        volumes:
            - '.:/var/www/html'
        networks:
            - sail
        depends_on:
            - mysql
            - redis
            - meilisearch
            - selenium
    mysql:
        container_name: db_common
        image: 'mysql:8.0'
        ports:
            - '${FORWARD_DB_PORT:-3305}:3306'
        environment:
            MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
            MYSQL_DATABASE: '${DB_DATABASE}'
            MYSQL_USER: '${DB_USERNAME}'
            MYSQL_PASSWORD: '${DB_PASSWORD}'
            MYSQL_HOST: '${DB_HOST}'
            MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
        volumes:
            - 'sailmysql:/var/lib/mysql'
        networks:
            - sail
        healthcheck:
          test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
          retries: 3
          timeout: 5s
    mysql2:
        image: 'mysql:8.0'
        container_name: db_transport
        ports:
            - '${FORWARD_DB_PORT:-3307}:3306'
        environment:
                MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
                MYSQL_DATABASE: '${DB_DATABASE}'
                MYSQL_USER: '${DB_USERNAME}'
                MYSQL_PASSWORD: '${DB_PASSWORD}'
                MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
        volumes:
            - 'sailmysql:/var/lib/mysql2'
        networks:
            - sail
        healthcheck:
            test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
            retries: 3
            timeout: 5s
    mysql3:
        image: 'mysql:8.0'
        container_name: db_order
        ports:
            - '${FORWARD_DB_PORT:-3308}:3306'
        environment:
            MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
            MYSQL_DATABASE: '${DB_DATABASE}'
            MYSQL_USER: '${DB_USERNAME}'
            MYSQL_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
        volumes:
            - 'sailmysql:/var/lib/mysql3'
        networks:
            - sail
        healthcheck:
            test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
            retries: 3
            timeout: 5s
    mysql4:
        image: 'mysql:8.0'
        container_name: db_service
        ports:
            - '${FORWARD_DB_PORT:-3309}:3306'
        environment:
            MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
            MYSQL_DATABASE: '${DB_DATABASE}'
            MYSQL_USER: '${DB_USERNAME}'
            MYSQL_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
        volumes:
            - 'sailmysql:/var/lib/mysql4'
        networks:
            - sail
        healthcheck:
            test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
            retries: 3
            timeout: 5s
    mysql5:
        image: 'mysql:8.0'
        container_name: db_courier
        ports:
            - '${FORWARD_DB_PORT:-3310}:3306'
        environment:
                MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
                MYSQL_DATABASE: '${DB_DATABASE}'
                MYSQL_USER: '${DB_USERNAME}'
                MYSQL_PASSWORD: '${DB_PASSWORD}'
                MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
        volumes:
            - 'sailmysql:/var/lib/mysql5'
        networks:
            - sail
        healthcheck:
            test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
            retries: 3
            timeout: 5s
    phpmyadmin:
        image: phpmyadmin
        container_name: phpmyadmin
        environment: 
            - PMA_ARBITRARY
        restart: always
        ports:
            - 8899:80   
    redis:
        image: 'redis:alpine'
        ports:
            - '${FORWARD_REDIS_PORT:-6379}:6379'
        volumes:
            - 'sailredis:/data'
        networks:
            - sail
        healthcheck:
          test: ["CMD", "redis-cli", "ping"]
          retries: 3
          timeout: 5s
    meilisearch:
        image: 'getmeili/meilisearch:latest'
        ports:
            - '${FORWARD_MEILISEARCH_PORT:-7700}:7700'
        volumes:
            - 'sailmeilisearch:/data.ms'
        networks:
            - sail
        healthcheck:
          test: ["CMD", "wget", "--no-verbose", "--spider",  "http://localhost:7700/health"]
          retries: 3
          timeout: 5s
    mailhog:
        image: 'mailhog/mailhog:latest'
        ports:
            - '${FORWARD_MAILHOG_PORT:-1025}:1025'
            - '${FORWARD_MAILHOG_DASHBOARD_PORT:-8025}:8025'
        networks:
            - sail
    selenium:
       image: 'selenium/standalone-chrome'
       volumes:
            - '/dev/shm:/dev/shm'
       networks:
           - sail
networks:
    sail:
        driver: bridge
volumes:
    sailmysql:
        driver: local
    sailredis:
        driver: local
    sailmeilisearch:
        driver: local
                                    

Here is my "/config/database.php"

<?php

use Illuminate\Support\Str;

return [

    /*
    |--------------------------------------------------------------------------
    | Default Database Connection Name
    |--------------------------------------------------------------------------
    |
    | Here you may specify which of the database connections below you wish
    | to use as your default connection for all database work. Of course
    | you may use many connections at once using the Database library.
    |
    */

    'default' => env('DB_CONNECTION', 'mysql'),

    /*
    |--------------------------------------------------------------------------
    | Database Connections
    |--------------------------------------------------------------------------
    |
    | Here are each of the database connections setup for your application.
    | Of course, examples of configuring each database platform that is
    | supported by Laravel is shown below to make development simple.
    |
    |
    | All database work in Laravel is done through the PHP PDO facilities
    | so make sure you have the driver for your particular database of
    | choice installed on your machine before you begin development.
    |
    */

    'connections' => [

        'sqlite' => [
            'driver' => 'sqlite',
            'url' => env('DATABASE_URL'),
            'database' => env('DB_DATABASE', database_path('database.sqlite')),
            'prefix' => '',
            'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
        ],

        'mysql' => [

            'common' => [
                'driver' => 'mysql',
                'host' => env('DB_HOST', '127.0.0.1'),
                'port' => env('DB_PORT', '3306'),
                'database' => env('DB_DATABASE', 'common'),
                'username' => env('DB_USERNAME', 'common'),
                'password' => env('DB_PASSWORD', 'password'),
                'strict' => false,
                'unix_socket' => env('DB_SOCKET', ''),
                'charset' => 'utf8mb4',
                'collation' => 'utf8mb4_unicode_ci',
                'prefix' => '',
                'prefix_indexes' => true,
                'strict' => true,
                'engine' => null,
                'options' => extension_loaded('pdo_mysql') ? array_filter([
                    PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
                ]) : [],
            ],

            'transport' => [
                'driver' => 'mysql',
                'host' => env('DB_HOST', '127.0.0.1'),
                'port' => env('DB_PORT', '3307'),
                'database' => env('DB_DATABASE', 'transport'),
                'username' => env('DB_USERNAME', 'transport'),
                'password' => env('DB_PASSWORD', 'password'),
                'strict' => false,
                'unix_socket' => env('DB_SOCKET', ''),
                'charset' => 'utf8mb4',
                'collation' => 'utf8mb4_unicode_ci',
                'prefix' => '',
                'prefix_indexes' => true,
                'strict' => true,
                'engine' => null,
                'options' => extension_loaded('pdo_mysql') ? array_filter([
                    PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
                ]) : [],
            ],

            'order' => [
                'driver' => 'mysql',
                'host' => env('DB_HOST', '127.0.0.1'),
                'port' => env('DB_PORT', '3308'),
                'database' => env('DB_DATABASE', 'order'),
                'username' => env('DB_USERNAME', 'order'),
                'password' => env('DB_PASSWORD', 'password'),
                'strict' => false,
                'unix_socket' => env('DB_SOCKET', ''),
                'charset' => 'utf8mb4',
                'collation' => 'utf8mb4_unicode_ci',
                'prefix' => '',
                'prefix_indexes' => true,
                'strict' => true,
                'engine' => null,
                'options' => extension_loaded('pdo_mysql') ? array_filter([
                    PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
                ]) : [],
            ],

            'service' => [
                'driver' => 'mysql',
                'host' => env('DB_HOST', '127.0.0.1'),
                'port' => env('DB_PORT', '3309'),
                'database' => env('DB_DATABASE', 'service'),
                'username' => env('DB_USERNAME', 'service'),
                'password' => env('DB_PASSWORD', 'password'),
                'strict' => false,
                'unix_socket' => env('DB_SOCKET', ''),
                'charset' => 'utf8mb4',
                'collation' => 'utf8mb4_unicode_ci',
                'prefix' => '',
                'prefix_indexes' => true,
                'strict' => true,
                'engine' => null,
                'options' => extension_loaded('pdo_mysql') ? array_filter([
                    PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
                ]) : [],
            ],

            'courier' => [
                'driver' => 'mysql',
                'host' => env('DB_HOST', '127.0.0.1'),
                'port' => env('DB_PORT', '3310'),
                'database' => env('DB_DATABASE', 'courier'),
                'username' => env('DB_USERNAME', 'courier'),
                'password' => env('DB_PASSWORD', 'password'),
                'strict' => false,
                'unix_socket' => env('DB_SOCKET', ''),
                'charset' => 'utf8mb4',
                'collation' => 'utf8mb4_unicode_ci',
                'prefix' => '',
                'prefix_indexes' => true,
                'strict' => true,
                'engine' => null,
                'options' => extension_loaded('pdo_mysql') ? array_filter([
                    PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
                ]) : [],
            ],
        ],

        'pgsql' => [
            'driver' => 'pgsql',
            'url' => env('DATABASE_URL'),
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '5432'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'charset' => 'utf8',
            'prefix' => '',
            'prefix_indexes' => true,
            'schema' => 'public',
            'sslmode' => 'prefer',
        ],

        'sqlsrv' => [
            'driver' => 'sqlsrv',
            'url' => env('DATABASE_URL'),
            'host' => env('DB_HOST', 'localhost'),
            'port' => env('DB_PORT', '1433'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'charset' => 'utf8',
            'prefix' => '',
            'prefix_indexes' => true,
        ],

    ],

    /*
    |--------------------------------------------------------------------------
    | Migration Repository Table
    |--------------------------------------------------------------------------
    |
    | This table keeps track of all the migrations that have already run for
    | your application. Using this information, we can determine which of
    | the migrations on disk haven't actually been run in the database.
    |
    */

    'migrations' => 'migrations',

    /*
    |--------------------------------------------------------------------------
    | Redis Databases
    |--------------------------------------------------------------------------
    |
    | Redis is an open source, fast, and advanced key-value store that also
    | provides a richer body of commands than a typical key-value system
    | such as APC or Memcached. Laravel makes it easy to dig right in.
    |
    */

    'redis' => [

        'client' => env('REDIS_CLIENT', 'phpredis'),

        'options' => [
            'cluster' => env('REDIS_CLUSTER', 'redis'),
            'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
        ],

        'default' => [
            'url' => env('REDIS_URL'),
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', '6379'),
            'database' => env('REDIS_DB', '0'),
        ],

        'cache' => [
            'url' => env('REDIS_URL'),
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'password' => env('REDIS_PASSWORD', null),
            'port' => env('REDIS_PORT', '6379'),
            'database' => env('REDIS_CACHE_DB', '1'),
        ],

    ],

];

Has anyone come across this type of error, before???

HI GUYS JUST A QUICK UPDATE: i kinda did a "service mysql start"(apparently it was inactive) and did a "service docker restart"

Then I did: sudo ./vendor/bin/sail up

and got the different slight different error below:
Creating db_transport ... Creating db_common ... Creating tudo_meilisearch_1 ... Creating tudo_selenium_1 ... Creating db_courier ... Creating tudo_mailhog_1 ... Creating db_service ... Creating phpmyadmin ... Creating tudo_redis_1 ... Creating db_order ...

ERROR: for tudo_redis_1  ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

ERROR: for phpmyadmin  ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

ERROR: for tudo_selenium_1  ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

ERROR: for db_common  ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

ERROR: for db_order  ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

ERROR: for db_transport  ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

ERROR: for tudo_meilisearch_1  ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

ERROR: for db_courier  ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

ERROR: for db_service  ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

ERROR: for tudo_mailhog_1  ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

ERROR: for redis  ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

ERROR: for phpmyadmin  ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

ERROR: for selenium  ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

ERROR: for mysql  ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

ERROR: for mysql3  ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

ERROR: for mysql2  ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

ERROR: for meilisearch  ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

ERROR: for mysql5  ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

ERROR: for mysql4  ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

ERROR: for mailhog  ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
dragoon
  • 31
  • 1
  • 5
  • From this message, ERROR: for db_common UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60) My first question would be why does every line show 'port=None'? Could you post from your MySQL instance, A) SHOW GLOBAL VARIABLES LIKE '%timeou%; and B) SHOW GLOBAL STATUS LIKE '%timeou%; and C) SHOW GLOBAL STATUS LIKE 'aborted%'; for analysis. – Wilson Hauck Sep 01 '21 at 02:15
  • bro this is what happens when i try to go inside one of mysql instances: ----------------------------------------> # docker exec -it db_order bash 1 ⨯ Error response from daemon: Container c0812d20180043316368fbf398fbae6cfe35d6e66e5c79c1eec152348a8c95b0 is not running------------------------------------------------------------------------------------------------------------ – dragoon Sep 01 '21 at 13:49
  • This message indicates whatever you asked for is not running. The error log messages recently posted indicate MySQL is running but every connection attempt is being aborted. The data requested 2021-09-01 02:15 would be available from MySQL when logged in as root and requested from the MySQL Command Prompt. Good luck. – Wilson Hauck Sep 01 '21 at 19:39
  • yes i understand but in order to get into MySQL container instance, i must first run an "docker exec-it db_order" command ... and thats where i run into another error "Error response from daemon" which i already mentioned above. (anyways weldone in advance for trying to assist on such a complex matter involving so many technologies all at once AWS EC2, Docker, MySQL, Linux, tcp/ip) – dragoon Sep 03 '21 at 14:26
  • The map to success is getting longer every day. Good Luck. – Wilson Hauck Sep 03 '21 at 15:57
  • well...at least our field will be among the last to be replaced by AI. Feel sorry for my decedents. – dragoon Sep 03 '21 at 17:28

0 Answers0