magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.55k stars 9.32k forks source link

Unable to apply data patch Magento\CatalogSearch\Setup\Patch\Data\SetInitialSearchWeightForAttributes for module Magento_CatalogSearch. #25294

Closed TomashKhamlai closed 5 years ago

TomashKhamlai commented 5 years ago

Preconditions (*)

  1. Apache 2.4
  2. PHP 7.2
  3. MYSQL 8.0 from Mysql Apt Repo

Steps to reproduce (*)

  1. Clone and install Magento

Expected result (*)

  1. Magento installs

Actual result (*)

  1. Error:
    
    [Progress: 377 / 686]
    Module 'Magento_CatalogSearch':

In PatchApplier.php line 167:

Unable to apply data patch Magento\CatalogSearch\Setup\Patch\Data\SetInitialSearchWeightForAttributes for module Magento_CatalogSearch. Original exception message: Temporary table for index catalogsearch_fulltext doesn't exist, which is inconsistent with state of sc
ope resolver

In IndexSwitcher.php line 61:

Temporary table for index catalogsearch_fulltext doesn't exist, which is inconsistent with state of scope resolver


![image](https://user-images.githubusercontent.com/11827230/67617715-ba37b180-f7ee-11e9-9451-dd598c6cc66f.png)
m2-assistant[bot] commented 5 years ago

Hi @TomashKhamlai. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@TomashKhamlai do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?


m2-assistant[bot] commented 5 years ago

Hi @engcom-Delta. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

magento-engcom-team commented 5 years ago

Hi @TomashKhamlai. Thank you for your report. The issue has been fixed in magento/magento2#25357 by @akaplya in 2.3-develop branch Related commit(s):

The fix will be available with the upcoming 2.3.4 release.

adobe-commerce-developer commented 3 years ago

I have this issue in 2.4.2 After bin/magento sampledata:deploy, bin/magento setup:upgrade I get exception in cli: Unable to apply data patch Magento\CatalogSampleData\Setup\Patch\Data\InstallCatalogSampleData for module Magento_CatalogSampleData. Original exception message: Rolled back transaction has not been completed correctly.

upendra-bajpai commented 3 years ago

I have this issue in 2.4.0 After bin/magento sampledata:deploy, bin/magento setup:upgrade I get exception in cli: Unable to apply data patch Magento\CatalogSampleData\Setup\Patch\Data\InstallCatalogSampleData for module Magento_CatalogSampleData. Original exception message: Rolled back transaction has not been completed correctly.

famousuniverse commented 3 years ago

is there a fix? Have the same issue

clernoc commented 3 years ago

Same problem. I did not expect such famed CMS would have so many issues for that long time...

everestbis commented 3 years ago

same issue Unable to apply data patch Magento\CatalogSampleData\Setup\Patch\Data\InstallCatalogSampleData for module Magento_CatalogSampleData. Original exception message: Rolled back transaction has not been completed correctly.

clernoc commented 3 years ago

Magento2 is still a whole issue, I can't remember if anything I have tried to do worked as it should. Perhaps they simply do not know what they do, or do not have enough people to cover all work necessary, but you as an user or a developer will suffer because of that. Magento1 earned status of being reliable and predictable system, when Magento2 ruined all of that. I managed to make it work after numerous attempts and environment reassembly, it took me more a week just to start it correctly, and dropped it since I understood it is only the beginning, you get much more ahead.

wishbone-productions commented 3 years ago

This helped me: http://www.zhishibo.com/articles/94429.html

everestbis commented 3 years ago

Check for log in var/log/debug.log . There should be error message.

For me the error was due to problem in saving product. I tried saving product from admin panel but could not. I scheduled index update and product save worked from admin panel. After that sample data deploy also worked.

salehawal commented 3 years ago

same problem here : Unable to apply data patch Magento\CatalogRuleSampleData\Setup\Patch\Data\InstallCatalogRuleSampleData for module Magento_CatalogRuleSampleData. Original exception message: Rolled back transaction has not been completed correctly.

kotisyamala commented 2 years ago

The same issue for me also on 2.4.4

abbsay commented 2 years ago

The same issue for me also on 2.4.4 +1

abbsay commented 2 years ago

so long no fix ?

yair-levy commented 2 years ago

Same issue on clean installation 2.4.5

t-eichmann commented 1 year ago

Had the same problem with 2.4.5. Turned out I accidentally used the wrong port for Elasticsearch in the configuration. After fixing that in the DB everything went fine.

D3er11 commented 1 year ago

check var/log/debug.log for errors if see something with elastic check elastic version and magento installation configuration

torhoehn commented 1 year ago

I got the following error during running setup:upgrade:

Module 'Magento_CatalogSampleData':
Enabling caches:
Current status:
layout: 1
block_html: 1
full_page: 1
Unable to apply data patch Magento\CatalogSampleData\Setup\Patch\Data\InstallCatalogSampleData for module Magento_CatalogSampleData. Original exception message: Rolled back transaction has not been completed correctly.
Failed to run magento set:up: exit status 1

In var/log/debug.log and var/log/system.log there was the following entry: [2023-04-24T19:27:04.931174+00:00] main.ERROR: Sample Data error: DateTimeZone::__construct(): Unknown or bad timezone () [] []

In the core_config_data table the value for general/locale/timezone was empty. After setting it to Europe/Berlin the command went through succesfully.

AntonEvers commented 1 year ago

I was able to resolve this, on a Mac, with ElasticSearch installed through homebrew.

Before this error, I always saw the following errors in the var/log/system.log:

[2023-05-04T12:35:33.520048+00:00] report.ERROR: Sample Data error: {"error":{"root_cause":[{"type":"cluster_block_exception","reason":"index [acom246_product_1_v1] blocked by: [TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];"}],"type":"cluster_block_exception","reason":"index [acom246_product_1_v1] blocked by: [TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];"},"status":429} [] []

The disk usage exceeded flood-stage watermark error occurred when I still have 897 GB of available disk space. This resolved my issue:

curl -X PUT "localhost:9200/_cluster/settings?pretty" -H 'Content-Type: application/json' -d'
{
  "persistent": {
    "cluster.routing.allocation.disk.watermark.low": "90%",
    "cluster.routing.allocation.disk.watermark.high": "95%",
    "cluster.routing.allocation.disk.watermark.flood_stage": "97%"
  }
}
'
curl -X PUT "localhost:9200/*/_settings?expand_wildcards=all&pretty" -H 'Content-Type: application/json' -d'
{
  "index.blocks.read_only_allow_delete": null
}
'

Source: https://www.elastic.co/guide/en/elasticsearch/reference/7.17/fix-common-cluster-issues.html