Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup:upgrade not possible in after installing Sample Data Magento 2.4.1 #30685

Closed
NielsVroman opened this issue Oct 28, 2020 · 26 comments · Fixed by #30928
Closed

setup:upgrade not possible in after installing Sample Data Magento 2.4.1 #30685

NielsVroman opened this issue Oct 28, 2020 · 26 comments · Fixed by #30928
Assignees
Labels
Component: SampleData Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Reported on 2.4.1 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S1 Affects critical data or functionality and forces users to employ a workaround.

Comments

@NielsVroman
Copy link

NielsVroman commented Oct 28, 2020

Preconditions (*)

  1. Magento version 2.4.1
  2. PHP 7.4.11
  3. MYSQL 8.0.22
  4. ES 7.6.2

Steps to reproduce (*)

  1. Setup basic magento installation.
  2. Set Magento into Production Mode bin/magento deploy:mode:set production
  3. Install Magento Sample data using command: sampledata:deploy
  4. Use command setup:upgrade.

Expected result (*)

  1. setup upgrade activates modules and installs the sample data in the database.

Actual result (*)

Error thrown:
image

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.

In the system log:
[2020-10-28 11:12:45] main.ERROR: Sample Data error: Unable to unserialize value. Error: Syntax error [] []

Returning the string that causes the error is:
string(352) "{"type":"Magento\CatalogRule\Model\Rule\Condition\Combine","attribute":null,"operator":null,"value":"1","is_value_processed":null,"aggregator":"all","conditions":[{"type":"Magento\CatalogRule\Model\Rule\Condition\Product","attribute":"category_ids","operator":"()","value":%url_key=pants-women,url_key=pants-men%,"is_value_processed":false}]}"

When returning an empty array instead of throwing the error it continues into the next error:

