Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching to EE not working #162

Open
jordangottlieb-ych opened this issue Nov 21, 2017 · 4 comments
Open

Switching to EE not working #162

jordangottlieb-ych opened this issue Nov 21, 2017 · 4 comments

Comments

@jordangottlieb-ych
Copy link

jordangottlieb-ych commented Nov 21, 2017

We are trying to set up local M2 EE dev environments on Windows 10 workstations to support our new manged M2 ECE instance. All commands below were run using Git Bash as Admin.

Install Steps

  1. Installed Git Bash (2.15.0 64-bit), Composer (1.5.2), VirtualBox (5.1.30) and Vagrant (1.8.5)
  2. Installed vagrant hostmanager, vbguest and host-shell plugins
  3. Configured Git core.autocrlf false, core.eol LF and diff.renamelimit 5000 globals
  4. Generated SSH keys and added to GitHub and M2 ECE dev environment on AWS
  5. Cloned git@github.com:paliarush/magento2-vagrant-for-developers.git into C:\Users\JordanG\Documents\Source\Magento
  6. Copied ..\vagrant-magento\etc\config.yaml.dist to config.yaml and configured EE repository url to point to M2 ECE dev master git, CE repository url to point to our forked M2 CE repo, composer_prefer_source: 1 and upped memory and cpus
  7. Copied ..\vagrant-magento\etc\composer\auth.json.dist to auth.json and configured GitHub personal access token and Magento public and private access keys
  8. Uncommented vb.gui=true in Vagrantfile to avoid issues with VirtualBox on Windows 10
  9. Ran bash init_project.sh from ..\vagrant-magento with PHPStorm closed

Install Results

Only one error logged, in cache flushing step: Can't remove /var/www/magento2ce/app/etc/env.php: Text file busy, skipping file.
image

M2 CE storefront and admin sites working:
image

EE directory populated with correct source from M2 ECE AWS dev master Git repo: C:\Users\JordanG\Documents\Source\Magento\vagrant-magento\magento2ce\magento2ee

So all is well up to this point.

Switching to EE

  1. Run PhpStorm as admin and open directory C:\Users\JordanG\Documents\Source\Magento\vagrant-magento
  2. Click yes:
    image
  3. Choose ignore for Unregistered VCS root detected. The directory C:\Users\JordanG\Documents\Source\Magento\vagrant-magento is under Git, but is not registered in the Settings.
  4. Some background tasks fire up:
    image
  5. VCS connections made:
    image
  6. After initial wave of background tasks completed in PhpStorm, run bash m-switch-to-ee with PhpStorm open
  7. Eventually, automated progress stops and this is logged: WARNING: > [Action Required] Wait while Magento2 code is uploaded in PhpStorm and press any key to continue... Not sure how long to wait... nothing seems to be happening in PhpStorm... wait 10-15 minutes...
  8. Hit a key in bash to continue script execution

Front end now shows setup page:
image

Switching to EE results in error

image

A quick search reveals RabbitMQ may not be properly installed/configured on the VM?

Per official docs, --amqp-host is:

For magento Commerce only. Do not use the --amqp options unless you have already set up an installation of RabbitMQ. See RabbitMQ installation for more information about installing and configuring RabbitMQ.

Switching to EE "without" RabbitMQ results in error

  1. Commented these lines out in: C:\Users\JordanG\Documents\Source\Magento\vagrant-magento\scripts\guest\m-reinstall
    image
  2. Run bash m-switch-to-ee -f with PhpStorm open
  3. Wait for arbitrary amount of time while Magento2 code is uploaded in PhpStorm, before pressing a key to continue... how do you know when this is done?

One error logged:
image

Front end now displays:
image

Last-ditch efforts

  • Tried flushing cache with bash m-bin-magento cache:flush but got error:
    image

  • Tried flushing cache with bash m-clear-cache - got one error:
    image

  • Seems like it worked because custom module in app/code that was committed to M2 ECE AWS dev master Git repo is installed in the admin site:
    image

But vagrant is still not switched to the EE source cloned from ECE repo. The admin sites show different versions and have all different menu options available:
image

  • Tried recompiling: bash m-bin-magento setup:di:compile - that fails:
    image

  • Tried re-deploying static content: bash m-bin-magento setup:static-content:deploy - works but vagrant is still not in EE 'mode'

  • On VM, apache2 sites-enabled does't point to EE dir... bad sign?
    <VirtualHost *:80> DocumentRoot "/var/www/magento2ce" ServerName magento2.vagrant129 <Directory "/var/www/magento2ce"> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> ErrorLog "${APACHE_LOG_DIR}/error.log" CustomLog "${APACHE_LOG_DIR}/access.log" common </VirtualHost>

Next steps?

Clearly there are some RabbitMQ issues when switching to EE, but there also seems to be some other things going wrong under the hood here. Are there any steps here where we're doing something wrong or out of order? Any feedback would be greatly appreciated!!!

Thank you!

@jordangottlieb-ych jordangottlieb-ych changed the title Switching to EE mode does nothing Switching to EE not working Nov 21, 2017
@ts-hww
Copy link

ts-hww commented Nov 29, 2017

Hi Jordan,

I looked this over, per your request. Only two things stand out to me, and they may be insignificant:

I get the same error about env.php during init.project.sh. I spent some time trying to figure out what the source of the problem is, but I decided that I could disregard it because the script completed and after that error line the status printed was "magento installed successfully" or whatever.

The other thing I noticed is that you said "Ran bash init_project.sh from ..\vagrant-magento with PHPStorm closed" which makes me wonder if it was closed at the time but had been used to open the project prior to running init_project.sh. The reason I wondered about that is because of this line from readme.md: ":warning: Do not open it in PhpStorm until init_project.sh has completed".

Good luck.

@jordangottlieb-ych
Copy link
Author

I deliberately did not open PhpStorm or the vagrant-magento directory with PhpStorm ever before the script was completed, due to the warning you pointed out.

@paliarush
Copy link
Owner

@jordangottlieb-ych thank you for such a detailed description of your issue.

RabbitMQ error that you are experiencing is caused by the fact that Magento codebase is still CE, which does not support RabbitMQ (RabbitMQ related CLI options are supported by EE only).

When you try to switch to EE on Windows the algorithm is following:

  1. build-ee.php tool (provided by Magento) is used to link your EE codebase to CE codebase. Try to run the same command manually to make sure that the tool works correctly on your instance
  2. After linking is complete (should take couple seconds), PhpStorm is supposed to automatically upload all modifications to the VM (may take a minute or so). You should see this as "Automatic upload" background task in PhpStorm. See this doc and make sure that automatic upload is configured and works correctly.

As a workaround you can just copy EE codebase on top of CE codebase and do bin ./m-switch-to-ee -f if this option is acceptable for you.

But it really seems that build-ee.php tool does not work as expected on your instance.

@jordangottlieb-ych
Copy link
Author

jordangottlieb-ych commented Dec 13, 2017

Tried configuring both the CE and EE repos in the yaml file to point to the same EE repo, installed an ran bin ./m-switch-to-ee -f which resulted in:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants