Error: Malfunctioning Elasticsearch
Symptoms
Unable to apply data patch
Magento\CatalogSampleData\Setup\Patch\Data\InstallSimpleProducts
for module Magento_CatalogSampleData.
{"error":"no handler found for uri [/magento2_product_1_v1/document_mapping?include_type_name=true] and method [PUT]"}
Solution
Due to ElasticSearch version is not yet supported by the current Magento instance: https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html.
Just install Elasticsearch 7.17
Error: Gd2.php line 70
Solution
Here Image Adapter try opens to image files (‘open function in Gd2.php line 72). validateURLScheme function return false always because it checking ‘URL’ format but local files not valid for this format, so it returns false.
Find validateURLScheme function in vendor\magento\framework\Image\Adapter\Gd2.php file
. at line 92. Replace function with this:
private function validateURLScheme(string $filename) : bool
{
$allowed_schemes = ['ftp', 'ftps', 'http', 'https'];
$url = parse_url($filename);
if ($url && isset($url['scheme']) && !in_array($url['scheme'], $allowed_schemes) && !file_exists($filename)) {
return false;
}
return true;
}
Only change is && !file_exists($filename)
text added at line 96.
Error: PluginListGenerator.php on line 411
Solution
Find write(array $scopes) function in magento2\lib\internal\Magento\Framework\Interception\PluginListGenerator.php
file. at line 156.
// Replace
$cacheId = implode('|', $this->scopePriorityScheme) . "|" . $this->cacheId;
// With
$cacheId = implode('-', $this->scopePriorityScheme) . "-" . $this->cacheId;
We only changed the |
-> -
character.
Error Magento\Framework\Exception\ValidatorException: Invalid template file
Add extra code in
magento2\lib\internal\Magento\Framework\View\Element\Template\File\Validator.php
file
protected function isPathInDirectories($path, $directories) {
if (!is_array($directories)) {
$directories = (array)$directories;
}
$realPath = $this->fileDriver->getRealPath($path);
$realPath = str_replace('\\', '/', $realPath); // extra code added
foreach ($directories as $directory) {
if (0 === strpos($realPath, $directory)) {
return true;
}
}
return false; }
Sources:
Error: require-config.js
is not a function
Solution
Change the project base-config "base-url" from "http://localhost/magento2" to " http://localhost/magento2/pub"
bin/magento setup:store-config:set --base-url="http://localhost/magento2/pub/"
Error: Image not displaying
Solution
Run this command
bin/magento catalog:image:resize
Be patience cause this seemingly simple command could take half and hour
Error: The requested package magento/module-bundle-sample-data could not be found in any version, there may be a typo in the package name
Solution
composer config repositories.magento composer https://repo.magento.com/
composer config http-basic.repo.magento.com a0a6f216e5da943ce3a36ac92d430456 b0436530e2c686c94e1ad8948411aa55
Sources:
Error: bin/magento
Permission Denied
https://magefan.com/blog/bin-magento-permission-denied
Error: The default website isn't defined
Remove app/etc/env.php
Top comments (0)