Module 'Magento_ConfigurableSampleData':
Running data recurring...{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true."}],"type":"illegal_argument_exception","reason":"Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true."},"status":400}

Additional info from Engcom

Precondition MySQL 8

Steps to reproduce

  1. Install Magento 2.4.1 using composer create-project --repository=https://repo.magento.com/ magento/project-community-edition=2.4.1 .
  2. Deploy Sampledata bin/magento sampledata:deploy
  3. Perform Upgrade bin/magento setup:upgrade

Actual Result

Setup upgrade is aborted with an error
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.
rolled_back

@m2-assistant
Copy link

m2-assistant bot commented Oct 28, 2020

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

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

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.4-develop instance - upcoming 2.4.x release

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

Please, add a comment to assign the issue: @magento I am working on this


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@ghost ghost added this to Ready for Confirmation in Issue Confirmation and Triage Board Oct 28, 2020
@engcom-Bravo engcom-Bravo self-assigned this Oct 28, 2020
@m2-assistant
Copy link

m2-assistant bot commented Oct 28, 2020

Hi @engcom-Bravo. 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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Bravo
Copy link
Contributor

Hello @NielsVroman

Thank you for your report

We have rechecked the reported issue on Magento 2.4.1 and did not face any error

We have successfully deployed Sample Data using the command bin/magento sampledata:deploy And successfully Upgraded the instance using bin/magento setup:upgrade

Can you please provide more information about your store and settings?

Thank you in advance

@NielsVroman
Copy link
Author

@engcom-Bravo I'll try to give some more info, this is al i've got:

server is setup with
PHP 7.4.11
MYSQL 8.0.22
ES 7.6.2

The commands we used to set magento up are as followed:
composer create-project --repository-url=https://repo.magento.com/ "$MagentoEdition" "$INSTALL_DIR" "$MagentoVersion"
Where the magento version is 2.4.1, and edition is magento/project-community-edition

"$INSTALL_DIR/bin/magento" setup:install --base-url="$MAGENTO_BASE_URL"
--backend-frontname="$MAGENTO_BACKEND_FRONTNAME"
--db-host="$MAGENTO_DB_HOST"
--db-name="$MAGENTO_DB_NAME"
--db-user="$MAGENTO_DB_USER"
--db-password="$MAGENTO_DB_PASSWORD"
--admin-firstname="$MAGENTO_ADMIN_FIRSTNAME"
--admin-lastname="$MAGENTO_ADMIN_LASTNAME"
--admin-email="$MAGENTO_ADMIN_EMAIL"
--admin-user="$MAGENTO_ADMIN_USER"
--admin-password="$MAGENTO_ADMIN_PASSWORD"
--language=nl_BE
--currency=EUR
--timezone=Europe/Brussels
--use-rewrites=1
--use-secure=1
--use-secure-admin=1
--admin-use-security-key=1
--session-save=redis --key="$MAGENTO_ENCRYPTKEY"
--cleanup-database
--consumers-wait-for-messages=0

after this, we set the permissions.

"$RUN_DIR/bin/magento" cron:install
"$RUN_DIR/bin/magento" deploy:mode:set production
"$RUN_DIR/bin/magento" setup:config:set --cache-backend=redis --cache-backend-redis-server="$MAGENTO_REDIS_SERVER" --cache-backend-redis-db=3
"$RUN_DIR/bin/magento" setup:config:set --page-cache=redis --page-cache-redis-server="$MAGENTO_REDIS_SERVER" --page-cache-redis-db=4

after this some configurations.
#General admin stuff
"$RUN_DIR/bin/magento" config:set -e web/cookie/cookie_lifetime 86400;
"$RUN_DIR/bin/magento" config:set -c web/secure/enable_upgrade_insecure 1

#Elastic search
"$RUN_DIR/bin/magento" config:set -e catalog/search/engine elasticsearch7
"$RUN_DIR/bin/magento" config:set -e catalog/search/elasticsearch7_server_hostname localhost
"$RUN_DIR/bin/magento" config:set -e catalog/search/elasticsearch7_server_port 9200
"$RUN_DIR/bin/magento" config:set -e catalog/search/elasticsearch7_index_prefix magento2
"$RUN_DIR/bin/magento" config:set -e catalog/search/elasticsearch7_enable_auth 0
"$RUN_DIR/bin/magento" config:set -e catalog/search/elasticsearch7_server_timeout 15

#Europe/Belgium stuff
"$RUN_DIR/bin/magento" config:set -c general/locale/firstday 1
"$RUN_DIR/bin/magento" config:set -c general/locale/weight_unit "kgs"
"$RUN_DIR/bin/magento" config:set -c general/country/default BE

After this completes magento is running.
We install the sample data using the command.
And do setup:upgrade here it fails.

This is about everything i can give regarding the setup of magento.
These are also the only settings that are set.
No other settings were touched.

@engcom-Bravo engcom-Bravo changed the title setup:upgrade not possible after installing Sample Data Magento 2.4.1 setup:upgrade not possible in Production Mode after installing Sample Data Magento 2.4.1 Oct 29, 2020
@engcom-Bravo
Copy link
Contributor

Hello @NielsVroman

Thank you for the quick response

We are able to reproduce the issue. We have discovered that the main cause of the issue is the Production Mode

Additional info from Engcom is added to the description

@engcom-Bravo engcom-Bravo added Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Component: Setup Component: SampleData Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Oct 29, 2020
@ghost ghost moved this from Ready for Confirmation to Confirmed in Issue Confirmation and Triage Board Oct 29, 2020
@ghost ghost removed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: ready for confirmation labels Oct 29, 2020
@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Oct 29, 2020
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @engcom-Bravo
Thank you for verifying the issue. Based on the provided information internal tickets MC-38788 were created

Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@ghost ghost removed the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Oct 29, 2020
@engcom-Bravo
Copy link
Contributor

Further investigation discovered that according to Install Sample Data using Composer article on Developer Documentation, Installing sample data in production mode fails. Please use Developer modebin/magento deploy:mode:set developer to install Sample Data and Upgrade

@ghost ghost removed the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Oct 29, 2020
@ghost ghost removed this from Confirmed in Issue Confirmation and Triage Board Oct 29, 2020
@engcom-Bravo engcom-Bravo self-assigned this Oct 29, 2020
@engcom-Bravo engcom-Bravo added not-confirmed Use for Issue that was closed during confirmation and removed Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch labels Oct 29, 2020
@m2-assistant
Copy link

m2-assistant bot commented Nov 10, 2020

Hi @engcom-Golf. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

    1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
    1. If the issue is not relevant or is not reproducible any more, feel free to close it.

@m2-community-project m2-community-project bot moved this from Ready for Development to Dev In Progress in High Priority Backlog Nov 10, 2020
@sdzhepa sdzhepa added the Reported on 2.4.1 Indicates original Magento version for the Issue report. label Nov 11, 2020
@m2-community-project m2-community-project bot moved this from Dev In Progress to Pull Request In Progress in High Priority Backlog Nov 16, 2020
@m2-community-project m2-community-project bot moved this from Pull Request In Progress to Done in High Priority Backlog Nov 20, 2020
@smanav7
Copy link

smanav7 commented Dec 25, 2020

Hello, I am still facing this issue!

@karlgama
Copy link

I am also still have this issue!

@rfay
Copy link

rfay commented Dec 30, 2020

Yes, this same exact failure happens as originally reported, magento 2.4.1, attempting to install sample data, in Developer mode.

@ajmalbuffy
Copy link

Am also facing the same issue, may I know what is the fix or solution for this. I am in much needed.

@NielsVroman
Copy link
Author

I got it to work after applying the merge request.
https://github.com/magento/magento2/pull/30928/files

I applied this directly on the server as this was just a temp demo site we created.
But if you want this to work properly you should create a patch from these and add them.

@krpti-a
Copy link

krpti-a commented Jul 12, 2021

How can I fix this issue?

@max3w
Copy link

max3w commented Jan 16, 2022

I have the same problem. I'm in bin/magento deploy:mode:set developer, install demo data bin/magento sampledata:deploy then update bin/magento setup:upgrade And I get an error: 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.
Magento ver. 2.4.3-p1

@PascalBrouwers
Copy link
Contributor

PascalBrouwers commented Mar 1, 2022

Have the same issue with 2.4.3-p1 which includes the PR. Nothing is fixed.

@kirill533
Copy link

Same on 2.4.4:

bin/magento setup:upgrade:
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.

System.log: Sample Data error: Unable to unserialize value. Error: Syntax error

@navaneeth-dev
Copy link

Same on 2.3.5

@devphoenix2404
Copy link

I'm getting the same issue for 2.4.0, 2.4.1, 2.4.2, 2.4.3 and i've tried with all mode (default, developer)
Can anyone help here 🙏🏻

@bptsd
Copy link

bptsd commented Sep 5, 2022

Still happening in 2.4.5 for me in developer mode. Has anyone got a solution?

@miwrona2
Copy link

miwrona2 commented Sep 30, 2022

@max3w @PascalBrouwers
I think, it is fixed in Magento ver. 2.4.3-p1. I had the same issue while trying to execute php bin/magento setup:install (I had sample data related packages in my composer.json), so I checked var/log/system.log and found this:

[2022-09-29 12:25:04] main.ERROR: Sample Data error: {"error":{"root_cause":[{"type":"cluster_block_exception","reason":"index [magento2_product_1_v1] blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"}],"type":"cluster_block_exception","reason":"index [magento2_product_1_v1] blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"},"status":403} [] []
[2022-09-29 12:25:05] main.ERROR: Sample Data error: Unable to unserialize value. Error: Syntax error [] []
[2022-09-29 12:25:05] main.ERROR: 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.

After searching the web I realized, there is not much space on a disk Elasticsearch can use (inside docker container in my case). I freed up some space in location the container was assigned to and it fixed issue. There is another solution, when you don’t want to free up disk space:

https://www.naguel.com/blocked-by-forbidden-12-index-read-only-allow-delete-api/

but I haven’t tested that yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: SampleData Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Reported on 2.4.1 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S1 Affects critical data or functionality and forces users to employ a workaround.
Projects
Development

Successfully merging a pull request may close this issue.