Skip to content

Commit

Permalink
Merge pull request #113 from hguthrie/hg-magecloud9766-editorial
Browse files Browse the repository at this point in the history
MCLOUD-9766: update error code schema
  • Loading branch information
BaDos authored Apr 19, 2023
2 parents 4062af8 + 392e142 commit 54e511e
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 64 deletions.
68 changes: 34 additions & 34 deletions config/schema.error.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Critical errors
!php/const Magento\MagentoCloud\App\Error::BUILD_ENV_PHP_IS_NOT_WRITABLE:
title: 'Cannot write to the `./app/etc/env.php` file'
suggestion: 'Deployment script cannot make required changes to the `/app/etc/env.php` file. Check your filesystem permissions.'
title: 'Can not write to the `./app/etc/env.php` file'
suggestion: 'Deployment script can not make required changes to the `/app/etc/env.php` file. Check your filesystem permissions.'
stage: build
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_CONFIG_NOT_DEFINED:
title: 'Configuration isn''t defined in the `schema.yaml` file'
suggestion: 'Configuration is not defined in the `./vendor/magento/ece-tools/config/schema.yaml` file. Check that the config variable name is correct, and that it is defined.'
title: 'Configuration is not defined in the `schema.yaml` file'
suggestion: 'Configuration is not defined in the `./vendor/magento/ece-tools/config/schema.yaml` file. Check that the config variable name is correct and defined.'
stage: build
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_CONFIG_PARSE_FAILED:
Expand All @@ -26,32 +26,32 @@
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_CONFIG_PHP_IS_NOT_WRITABLE:
step: refresh-modules
title: 'Cannot write to the `./app/etc/config.php` file'
suggestion: 'The deployment script cannot make required changes to the `/app/etc/config.php` file. Check your filesystem permissions.'
title: 'Can not write to the `./app/etc/config.php` file'
suggestion: 'The deployment script can not make required changes to the `/app/etc/config.php` file. Check your filesystem permissions.'
stage: build
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_CANT_READ_COMPOSER_JSON:
step: validate-config
title: 'Cannot read the `composer.json` file'
title: 'Can not read the `composer.json` file'
suggestion: 'Unable to read the `./composer.json` file. Check file permissions.'
stage: build
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_COMPOSER_MISSED_REQUIRED_AUTOLOAD:
step: validate-config
title: 'Composer.json is missing required autoload section'
title: 'The `composer.json` file is missing required autoload section'
suggestion: 'Required `autoload` section is missing from the `composer.json` file. Compare the autoload section to the `composer.json` file in the Cloud template, and add the missing configuration.'
stage: build
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_WRONG_CONFIGURATION_MAGENTO_ENV_YAML:
step: validate-config
title: 'The file `.magento.env.yaml` contains an option that is not declared in the schema, or an option configured with an invalid value or stage'
title: 'The `.magento.env.yaml` file contains an option that is not declared in the schema, or an option configured with an invalid value or stage'
suggestion: 'The `./.magento.env.yaml` file contains invalid configuration. Check the error log for detailed info.'
stage: build
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_MODULE_ENABLE_COMMAND_FAILED:
step: refresh-modules
title: 'Command failed: `/bin/magento module:enable --all`'
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.'
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.'
stage: build
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_PATCH_APPLYING_FAILED:
Expand All @@ -62,7 +62,7 @@
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_FILE_LOCAL_XML_IS_NOT_WRITABLE:
step: set-report-dir-nesting-level
title: 'Cannot write to the file `/pub/errors/local.xml`'
title: 'Can not write to the file `/pub/errors/local.xml`'
suggestion: ''
stage: build
type: critical
Expand Down Expand Up @@ -92,7 +92,7 @@
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_UTILITY_NOT_FOUND:
step: compress-static-content
title: 'Required utility wasn''t found (timeout, bash)'
title: 'Required utility was not found (timeout, bash)'
suggestion: ''
stage: build
type: critical
Expand Down Expand Up @@ -132,7 +132,7 @@
stage: build
type: critical
!php/const Magento\MagentoCloud\App\Error::BUILD_COMPOSER_PACKAGE_NOT_FOUND:
title: 'Cannot find the Composer package'
title: 'Can not find the Composer package'
suggestion: 'If you installed the Adobe Commerce application version directly from the GitHub repository, verify that the `DEPLOYED_MAGENTO_VERSION_FROM_GIT` environment variable is configured.'
stage: build
type: critical
Expand All @@ -149,12 +149,12 @@
stage: deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_ENV_PHP_IS_NOT_WRITABLE:
title: 'Cannot write to the `./app/etc/env.php` file'
suggestion: 'Deployment script cannot make required changes to the `/app/etc/env.php` file. Check your filesystem permissions.'
title: 'Can not write to the `./app/etc/env.php` file'
suggestion: 'Deployment script can not make required changes to the `/app/etc/env.php` file. Check your filesystem permissions.'
stage: deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_CONFIG_NOT_DEFINED:
title: 'Configuration isn''t defined in the `schema.yaml` file'
title: 'Configuration is not defined in the `schema.yaml` file'
suggestion: 'Configuration is not defined in the `./vendor/magento/ece-tools/config/schema.yaml` file. Check that the config variable name is correct, and that it is defined.'
stage: deploy
type: critical
Expand All @@ -175,7 +175,7 @@
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_REDIS_CACHE_CLEAN_FAILED:
title: 'Failed to clean the Redis cache'
suggestion: 'Failed to clean the Redis cache. Check that the Redis cache configuration is correct and that the Redis service is available. See [Setup Redis service](https://devdocs.magento.com/cloud/project/services-redis.html).'
suggestion: 'Failed to clean the Redis cache. Check that the Redis cache configuration is correct and that the Redis service is available. See [Setup Redis service](https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/configure/service/redis.html).'
step: 'pre-deploy: clean-redis-cache'
stage: deploy
type: critical
Expand Down Expand Up @@ -239,7 +239,7 @@
stage: deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_UTILITY_NOT_FOUND:
title: 'Required utility wasn''t found (timeout, bash)'
title: 'Required utility was not found (timeout, bash)'
suggestion: ''
stage: deploy
type: critical
Expand All @@ -257,8 +257,8 @@
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_SCD_CANNOT_UPDATE_VERSION:
step: 'deploy-static-content:generate'
title: 'Cannot update the deployed version'
suggestion: 'Cannot update the `./pub/static/deployed_version.txt` file. Check your filesystem permissions.'
title: 'Can not update the deployed version'
suggestion: 'Can not update the `./pub/static/deployed_version.txt` file. Check your filesystem permissions.'
stage: deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_SCD_CLEAN_FAILED:
Expand Down Expand Up @@ -318,7 +318,7 @@
!php/const Magento\MagentoCloud\App\Error::DEPLOY_CRYPT_KEY_IS_ABSENT:
step: install-update
title: 'The `crypt/key` key value does not exist in the `./app/etc/env.php` file or the `CRYPT_KEY` cloud environment variable'
suggestion: "This error occurs if the `./app/etc/env.php` file is not present when Adobe Commerce deployment begins, or if the `crypt/key` value is undefined. If you migrated the database from another environment, retrieve the crypt key value from that environment. Then, add the value to the [CRYPT_KEY](https://devdocs.magento.com/cloud/env/variables-deploy.html#crypt_key) cloud environment variable in your current environment. See [Add the Magento encryption key](https://devdocs.magento.com/cloud/setup/first-time-setup-import-import.html#encryption-key). If you accidentally removed the `./app/etc/env.php` file, use the following command to restore it from the backup files created from a previous deployment: `./vendor/bin/ece-tools backup:restore` CLI command .\""
suggestion: "This error occurs if the `./app/etc/env.php` file is not present when Adobe Commerce deployment begins, or if the `crypt/key` value is undefined. If you migrated the database from another environment, retrieve the crypt key value from that environment. Then, add the value to the [CRYPT_KEY](https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/configure/env/stage/variables-deploy.html#crypt_key) cloud environment variable in your current environment. See [Adobe Commerce encryption key](https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/develop/overview.html#gather-credentials). If you accidentally removed the `./app/etc/env.php` file, use the following command to restore it from the backup files created from a previous deployment: `./vendor/bin/ece-tools backup:restore` CLI command .\""
stage: deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_ES_CANNOT_CONNECT:
Expand All @@ -327,8 +327,8 @@
stage: deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_OS_CANNOT_CONNECT:
title: 'Can not connect to the Opensearch service'
suggestion: 'Check for valid Opensearch credentials and verify that the service is running'
title: 'Can not connect to the OpenSearch service'
suggestion: 'Check for valid OpenSearch credentials and verify that the service is running'
stage: deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_WRONG_BRAINTREE_VARIABLE:
Expand All @@ -345,8 +345,8 @@
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_OS_SERVICE_NOT_INSTALLED:
step: validate-config
title: 'Adobe Commerce and Magento Open Source 2.4.4 requires Opensearch or Elasticsearch service to be installed'
suggestion: 'Install Opensearch service'
title: 'Adobe Commerce and Magento Open Source 2.4.4 requires OpenSearch or Elasticsearch service to be installed'
suggestion: 'Install OpenSearch service'
stage: deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::DEPLOY_WRONG_SEARCH_ENGINE:
Expand All @@ -369,11 +369,11 @@
type: critical
!php/const Magento\MagentoCloud\App\Error::PD_ENV_PHP_IS_NOT_WRITABLE:
title: 'The `./app/etc/env.php` file is not writable'
suggestion: 'Deployment script cannot make required changes to the `/app/etc/env.php` file. Check your filesystem permissions.'
suggestion: 'Deployment script can not make required changes to the `/app/etc/env.php` file. Check your filesystem permissions.'
stage: post-deploy
type: critical
!php/const Magento\MagentoCloud\App\Error::PD_CONFIG_NOT_DEFINED:
title: 'Configuration isn''t defined in the `schema.yaml` file'
title: 'Configuration is not defined in the `schema.yaml` file'
suggestion: 'Configuration is not defined in the `./vendor/magento/ece-tools/config/schema.yaml` file. Check that the config variable name is correct, and that it is defined.'
stage: post-deploy
type: critical
Expand All @@ -394,7 +394,7 @@
type: critical
!php/const Magento\MagentoCloud\App\Error::PD_DURING_PAGE_WARM_UP:
step: warm-up
title: 'Failed to warm-up some pages'
title: 'Failed to preload some warm-up pages'
suggestion: ''
stage: post-deploy
type: critical
Expand Down Expand Up @@ -472,7 +472,7 @@
step: validate-config
type: warning
!php/const Magento\MagentoCloud\App\Error::WARN_BALER_CANNOT_BE_USED:
title: 'Baler JS bundling cannot be used'
title: 'Baler JS bundling can not be used'
stage: build
step: run-baler
type: warning
Expand Down Expand Up @@ -583,7 +583,7 @@
type: warning
!php/const Magento\MagentoCloud\App\Error::WARN_ENV_PHP_MISSED:
title: 'Adobe Commerce installation completed, but the `app/etc/env.php` configuration file was missing or empty.'
suggestion: 'Required data will be restored from environment configurations and from .magento.env.yaml file.'
suggestion: 'Required data will be restored from environment configurations and from the .magento.env.yaml file.'
stage: deploy
step: install-update
type: warning
Expand Down Expand Up @@ -647,7 +647,7 @@
step: warm-up
type: warning
!php/const Magento\MagentoCloud\App\Error::WARN_CREATE_CONFIG_BACKUP_FAILED:
title: 'Cannot create backup files'
title: 'Can not create backup files'
stage: post-deploy
step: backup
type: warning
Expand All @@ -656,14 +656,14 @@
type: warning
stage: general
!php/const Magento\MagentoCloud\App\Error::WARN_OS_ES_SERVICES_BOTH_INSTALLED:
title: 'Elasticsearch and Opensearch services are both installed at infrastructure layer. Adobe Commerce and Magento Open Source 2.4.4 and higher use Opensearch by default'
suggestion: 'Consider removing the Elasticsearch or Opensearch service from the infrastructure layer to optimize resource usage.'
title: 'Elasticsearch and OpenSearch services are both installed at infrastructure layer. Adobe Commerce and Magento Open Source 2.4.4 and later use OpenSearch by default'
suggestion: 'Consider removing the Elasticsearch or OpenSearch service from the infrastructure layer to optimize resource usage.'
stage: deploy
step: validate-config
type: warning
!php/const Magento\MagentoCloud\App\Error::DEPLOY_MAGENTO_VERSION_DOES_NOT_SUPPORT_OS:
step: validate-config
title: 'Incorrect search engine'
suggestion: 'This Adobe Commerce or Magento Open Source version does not support Opensearch. You must use versions 2.3.7-p3, 2.4.3-p2, or higher'
suggestion: 'This Adobe Commerce or Magento Open Source version does not support OpenSearch. You must use versions 2.3.7-p3, 2.4.3-p2, or later'
stage: deploy
type: critical
8 changes: 4 additions & 4 deletions config/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ variables:
build:
SCD_COMPRESSION_TIMEOUT: 900
SCD_STRATEGY:
description: Customize the deployment strategy for static content. The value "standard" will deploy all static view
files for all packages, "quick" will minimize deployment time, and "compact" will conserve space on the server.
Compact is not compatible with multi-threaded deployment and will set the value of `SCD_THREADS` to 1. The default
description: Customize the deployment strategy for static content. The value "standard" deploys all static view
files for all packages, "quick" minimizes deployment time, and "compact" conserves space on the server.
Compact is not compatible with multi-threaded deployment and sets the value of `SCD_THREADS` to 1. The default
value is "quick".
type: string
magento_version: '>=2.2.0'
Expand Down Expand Up @@ -218,7 +218,7 @@ variables:
MIN_LOGGING_LEVEL:
description: Use to override the minimum logging level for all output streams without making changes to the code.
This helps to improve troubleshooting problems with deployment. For example, if your deployment fails,
you can use this variable to increase the logging granularity globally. Doesn't affect log level for the file output.
you can use this variable to increase the logging granularity globally. Does not affect log level for the file output.
See Set up notifications—Log levels.
type: string
allowed:
Expand Down
2 changes: 1 addition & 1 deletion src/Command/DbDump.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$questionParts = [
'The db-dump operation switches the site to maintenance mode, stops all active cron jobs ' .
'and consumer queue processes, and disables cron jobs before starting the the dump process.',
'and consumer queue processes, and disables cron jobs before starting the dump process.',
'Your site will not receive any traffic until the operation completes.',
'Do you wish to proceed with this process? (y/N)?',
];
Expand Down
27 changes: 2 additions & 25 deletions src/Command/Dev/GenerateSchemaError.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,6 @@ class GenerateSchemaError extends Command
*/
private $fileList;

/**
* CSS style which appends in the bottom of the file
*/
private const FOOTER_SCRIPTS = <<<EOT
<!--Custom css-->
<!--
This is a style declaration so that first column does not wrap
-->
<style>
table.error-table td:nth-child(1) {
width: 100px;
}
table.error-table td:nth-child(2) {
width: 200px;
}
</style>
EOT;

/**
*
* @param File $file
Expand Down Expand Up @@ -137,8 +115,7 @@ private function generateDocs(array $errors): string
foreach ($typeErrors as $stage => $stageErrors) {
$result .= sprintf("\n### %s%s\n", ucfirst($stage), $stage === 'general' ? '' : ' stage');

$table = "\n{:.error-table}\n";
$table .= sprintf(
$table = sprintf(
"| Error code | %s step | Error description (Title) | Suggested action |\n",
ucfirst($stage)
);
Expand All @@ -157,7 +134,7 @@ private function generateDocs(array $errors): string
}
}

return $result . self::FOOTER_SCRIPTS;
return $result;
}

/**
Expand Down

0 comments on commit 54e511e

Please sign in to comment.