magento / magento-cloud-docker

All Submissions you make to Magento Inc. (“Magento") through GitHub are subject to the following terms and conditions: (1) You grant Magento a perpetual, worldwide, non-exclusive, no charge, royalty free, irrevocable license under your applicable copyrights and patents to reproduce, prepare derivative works of, display, publically perform, sublicense and distribute any feedback, ideas, code, or other information (“Submission") you submit through GitHub. (2) Your Submission is an original work of authorship and you are the owner or are legally entitled to grant the license stated above. (3) You agree to the Contributor License Agreement found here: https://github.com/magento/magento2/blob/master/CONTRIBUTOR_LICENSE_AGREEMENT.html
Open Software License 3.0
256 stars 192 forks source link

Fix plugins installation error for existing elasticsearch container #334

Closed daiduongvo18 closed 2 years ago

daiduongvo18 commented 3 years ago

Description

When starting a existing elasticsearch container which has ES_PLUGINS in environment section, the container failed to start because the plugins installation command in the docker-entrypoint.sh script throw error say that the plugin is already installed. The issue can be fixed by checking where a plugin was installed or not before installing it. This issue can be produced by below steps:

  1. Define plugins in ES_PLUGINS
  2. Run docker-compose up -d
  3. Run docker-compose stop
  4. Run docker-compose up -d
  5. Run docker-compose logs elasticsearch Last lines in the logs will contain the content below:
    elasticsearch_1  | Intalling plugins: 
    elasticsearch_1  | -> Installing analysis-kuromoji
    elasticsearch_1  | -> Downloading analysis-kuromoji from elastic
    elasticsearch_1  | -> Failed installing analysis-kuromoji
    elasticsearch_1  | -> Rolling back analysis-kuromoji
    elasticsearch_1  | -> Rolled back analysis-kuromoji
    elasticsearch_1  | ERROR: plugin directory [/usr/share/elasticsearch/plugins/analysis-kuromoji] already exists; if you need to update the plugin, uninstall it first using command 'remove analysis-kuromoji'

Fixed Issues (if relevant)

N/A

Manual testing scenarios

  1. Define plugins in ES_PLUGINS
  2. Run docker-compose up -d
  3. Run docker-compose stop
  4. Run docker-compose up -d
  5. Run docker-compose logs elasticsearch Last lines in the logs will contain the content below:
    workdir_elasticsearch_1 | Intalling plugins: analysis-nori
    workdir_elasticsearch_1 | -> Already installed analysis-nori

    Release notes

For user-facing changes, add a meaningful release note. For examples, see Magento Cloud Docker release notes.

Associated documentation updates

Add link to Magento DevDocs PR or Issue, if needed.

Contribution checklist

magento-cloud-ft-jenkins-svc commented 3 years ago

Unit & Integration Test Results

:white_check_mark:  All unit and integration tests have passed.

Unit Test Output

PHPUnit 8.5.21 by Sebastian Bergmann and contributors.

......                                                              6 / 6 (100%)

Time: 274 ms, Memory: 12.00 MB

OK (6 tests, 18 assertions)

Generating code coverage report in Clover XML format ... done [640 ms]

Integration Test Output

PHPUnit 8.5.21 by Sebastian Bergmann and contributors.

..................                                                18 / 18 (100%)

Time: 4.89 seconds, Memory: 36.00 MB

OK (18 tests, 18 assertions)

This comment was generated by Jenkins job magento-cloud-docker/unit build 65.

magento-cloud-ft-jenkins-svc commented 3 years ago

Static Analysis & Code Style Results

:white_check_mark:  All static analysis and code style checks have passed.

PHP Codesniffer Output

............................................................ 60 / 89 (67%)
.............................                                89 / 89 (100%)

Time: 5.38 secs; Memory: 12MB

PHP Mess Detector Output


Found 0 violations and 0 errors in 2594ms

No mess detected

PHPStan Output


 [OK] No errors                                                                 

This comment was generated by Jenkins job magento-cloud-docker/static build 66.

magento-cloud-ft-jenkins-svc commented 3 years ago

Functional Acceptance Test Results

:white_check_mark:  All functional acceptance tests have passed.

PHP 7.2

PHP 7.3

PHP 7.4

This comment was generated by Jenkins job magento-cloud-docker/functional build 91.