0

I was trying to set up a Magento cloud development environment on my local computer. Please let me know if Am I on the right track or any additional steps I am missing out. Thank You.

The following steps I did follow:

  • Clone cloud repository.
  • Switch to the integration branch and create a new integration2 branch.
  • Dump the remote database and import it locally
  • Download the remote app/etc/env.php file and change the database credentials.
  • Synchronize with parent envirnment using magento-cloud environment:synchronize integration
  • Install the modules using composer --no-ansi --no-interaction install --no-progress --prefer-dist --optimize-autoloader command
  • Update modules using composer update
  • Build the environment using magento-cloud build command

The errors I am getting right now.

Browser Error

An error has happened during application run. See exception log for details.

Terminal Error

The command "php ./bin/magento module:enable --all --ansi --no-interaction" failed. Warning: include(/Users/user/Sites/hoodslym2/vendor/composer/../../generated/code/Magento/Framework/App/ResourceConnection/Proxy.php): failed to open stream: No such file or directory in /Users/user/Sites/hoodslym2/vendor/composer/ClassLoader.php on line 571
run <scenario>...

The hook failed with the exit code: 11

Build complete for application mymagento
Web root: /Users/user/Sites/hoodslym2/_www

Cleaning up...

var/log/cloud.error.log

{"errorCode":1008,"suggestion":"Check if your cloud template contains latest php.ini configuration file https://github.com/magento/magento-cloud/blob/master/php.ini","title":"File php.ini does not contain opcache.blacklist_filename configuration"}
{"errorCode":1006,"stage":"build","step":"validate-config","suggestion":"No stores/website/locales found in config.php\n  To speed up the deploy process do the following:\n  1. Using SSH, log in to your Magento Cloud account\n  2. Run \"php ./vendor/bin/ece-tools config:dump\"\n  3. Using SCP, copy the app/etc/config.php file to your local repository\n  4. Add, commit, and push your changes to the app/etc/config.php file","title":"The configured state is not ideal","type":"warning"}
{"errorCode":15,"stage":"build","step":"compile-di","suggestion":"Check the `cloud.log` for more information. Add `VERBOSE_COMMANDS: '-vvv'` into `.magento.env.yaml` for more detailed command output.","title":"The command \"php ./bin/magento setup:di:compile --ansi --no-interaction\" failed. \u001b[32m%message%\u001b[39m 0/9 [>---------------------------]   0% < 1 sec 151.0 MiB\r\u001b[2K\u001b[32mProxies code generation...\u001b[39m 0/9 [>---------------------------]   0% < 1 sec 151.0 MiB\r\u001b[2K\u001b[32mProxies code generation...\u001b[39m 1/9 [===>------------------------]  11% 3 secs 157.0 MiB\r\u001b[2K\u001b[32mRepositories code generation...\u001b[39m 1/9 [===>------------------------]  11% 3 secs 157.0 MiB\r\u001b[2K\u001b[32mRepositories code generation...\u001b[39m 2/9 [======>---------------------]  22% 36 secs 352.0 MiB\r\u001b[2K\u001b[32mService data attributes generation...\u001b[39m 2/9 [======>---------------------]  22% 36 secs 352.0 MiB\r\u001b[2K\u001b[32mService data attributes generation...\u001b[39m 3/9 [=========>------------------]  33% 37 secs 354.0 MiB\r\u001b[2K\u001b[32mApplication code generator...\u001b[39m 3/9 [=========>------------------]  33% 37 secs 354.0 MiB\r\u001b[2K\u001b[32mApplication code generator...\u001b[39m 4/9 [============>---------------]  44% 1 min 378.0 MiB\r\u001b[2K\u001b[32mInterceptors generation...\u001b[39m 4/9 [============>---------------]  44% 1 min 378.0 MiB\r\u001b[2K\u001b[32mInterceptors generation...\u001b[39m 5/9 [===============>------------]  55% 4 mins 466.5 MiB\r\u001b[2K\u001b[32mArea configuration aggregation...\u001b[39m 5/9 [===============>------------]  55% 4 mins 466.5 MiB","type":"critical"}
{"errorCode":11,"stage":"build","step":"refresh-modules","suggestion":"Try to run `composer update` locally. Then, commit and push the updated `composer.lock` file. Also check the `cloud.log` for more information. For more detailed command output, add the `VERBOSE_COMMANDS: '-vvv'` option to  the `.magento.env.yaml` file.","title":"The command \"php ./bin/magento module:enable --all --ansi --no-interaction\" failed. Warning: include(/Users/user/Sites/hoodslym2/vendor/composer/../../generated/code/Magento/Framework/App/ResourceConnection/Proxy.php): failed to open stream: No such file or directory in /Users/user/Sites/hoodslym2/vendor/composer/ClassLoader.php on line 571","type":"critical"}

var/log/debug.log

[2023-02-06 13:12:41] report.ERROR: Error: Application is not installed yet.  [] []
[2023-02-06 13:12:43] report.CRITICAL: No key available {"exception":"[object] (RuntimeException(code: 0): No key available at /Users/user/Sites/hoodslym2/vendor/magento/framework/Encryption/Encryptor.php:262)"} []

Development Environment

Magento 2.4.3-p1
PHP 7.4.33
Composer 1.10.26
MySQL 5.7.29
NGINX 1.23.3
Elasticsearch 7.8.1
macOS Monterey 12.4
1

2 Answers 2

1

Here are the steps on how I set up my local:

  1. Clone Magento cloud repo
  2. composer install
  3. php ./vendor/bin/ece-patches apply
  4. Run the warden env up
  5. Import db

Ready to go. Super simple to handle local env with server config

2
  • I have some limitations using docker currently. I will definitely check this out. I'm grateful for your assistance. Feb 7, 2023 at 5:18
  • You can try steps 1, 2, and 3 and treat them as other Magento installation
    – Sohel Rana
    Feb 7, 2023 at 5:31
1

A few points:

  • magento-cloud environment:synchronize integration takes action on the remote cloud environments, not local.
  • composer install is appropriate for local setup as it maintains version control. composer update is not appropriate, and should only be used if the intent is to update the versions of all modules.
  • magento-cloud build is not appropriate for local setup. It works exclusively on the Magento Cloud infrastructure.

Probably the main problem comes from running magento-cloud build. Reset your branch and run build commands manually. If Magento is in developer mode, the only one you really need is composer install and bin/magento setup:update. And, maybe a cache clearing or reindexing along the way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.