Error attempting to install Magento 2 Sample Data

Keywords: Magento - AWS - Technical issue - Plugins installation/configuration

bnsupport ID: 76d0c70e-d9fc-33a6-8a2e-6acad2f0c225

bndiagnostic output:

? Apache: Found possible issues
https://docs.bitnami.com/general/apps/wordpress/troubleshooting/debug-errors-apache/
https://docs.bitnami.com/bch/apps/moodle/troubleshooting/deny-connections-bots-apache/

bndiagnostic failure reason: The suggested guides are not related with my issue

Description:
I just provisioned an instance on AWS Lightsail w/ Magento 2.

This is a fresh install, and so far I have only installed an SSL + configured the domain and secure URLs.

This is a test store that needs sample data, and I attempted to deploy the sample data with the following command:

sudo bin/magento-cli sampledata:deploy

The following is the output:

<warning>Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/</warning>
./composer.json has been updated
Loading composer repositories with package information
<warning>Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/</warning>
Updating dependencies (including require-dev)
Package operations: 109 installs, 0 updates, 0 removals
  - Installing squizlabs/php_codesniffer (3.5.8): Downloading (100%)
  - Installing dealerdirect/phpcodesniffer-composer-installer (v0.7.1): Downloading (100%)
  - Installing symfony/polyfill-php70 (v1.20.0)
  - Installing symfony/http-foundation (v5.2.3): Downloading (100%)
  - Installing symfony/mime (v5.2.3): Downloading (100%)
  - Installing symfony/dependency-injection (v5.2.3): Downloading (100%)
  - Installing symfony/config (v5.2.3): Downloading (100%)
  - Installing magento/module-catalog-sample-data (100.4.0): Downloading (100%)
  - Installing magento/module-bundle-sample-data (100.4.0): Downloading (100%)
  - Installing magento/module-theme-sample-data (100.4.0): Downloading (100%)
  - Installing magento/module-cms-sample-data (100.4.0): Downloading (100%)
  - Installing magento/module-customer-sample-data (100.4.0): Downloading (100%)
  - Installing magento/module-downloadable-sample-data (100.4.0): Downloading (100%)
  - Installing magento/module-grouped-product-sample-data (100.4.0): Downloading (100%)
  - Installing magento/module-msrp-sample-data (100.4.0): Downloading (100%)
  - Installing magento/module-offline-shipping-sample-data (100.4.0): Downloading (100%)
  - Installing magento/module-product-links-sample-data (100.4.0): Downloading (100%)
  - Installing magento/module-review-sample-data (100.4.0): Downloading (100%)
  - Installing magento/module-catalog-rule-sample-data (100.4.0): Downloading (100%)
  - Installing magento/module-sales-rule-sample-data (100.4.0): Downloading (100%)
  - Installing magento/module-configurable-sample-data (100.4.0): Downloading (100%)
  - Installing magento/module-sales-sample-data (100.4.0): Downloading (100%)
  - Installing magento/module-swatches-sample-data (100.4.0): Downloading (100%)
  - Installing magento/module-tax-sample-data (100.4.0): Downloading (100%)
  - Installing magento/module-widget-sample-data (100.4.0): Downloading (100%)
  - Installing magento/module-wishlist-sample-data (100.4.0): Downloading (100%)
  - Installing magento/sample-data-media (100.4.0): Downloading (100%)
  - Installing phpoption/phpoption (1.7.5): Downloading (100%)
  - Installing phpcollection/phpcollection (0.5.0): Downloading (100%)
  - Installing jms/parser-lib (1.0.0): Downloading (100%)
  - Installing jms/metadata (1.7.0): Downloading (100%)
  - Installing doctrine/instantiator (1.4.0): Downloading (100%)
  - Installing doctrine/lexer (1.2.1): Downloading (100%)
  - Installing doctrine/annotations (1.11.1): Downloading (100%)
  - Installing jms/serializer (1.14.1): Downloading (100%)
  - Installing allure-framework/allure-php-api (1.1.8): Downloading (100%)
  - Installing sebastian/version (3.0.2): Downloading (100%)
  - Installing sebastian/type (2.3.1): Downloading (100%)
  - Installing sebastian/resource-operations (3.0.3): Downloading (100%)
  - Installing sebastian/recursion-context (4.0.4): Downloading (100%)
  - Installing sebastian/object-reflector (2.0.4): Downloading (100%)
  - Installing sebastian/object-enumerator (4.0.4): Downloading (100%)
  - Installing sebastian/global-state (4.0.0): Downloading (100%)
  - Installing sebastian/exporter (4.0.3): Downloading (100%)
  - Installing sebastian/environment (5.1.3): Downloading (100%)
  - Installing sebastian/diff (4.0.4): Downloading (100%)
  - Installing sebastian/comparator (4.0.6): Downloading (100%)
  - Installing sebastian/code-unit (1.0.8): Downloading (100%)
  - Installing phpunit/php-timer (3.1.4): Downloading (100%)
  - Installing phpunit/php-text-template (2.0.4): Downloading (100%)
  - Installing phpunit/php-invoker (3.1.1): Downloading (100%)
  - Installing phpunit/php-file-iterator (3.0.5): Downloading (100%)
  - Installing theseer/tokenizer (1.2.0): Downloading (100%)
  - Installing sebastian/code-unit-reverse-lookup (2.0.3): Downloading (100%)
  - Installing phpunit/php-token-stream (4.0.4): Downloading (100%)
  - Installing phpunit/php-code-coverage (8.0.2): Downloading (100%)
  - Installing webmozart/assert (1.9.1): Downloading (100%)
  - Installing phpdocumentor/reflection-common (2.2.0): Downloading (100%)
  - Installing phpdocumentor/type-resolver (1.4.0): Downloading (100%)
  - Installing phpdocumentor/reflection-docblock (5.2.2): Downloading (100%)
  - Installing phpspec/prophecy (1.12.2): Downloading (100%)
  - Installing phar-io/version (2.0.1): Downloading (100%)
  - Installing phar-io/manifest (1.0.3): Downloading (100%)
  - Installing myclabs/deep-copy (1.10.2): Downloading (100%)
  - Installing phpunit/phpunit (9.1.5): Downloading (100%)
  - Installing hoa/exception (1.17.01.16): Downloading (100%)
  - Installing hoa/event (1.17.01.13): Downloading (100%)
  - Installing hoa/consistency (1.17.05.02): Downloading (100%)
  - Installing hoa/ustring (4.17.01.16): Downloading (100%)
  - Installing hoa/protocol (1.17.01.14): Downloading (100%)
  - Installing hoa/iterator (2.17.01.10): Downloading (100%)
  - Installing hoa/stream (1.17.02.21): Downloading (100%)
  - Installing hoa/file (1.17.07.11): Downloading (100%)
  - Installing mikey179/vfsstream (v1.6.8): Downloading (100%)
  - Installing allure-framework/allure-phpunit (1.2.4): Downloading (100%)
  - Installing symfony/stopwatch (v5.2.3): Downloading (100%)
  - Installing php-cs-fixer/diff (v1.3.1): Downloading (100%)
  - Installing friendsofphp/php-cs-fixer (v2.16.10): Downloading (100%)
  - Installing lusitanian/oauth (v0.8.11): Downloading (100%)
  - Installing magento/magento-coding-standard (6): Downloading (100%)
  - Installing weew/helpers-array (v1.3.1): Downloading (100%)
  - Installing vlucas/phpdotenv (v2.6.7): Downloading (100%)
  - Installing php-webdriver/webdriver (1.8.2): Downloading (100%)
  - Installing mustache/mustache (v2.13.0): Downloading (100%)
  - Installing hoa/console (3.17.05.02): Downloading (100%)
  - Installing csharpru/vault-php-guzzle6-transport (2.0.4): Downloading (100%)
  - Installing doctrine/inflector (v1.1.0): Downloading (100%)
  - Installing psr/simple-cache (1.0.1): Downloading (100%)
  - Installing doctrine/cache (1.10.2): Downloading (100%)
  - Installing cache/cache (0.4.0): Downloading (100%)
  - Installing csharpru/vault-php (3.5.3): Downloading (100%)
  - Installing symfony/yaml (v5.2.3): Downloading (100%)
  - Installing codeception/stub (3.7.0): Downloading (100%)
  - Installing codeception/phpunit-wrapper (9.0.6): Downloading (100%)
  - Installing codeception/lib-asserts (1.13.2): Downloading (100%)
  - Installing behat/gherkin (v4.8.0): Downloading (100%)
  - Installing codeception/codeception (4.1.17): Downloading (100%)
  - Installing codeception/module-webdriver (1.2.0): Downloading (100%)
  - Installing codeception/module-sequence (1.0.1): Downloading (100%)
  - Installing codeception/module-asserts (1.3.1): Downloading (100%)
  - Installing magento/magento2-functional-testing-framework (3.2.1): Downloading (100%)
  - Installing allure-framework/allure-codeception (1.4.4): Downloading (100%)
  - Installing phpcompatibility/php-compatibility (9.3.5): Downloading (100%)
  - Installing pdepend/pdepend (2.7.1): Downloading (100%)
  - Installing phpmd/phpmd (2.9.1): Downloading (100%)
  - Installing phpstan/phpstan (0.12.23): Downloading (100%)
  - Installing theseer/fdomdocument (1.6.6): Downloading (100%)
  - Installing sebastian/finder-facade (2.0.0): Downloading (100%)
  - Installing sebastian/phpcpd (5.0.2): Downloading (100%)
