LandRover / StaffjoyV2

Staffjoy V2 - all microservices in a monorepo
MIT License
141 stars 53 forks source link

`make dev` fails on macOS #15

Open btc opened 2 years ago

btc commented 2 years ago

🙏

Hi there. make dev is failing for me. Is macOS supported as a development environment?

What environment did you encounter the issue in?

development

macOS 11.6 Virtual Box 6.1.26 Vagrant 2.2.18 vagrant-hostmanager (1.8.9) vagrant-disksize (0.1.3) modd 0.8 go version go1.17 darwin/amd64 (go mod enabled)

What did you do?

  1. install virtualbox
  2. install vagrant
  3. install the two vagrant plugins
  4. run make dev

What did you expect to see?

successful creation of the development environment

What did you see instead?

StaffjoyV2  (master) λ. make dev
bash vagrant/dev-watch.sh
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/focal64'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: staffjoy-v2.local
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "987d898d-4e43-46aa-b66d-33b9b8315d2e", "--type", "headless"]

Stderr: VBoxManage: error: RawFile#0 failed to create the raw output file staffjoy-v2.local-console.log (VERR_FILE_NOT_FOUND)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole

make: *** [dev] Error 1

Are there any logs indicating an issue?

I am not aware of any.

LandRover commented 2 years ago

Hey, VM provisioning seems to fail.

I ran it locally from a Mac and everything worked without modifications, wondering what's off, Maybe if it's a permission thing, it fails to create the VM's log file, or path issue.

Try modifying this file and line: https://github.com/LandRover/StaffjoyV2/blob/master/Vagrantfile#L37 Pointing maybe to /tmp/%s-console.log instead of %s-console.log

Before you run 'make dev', make sure VM runs correctly using the following: `

bash $ vagrant up $ vagrant ssh $ cd $STAFFJOY $ make dev-build `

btc commented 2 years ago

Hi. Thanks for the response. I want to make sure I understand your instructions.

In doing so, it seems I need a Vagrantfile outside the repo (for vagrant up). Am I understanding your instructions correctly?

LandRover commented 2 years ago

Hey, Inside the repo's dir, same level as Vagrantfile located, as you wrote, run in the order I've posted above

Lemme know how it went.

Thanks,

btc commented 2 years ago

Thanks!

The steps were successful. The app is running. Feel free to close this issue, as the provisioning issue has been overcome.

🙏

Now, the app is hanging post-login. I've created a user, retrieved the activation link, and entered a company name. Is the app known to be working?

image
LandRover commented 2 years ago

Nice! happy to hear it booted :)

DB UP for sure?

katekyonni commented 2 years ago

I'm having the same problem. I was able to create a user, but after logging in it's hanging.

@btc were you able to get this working?

@LandRover how do I check if the db is up?

btc commented 2 years ago

@katekyonni I haven't tried since the last update above. I'm very curious in this though. I could be motivated to pick it back up.

katekyonni commented 2 years ago

I think the db is up, because if I ssh into the VM with vagrant ssh and check the running containers with docker ps I see mariadb running. But no idea how to debug this further.

LandRover commented 2 years ago

Only mariadb? could you paste docker ps please?

Also, please do the following:

vagrant ssh cd $STAFFJOY && ./vagrant/minikube.sh && ./vagrant/mysql.sh docker ps

bjohnson135 commented 1 year ago

I'm able to get the app up and running from within vagrant with the make dev-build command, but outside of vagrant using make dev it keeps shutting down the vm. bjohnson@Bens-MacBook-Pro StaffjoyV2 % make dev bash vagrant/dev-watch.sh Bringing machine 'default' up with 'virtualbox' provider... ==> default: [vagrant-hostmanager:guests] Updating hosts file on active guest virtual machines... ==> default: [vagrant-hostmanager:host] Updating hosts file on your workstation (password may be required)... ==> default: Machine already provisioned. Runvagrant provisionor use the--provision ==> default: flag to force provisioning. Provisioners marked to run always will still run. ==> default: Attempting graceful shutdown of VM...

LandRover commented 1 year ago

Personally, I mostly use make dev-build but I'll have a look.

bjohnson135 commented 1 year ago

Thanks! For what it’s worth, in order to make dev-build successful I must run ./vagrant/minikube && ./vagrant/MySQL.sh when starting with a fresh vagrant instance.

bjohnson135 commented 1 year ago

Dove a bit deeper into this and it looks like I didn't have my go env set correctly, setting GO111MODULE=on allowed make dev to run. Though, after it completes the script it doesn't result in the app up and running.

LandRover commented 1 year ago

Just to make sure you're running on Ventura, and latest virtualbox?

bjohnson135 commented 1 year ago

Correct, up to date on both