vessel: Unable to use mysql

Description

I freshly installed docker and Vessel on my working station. But when trying to migrate my database, I get an error :

Illuminate\Database\QueryException  : SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations and table_type = 'BASE TABLE')

And when running

# Log into mysql
./vessel mysql

I get this message : ERROR: No container found for mysql_1

Thanks for your help !

OS

My OS is:

  • MacOS [Mojave]
  • Linux
  • Windows

Docker

The output of docker version:

Client: Docker Engine - Community
 Version:           18.09.2
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        6247962
 Built:             Sun Feb 10 04:12:39 2019
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.2
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       6247962
  Built:            Sun Feb 10 04:13:06 2019
  OS/Arch:          linux/amd64
  Experimental:     false

The output of docker-compose version:

docker-compose version 1.23.2, build 1110ad01
docker-py version: 3.6.0
CPython version: 3.6.6
OpenSSL version: OpenSSL 1.1.0h  27 Mar 2018

The output of docker image ls:

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
vessel/node         latest              3e98f69e6c95        About an hour ago   928MB
vessel/app          latest              cf10e96ea585        About an hour ago   355MB
node                latest              b074182f4154        6 hours ago         906MB
mysql               5.7                 a1aa4f76fab9        15 hours ago        373MB
redis               alpine              72e76053ebb7        3 weeks ago         50.9MB
ubuntu              18.04               7698f282e524        3 weeks ago         69.9MB

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

hi I have the same problem my exits are the following $ ./vessel start Creating network “my-app_vessel” with driver “bridge” Creating my-app_redis_1 … done Creating my-app_node_1 … done Creating my-app_mysql_1 … done Creating my-app_app_1 … done

./vessel ps Name Command State Ports

my-app_app_1 start-container Up 0.0.0.0:80->80/tcp,:::80->8 0/tcp
my-app_mysql_1 docker-entrypoint.sh mysqld Exit 1
my-app_node_1 docker-entrypoint.sh node Exit 0
my-app_redis_1 docker-entrypoint.sh redis Up 6379/tcp

./vessel logs mysql Attaching to my-app_mysql_1 mysql_1 | 2021-06-03 15:35:41+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.34-1debian10 started. mysql_1 | 2021-06-03 15:35:41+00:00 [Note] [Entrypoint]: Switching to dedicated user ‘mysql’ mysql_1 | 2021-06-03 15:35:41+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.34-1debian10 started. mysql_1 | 2021-06-03 15:35:41+00:00 [ERROR] [Entrypoint]: MYSQL_USER=“root”, MYSQL_USER and MYSQL_PASSWORD are for configuring a regular user and cannot be used for the root user mysql_1 | Remove MYSQL_USER=“root” and use one of the following to control the root user password: mysql_1 | - MYSQL_ROOT_PASSWORD mysql_1 | - MYSQL_ALLOW_EMPTY_PASSWORD mysql_1 | - MYSQL_RANDOM_ROOT_PASSWORD

and the passwords are empty

haha, no problem! I’ve done it myself plenty of times 😄

Glad you caught that!

On Thu, Mar 5, 2020 at 08:01 madsem notifications@github.com wrote:

@fideloper https://github.com/fideloper so sorry, it all works as expected also without password. I should not blindly use the cli history or maybe not even try to code when having a cold… I literally did not see that in my history it was using php instead of vessel, for 2 hours… I feel like an idiot 😃 Sorry for the inconvenience

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/shipping-docker/vessel/issues/110?email_source=notifications&email_token=AADSDUYWMSOO3TKZ4GTEHKTRF6WELA5CNFSM4HW7EB72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEN5LLDY#issuecomment-595244431, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADSDUYJQR5GUBSGMP77ELLRF6WELANCNFSM4HW7EB7Q .

Hey thanks for the quick reply!

First time when I updated to the latest vessel, I’ve follwed these steps: https://vessel.shippingdocker.com/docs/updating-resetting/

Here is what I did now (And realized eloquent queries actually still don’t work and throw the php_network_getaddresses error, but running vessel art migrate works!!!):

# i've aliased ./vessel to vessel
$ vessel down
$ docker volume ls
$ docker volume rm <volume>
$ vessel start

I’m running all artisan commands through vessel

edit actually scratch that, my bad, I’ve used the cli history, and because I am also using Vapor, it was actually using php artisan. sorry!!! 🗡

Maybe because I was using Laravel vapor, the whole issue was indeed user error because I got confused, I will report back when I tested Mysql 8 without password again.

Gotcha! I’ll make a note of that to improve the docs there. Those are both a result of how the MySQL container expects to have settings set when it’s created the first time and setting passwords.

Ah, I think I see the issue - Use another user other than “root” in your .env file.

In your case, run “./vessel down -v” (or follow the docs on resetting Vessel) before restarting vessel with the updated .env file.

The key there is deleting the volumes (the mysql data) so it re-creates the new users based on the updated .env file when you start vessel back up. MySQL only creates the users the first time its spun up and sees theres no data initialized yet.

On Wed, Jun 12, 2019 at 09:04 Thomas Lété notifications@github.com wrote:

Strange, I did nothing special, I installed Docker, then created a git, laravel new and followed the install procedure here : https://vessel.shippingdocker.com/docs/get-started/

I already tried to clear everything Docker related to be sure nothing is breaking there…

Here is my env file ;

APP_NAME=SoPRISM APP_ENV=local APP_KEY=base64:doYRJWkMpGE7utJ/RFmSiNiUagXjMaeXVPelwTL8IMQ= APP_DEBUG=true APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql DB_HOST=mysql DB_PORT=3306 DB_DATABASE=laravel DB_USERNAME=root DB_PASSWORD=secret

BROADCAST_DRIVER=log CACHE_DRIVER=redis QUEUE_CONNECTION=sync SESSION_DRIVER=redis SESSION_LIFETIME=120

REDIS_HOST=redis REDIS_PASSWORD=null REDIS_PORT=6379

MAIL_DRIVER=smtp MAIL_HOST=smtp.mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null

AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_DEFAULT_REGION=us-east-1 AWS_BUCKET=

PUSHER_APP_ID= PUSHER_APP_KEY= PUSHER_APP_SECRET= PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY=“${PUSHER_APP_KEY}” MIX_PUSHER_APP_CLUSTER=“${PUSHER_APP_CLUSTER}”

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/shipping-docker/vessel/issues/110?email_source=notifications&email_token=AADSDU5DWDU5PO4V3M67JLTP2D67VA5CNFSM4HW7EB72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXQQ5PY#issuecomment-501288639, or mute the thread https://github.com/notifications/unsubscribe-auth/AADSDU7EWVTN5DELF2UGIBLP2D67VANCNFSM4HW7EB7Q .