symfony/dependency-injection suggests installing symfony/expression-language (For using expressions in service container configuration)
symfony/dependency-injection suggests installing symfony/proxy-manager-bridge (Generate service proxies to lazy load them)
jms/serializer suggests installing doctrine/collections (Required if you like to use doctrine collection types as ArrayCollection.)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/php-code-coverage suggests installing ext-pcov (*)
phpunit/php-code-coverage suggests installing ext-xdebug (*)
phpunit/phpunit suggests installing ext-xdebug (*)
friendsofphp/php-cs-fixer suggests installing php-cs-fixer/phpunit-constraint-isidenticalstring (For IsIdenticalString constraint.)
friendsofphp/php-cs-fixer suggests installing php-cs-fixer/phpunit-constraint-xmlmatchesxsd (For XmlMatchesXsd constraint.)
lusitanian/oauth suggests installing predis/predis (Allows using the Redis storage backend.)
php-webdriver/webdriver suggests installing ext-SimpleXML (For Firefox profile creation)
hoa/console suggests installing hoa/dispatcher (To use the console kit.)
hoa/console suggests installing hoa/router (To use the console kit.)
doctrine/cache suggests installing alcaeus/mongo-php-adapter (Required to use legacy MongoDB driver)
cache/cache suggests installing ext-apc (APC extension is required to use the APC Adapter)
cache/cache suggests installing ext-apcu (APCu extension is required to use the APCu Adapter)
cache/cache suggests installing ext-memcache (Memcache extension is required to use the Memcache Adapter)
cache/cache suggests installing ext-memcached (Memcached extension is required to use the Memcached Adapter)
cache/cache suggests installing ext-redis (Redis extension is required to use the Redis adapter)
cache/cache suggests installing ext-mongodb (Mongodb extension required to use the Mongodb adapter)
cache/cache suggests installing mongodb/mongodb (Mongodb lib required to use the Mongodb adapter)
codeception/codeception suggests installing codeception/specify (BDD-style code blocks)
codeception/codeception suggests installing codeception/verify (BDD-style assertions)
codeception/codeception suggests installing symfony/phpunit-bridge (For phpunit-bridge support)
codeception/codeception suggests installing stecman/symfony-console-completion (For BASH autocompletion)
codeception/module-webdriver suggests installing codeception/phpbuiltinserver (Start and stop PHP built-in web server for your tests)
phpcompatibility/php-compatibility suggests installing roave/security-advisories (dev-master || Helps prevent installing dependencies with known security issues.)
<warning>Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.</warning>
<warning>Package laminas/laminas-console is abandoned, you should avoid using it. Use laminas/laminas-cli instead.</warning>
<warning>Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.</warning>
<warning>Package csharpru/vault-php-guzzle6-transport is abandoned, you should avoid using it. No replacement was suggested.</warning>
<warning>Package sebastian/finder-facade is abandoned, you should avoid using it. No replacement was suggested.</warning>
Writing lock file
Generating autoload files
90 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

