humanmade / altis-local-chassis

Local Chassis module for Altis
https://www.altis-dxp.com/resources/docs/local-chassis/
4 stars 3 forks source link

Altis start is not working #41

Closed nprasath002 closed 4 years ago

nprasath002 commented 5 years ago

Trying Altis for the fist time. I am following instructions from https://www.altis-dxp.com/resources/docs/getting-started/

Starting Altis seems to be not working. http://altis.local/

Prasaths-MacBook-Pro-2:altis nprasath002$ composer chassis start
Bringing machine 'altis.local' up with 'virtualbox' provider...
==> altis.local: Running action triggers before up ...
==> altis.local: Running trigger...
==> altis.local:
==> altis.local: Checking if box 'chassis/chassis' version '1.0.0' is up to date...
==> altis.local: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> altis.local: flag to force provisioning. Provisioners marked to run always will still run.
==> altis.local: Running provisioner: set_constants (shell)...
    altis.local: Running: /var/folders/kx/nn_w_8717r9fldtwp1jtpsc00000gn/T/vagrant-shell20191018-13603-2vsnep.sh
Prasaths-MacBook-Pro-2:altis nprasath002$

Let me know if you need any further info.

nprasath002 commented 5 years ago

Running vagrant provision inside chasis folder fixed the issue

rmccue commented 5 years ago

@nprasath002 did you already have a chassis directory? This seems to indicate the machine has already been created previously.

nprasath002 commented 5 years ago

@rmccue Even without the directory the command created the directory and stopped in the middle the output was the same

nprasath002 commented 5 years ago

Here is the steps to reproduce

  1. composer create-project altis/skeleton my-project
  2. cd my-project
  3. composer chassis init
  4. After this command the chasis directory is created.
  5. At the end it asks the following question Install HTTPS certificate? [Y/n] y
  6. Giving yes will display this message The HTTPS certificate file "altis.local.cert" does not exist yet. Runcomposer chassis startfirst to provision the VM and generate the file.
  7. Running composer chassis start output the following
    Prasaths-MBP-2:altis nprasath002$ composer chassis start
    Cloning into '/Users/nprasath002/PhpstormProjects/altis/chassis/extensions/yarn'...
    remote: Enumerating objects: 109, done.
    remote: Total 109 (delta 0), reused 0 (delta 0), pack-reused 109
    Receiving objects: 100% (109/109), 15.49 KiB | 5.16 MiB/s, done.
    Resolving deltas: 100% (35/35), done.
    Bringing machine 'altis.local' up with 'virtualbox' provider...
    ==> altis.local: Running action triggers before up ...
    ==> altis.local: Running trigger...
    ==> altis.local:
    ==> altis.local: Checking if box 'chassis/chassis' version '1.0.0' is up to date...
    ==> altis.local: Machine already provisioned. Run `vagrant provision` or use the `--provision`
    ==> altis.local: flag to force provisioning. Provisioners marked to run always will still run.
    ==> altis.local: Running provisioner: set_constants (shell)...
    altis.local: Running: /var/folders/kx/nn_w_8717r9fldtwp1jtpsc00000gn/T/vagrant-shell20191022-4367-u2z9q0.sh
    Prasaths-MBP-2:altis nprasath002$
roborourke commented 4 years ago

@nprasath002 the only way I can see for this to happen is if the VM wasn't first destroyed before removing the chassis directory. Deleting that directory doesn't get rid of the VM, it still exists in the VirtualBox library. You can either try running vagrant destroy from the chassis directory or removing the VM via the VirtualBox GUI.

We could however look into detecting whether the machine exists during the init command and prompt to destroy it, or bring it up and provision it.

Also it's a bug that the prompt to install the cert is output if a previous command returns a non-zero exit code so we should fix that.

roborourke commented 4 years ago

@nprasath002 I've created issues #44 and #45 to avoid problems like the ones you've encountered. Can you let me those would solve your problem in future?

Destroying the machine first should clear up your immediate problem anyway.

nprasath002 commented 4 years ago

the only way I can see for this to happen is if the VM wasn't first destroyed before removing the chassis directory.

I have not removed the chasis directory at any point

nprasath002 commented 4 years ago

I tried a fresh install and it worked. Here are the steps followed

  1. composer create-project altis/skeleton altis-demo
  2. cd altis demo
  3. composer chassis init
    1. Chassis downloaded and configured. Launch and install virtual machine? [Y/n]. At this point chasis directory is created. I entered y 2 Install HTTPS certificate? [Y/n] y

After the above steps

The HTTPS certificate was installed successfully!
You can now browse to https://altis-demo.local/

Documentation needs to be updated to reflect the above steps. I never needed to run composer chassis start during the first install and this follows the pattern of vagrant install

roborourke commented 4 years ago

Awesome, thanks @nprasath002. I'll close this out and make a PR to correct the docs in the docs module repo.