Closed owerg closed 4 years ago
I think you need to run make dev
running for that to work so the database is up and ready to receive migrations. Give that a shot and let me know!
No luck. I may have to wipe it all out and try again from scratch tomorrow.
On Thu, Oct 1, 2020, 4:05 PM Seth Etter notifications@github.com wrote:
I think you need to run make dev running for that to work so the database is up and ready to receive migrations. Give that a shot and let me know!
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/devict/votelocal/issues/116#issuecomment-702397292, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFQKKKXVVVZVORBDSFI42ODSITVJ3ANCNFSM4SA3R4DA .
@owerg dang. Can you share your .env
, .my.cnf
and .db.env
files? (A lot of secret files I know 😭)
Well that's maybe where I messed up. I just did a cp of the 3 example files from the initial git clone. So those 3 files are identical to mine.
On Thu, Oct 1, 2020, 5:26 PM Seth Etter notifications@github.com wrote:
@owerg https://github.com/owerg dang. Can you share your .env, .my.cnf and .db.env files? (A lot of secret files I know 😭)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/devict/votelocal/issues/116#issuecomment-702429521, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFQKKKWDKUW7QOE64KWLCWLSIT6YNANCNFSM4SA3R4DA .
@owerg did you copy the docker versions of the examples? The .env specifically has one I think.
It looks like I did grab the docker versions:
cp .env.docker.example .env
cp .db.env.docker.example .db.env
cp .my.cnf.example .my.cnf
The .db.env
and .my.cnf
files still match the example versions. .env
somehow has an updated APP_KEY:
< APP_KEY=
---
> APP_KEY=base64:2S2xbr7xRTY9LAUc4UDPnzJZLYFEENzU9Ti2rcq9Rv8=
I cleaned things up and started fresh via:
docker rm -f $(docker ps -a -q)
docker volume rm $(docker volume ls -q)
sudo rm -rf votelocal
git clone git@github.com:devict/votelocal.git
cd votelocal
cp .env.docker.example .env
cp .db.env.docker.example .db.env
cp .my.cnf.example .my.cnf
From here, I tried doing a couple things in parallel:
Window 1: make dev
Window 1: Wait until webpack.Progress reached 100%
(See attached 1_make_dev.txt -- this is everything prior to the Ctrl+C near the end)
Window 2: make dev-setup
(See attached 2_make_dev_setup.txt -- you can see it fail with SQLSTATE[HY000] [2002] Connection timed out
)
Window 1: Ctrl+C to stop the dev machines
Window 1: make dev
Window 1: Wait until webpack.Progress reached 100%
(See attached 3_make_dev_2nd_attempt.txt)
Window 2: make dev-setup
(See attached 4_make_dev_setup_2nd_attempt.txt -- this time it fails with SQLSTATE[HY000] [1130] Host '172.18.0.7' is not allowed to connect to this MySQL server
)
I did notice that the db container exited early in the first make dev
attempt and it stayed up in the 2nd attempt. This probably explains the differences between the failures in make dev-setup
. I'm still not sure what I'm missing to get things to move along, though.
If this is taking too much of your time & effort and you get sick of helping, just let me know. I can close this and poke at some other project. But I'm more than happy to keep sending whatever debug info you need as well.
1_make_dev.txt 2_make_dev_setup.txt 3_make_dev_2nd_attempt.txt 4_make_dev_setup_2nd_attempt.txt
@owerg I'm curious where the issue is so I can get it added to the README and hopefully help others who may be running into this issue. I'm going to try and recreate locally now, and we'll go from there. I'll keep you posted!
@owerg what OS are you operating on?
Good news! I'm standing things up from scratch and seeing the same issue. Once I get it worked out I'll update the README and report back.
@owerg I think I have the issue fixed! Pull down the latest master.
The issue was that the .my.cnf
file wasn't allowing mysql client connections. It was left over from some fiddling I was doing awhile back and turns out to not be necessary anymore.
Let me know if that solves the problem!
$ git pull
$ docker-compose down -v # Deletes containers and volumes for the project
$ make dev
Then make db-migrate && make db-seed
in another terminal. The other dev-setup
tasks should already be covered (app key, mainly).
Much better this time! Everything appears to have worked and come up. I'm seeing the attached error when I open localhost:8002 in a browser, though.
Can you check existence and permissions for storage/logs/laravel.log
?
It is present and owned by root:root with 644 (RW/R/R) permissions.
If I chmod it to 666, it gets farther, but I run into other issues. Probably permission related as well?
EDIT: The command I used was:
sudo chmod 666 storage/logs/laravel.log
I've never seen that one 😬 looks like a failure to write to the file? Maybe there are other files failing?
I haven't run into that either. You might double check that all of storage
and bootstrap/cache
are writable.
I think that was the issue. I'm running docker as a regular user that belongs to the docker group. It looks like storage and bootstrap belong to the user with 755 permissions and then some root:root files are peppered in underneath there.
As the regular user I went ahead and did:
chmod -R a+w,g+w storage/
chmod -R a+w,g+w bootstrap/
It looks like things are up and running now. There are some new files that belong to www-data:www-data in storaga/framework/views/ which seems to confirm that www-data couldn't create the necessary files before.
EDIT: Thank you both for all your help here.
I updated the DOCKER.md file with a couple more details based on what I found from here: https://stackoverflow.com/questions/30639174/how-to-set-up-file-permissions-for-laravel
I am trying to set up the dev environment for the first time. I am sure I just have something set up incorrectly, but the instructions don't give me any clues what I've done wrong. Here is what I'm seeing for the output: