mozilla-services / pushbox

Durable Storage for Push
Mozilla Public License 2.0
6 stars 9 forks source link

Issue with docker compose up #65

Closed vladikoff closed 4 years ago

vladikoff commented 4 years ago
➜  pushbox git:(master) docker-compose up
Starting pushbox_db_1 ... done
Starting pushbox_app_1 ... done
Attaching to pushbox_db_1, pushbox_app_1
app_1  | thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: BadConnection("Can\'t connect to MySQL server on \'db\' (115)")', src/main.rs:28:5
app_1  | note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
db_1   | 2020-01-22 16:46:58+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.29-1debian9 started.
db_1   | 2020-01-22 16:46:59+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db_1   | 2020-01-22 16:46:59+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.29-1debian9 started.
db_1   | 2020-01-22T16:46:59.323070Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
db_1   | 2020-01-22T16:46:59.324269Z 0 [Note] mysqld (mysqld 5.7.29) starting as process 1 ...
db_1   | 2020-01-22T16:46:59.326904Z 0 [Note] InnoDB: PUNCH HOLE support available
db_1   | 2020-01-22T16:46:59.326941Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
db_1   | 2020-01-22T16:46:59.326951Z 0 [Note] InnoDB: Uses event mutexes
db_1   | 2020-01-22T16:46:59.326961Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
db_1   | 2020-01-22T16:46:59.326970Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
db_1   | 2020-01-22T16:46:59.326979Z 0 [Note] InnoDB: Using Linux native AIO
db_1   | 2020-01-22T16:46:59.327541Z 0 [Note] InnoDB: Number of pools: 1
db_1   | 2020-01-22T16:46:59.327647Z 0 [Note] InnoDB: Using CPU crc32 instructions
db_1   | 2020-01-22T16:46:59.329130Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
db_1   | 2020-01-22T16:46:59.334566Z 0 [Note] InnoDB: Completed initialization of buffer pool
db_1   | 2020-01-22T16:46:59.336404Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
db_1   | 2020-01-22T16:46:59.348316Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
db_1   | 2020-01-22T16:46:59.349910Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 12441833
db_1   | 2020-01-22T16:46:59.349945Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 12441852
db_1   | 2020-01-22T16:46:59.349965Z 0 [Note] InnoDB: Database was not shutdown normally!
db_1   | 2020-01-22T16:46:59.349976Z 0 [Note] InnoDB: Starting crash recovery.
db_1   | 2020-01-22T16:46:59.461716Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
db_1   | 2020-01-22T16:46:59.461777Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
db_1   | 2020-01-22T16:46:59.462027Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
db_1   | 2020-01-22T16:46:59.484185Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
db_1   | 2020-01-22T16:46:59.485450Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
db_1   | 2020-01-22T16:46:59.485484Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
db_1   | 2020-01-22T16:46:59.486101Z 0 [Note] InnoDB: Waiting for purge to start
db_1   | 2020-01-22T16:46:59.536560Z 0 [Note] InnoDB: 5.7.29 started; log sequence number 12441852
db_1   | 2020-01-22T16:46:59.536763Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
db_1   | 2020-01-22T16:46:59.536938Z 0 [Note] Plugin 'FEDERATED' is disabled.
db_1   | 2020-01-22T16:46:59.539670Z 0 [Note] InnoDB: Buffer pool(s) load completed at 200122 16:46:59
db_1   | 2020-01-22T16:46:59.542009Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
db_1   | 2020-01-22T16:46:59.542041Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
db_1   | 2020-01-22T16:46:59.542775Z 0 [Warning] CA certificate ca.pem is self signed.
db_1   | 2020-01-22T16:46:59.542823Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
db_1   | 2020-01-22T16:46:59.543412Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
db_1   | 2020-01-22T16:46:59.543448Z 0 [Note] IPv6 is available.
db_1   | 2020-01-22T16:46:59.543466Z 0 [Note]   - '::' resolves to '::';
db_1   | 2020-01-22T16:46:59.543484Z 0 [Note] Server socket created on IP: '::'.
db_1   | 2020-01-22T16:46:59.545199Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
db_1   | 2020-01-22T16:46:59.554077Z 0 [Note] Event Scheduler: Loaded 0 events
db_1   | 2020-01-22T16:46:59.554519Z 0 [Note] mysqld: ready for connections.
db_1   | Version: '5.7.29'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)
pushbox_app_1 exited with code 101

Looking at the logs above, is there a race between starting the app and the db?

~ docker-compose --version
docker-compose version 1.24.1, build 4667896b
jrconlin commented 4 years ago

definitely appears to be one now at least.