Installation failed, reverting ./composer.json to its original content.

In PluginManager.php(196) : eval()'d code line 188:

  chmod(): Operation not permitted


require [--dev] [--prefer-source] [--prefer-dist] [--fixed] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--skip-magento-root-plugin] [--use-default-magento-values] [--interactive-magento-conflicts] [--base-magento-edition BASE-MAGENTO-EDITION] [--base-magento-version BASE-MAGENTO-VERSION] [--] [<packages>...]

There is an error during sample data deployment. Composer file will be reverted.

It looks like the primary error is below:

In PluginManager.php(196) : eval()'d code line 188:

  chmod(): Operation not permitted

I know that through various trial and error attempts to resolve the issue on different instances before this, permissions can be finicky with the Bitnami Magento 2 stack, and I dare not attempt to tackle this without rendering the stack dead.

Let me know if you have any idea how to resolve this one. Didn’t find this specific error/solution in Bitnami community or stackoverflow.

Hi @chefoctane,

The support tool didn’t obtain the permissions of the Magento folder and the error doesn’t specify which file the PluginManager.php script was trying to edit. Let’s try to reconfigure the permissions of the installation folder so you can run the deploy command again.

sudo find /bitnami/magento -type d -exec chmod 775 {} \;
sudo find /bitnami/magento -type f -exec chmod 644 {} \;
sudo chmod +x /bitnami/magento/bin/magento-cli
sudo chown -R daemon:daemon /bitnami/magento

Note: remember to create a backup of the instance before editing the permissions

Thanks

Hi Jota,

Thanks for the update! Updating the permissions worked to deploy the sample data. All looks good on my end. The permissions were the defaults configured with the LightSail image, and I didn’t want to change them in case there was something very version-specific with all the previous suggestions I had read.

For anyone that runs into the same issue, this was AWS LightSail w/ Magento 2.4.2-21

Thanks again!

Hi @chefoctane

Thanks for reporting and confirming the solution works. I have created an internal task to review what may be causing this. In the meantime, you can resort to the aforementioned script to solve the issue :slightly_smiling_face:

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.