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

Magento_Paypal module has dependency on Magento_Csp module #38764

Open
5 tasks
dverkade opened this issue May 28, 2024 · 12 comments
Open
5 tasks

Magento_Paypal module has dependency on Magento_Csp module #38764

dverkade opened this issue May 28, 2024 · 12 comments
Labels
Area: Framework Component: Csp Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for dev Reported on 2.4.7 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@dverkade
Copy link
Member

dverkade commented May 28, 2024

Preconditions and environment

  • Magento Open Source 2.4.7

Steps to reproduce

This file has a dependency on Magento_Csp: https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Paypal/Model/Config.php#L9

However it's not listed in the modules module.xml.

Expected result

Do not use Magento_Csp in module, or declare it as a dependency in the module.xml

Actual result

When Magento_Csp is disabled product detail pages throw an error because of the missing dependency:

==> exception.log <==
[2024-05-28T09:50:40.591031+00:00] main.CRITICAL: Error: Cannot instantiate interface Magento\Csp\Model\Collector\MergerInterface in vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121
Stack trace:
#0 vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject()
#1 vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create()
#2 vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get()
#3 vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create()
#4 vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get()
#5 vendor/magento/framework/ObjectManager/ObjectManager.php(73): Magento\Framework\ObjectManager\Factory\Compiled->create()
#6 vendor/magento/module-paypal/Model/Config.php(642): Magento\Framework\ObjectManager\ObjectManager->get()
#7 vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(121): Magento\Paypal\Model\Config->__construct()
#8 vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject()
#9 vendor/magento/framework/ObjectManager/ObjectManager.php(59): Magento\Framework\ObjectManager\Factory\Compiled->create()
#10 generated/code/Magento/Paypal/Model/ConfigFactory.php(43): Magento\Framework\ObjectManager\ObjectManager->create()
#11 vendor/magento/module-paypal/Model/PayLaterConfig.php(46): Magento\Paypal\Model\ConfigFactory->create()

Additional information

As Magento_Csp module cannot be disabled with 2.4.7 as it is tightly integrated, this issue can be reproduced by disabling the Magento_Csp module in 2.4.6 and upgrade it to 2.4.7.

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Copy link

m2-assistant bot commented May 28, 2024

Hi @dverkade. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ 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, join the Community Contributions Triage session to discuss the appropriate ticket.

Copy link

m2-assistant bot commented May 28, 2024

Hi @engcom-Dash. 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).
    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
    1. Add Area: XXXXX label to the ticket, indicating the functional areas 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!

@engcom-Delta engcom-Delta added the Reported on 2.4.7 Indicates original Magento version for the Issue report. label May 28, 2024
@engcom-Dash engcom-Dash removed their assignment May 28, 2024
@engcom-Dash engcom-Dash added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label May 28, 2024
@engcom-November engcom-November self-assigned this May 29, 2024
Copy link

m2-assistant bot commented May 29, 2024

Hi @engcom-November. 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).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas 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-November
Copy link
Contributor

Hello @dverkade,

Thank you for the report and collaboration!

We were not able to reproduce this issue on 2.4.7 community edition and 2.4-develop.
Because the Magento_Csp module is a required dependency in composer.json file of Paypal module.
image

So whenever we try to disable Magento_Csp module it will throw below error:

Unable to change status of modules because of the following constraints:
Cannot disable Magento_Csp because modules depend on it:
Magento_Paypal: Magento_Paypal->Magento_Csp

Please let us know if we are missing something on this.

Thank you.

@engcom-November engcom-November added the Issue: needs update Additional information is require, waiting for response label May 29, 2024
@hostep
Copy link
Contributor

hostep commented May 29, 2024

@dverkade: I've created https://github.com/baldwin-agency/magento2-module-csp-shim last week, if you at the moment don't want to use the CSP module and want to have a working Magento 2.4.7 project.

@leonhelmus
Copy link

@hostep Thanks for adding this module!

@NateSwanson7
Copy link

Hello @dverkade,

Thank you for the report and collaboration!

We were not able to reproduce this issue on 2.4.7 community edition and 2.4-develop. Because the Magento_Csp module is a required dependency in composer.json file of Paypal module. image

So whenever we try to disable Magento_Csp module it will throw below error:

Unable to change status of modules because of the following constraints:
Cannot disable Magento_Csp because modules depend on it:
Magento_Paypal: Magento_Paypal->Magento_Csp

Please let us know if we are missing something on this.

Thank you.

@engcom-November that's true, but if you already have the Magento_Csp module disabled you'll run into the error mentioned in the ticket description. I also get it when trying to view the payment methods in the admin config, and when trying to place an order.

@sprajapat770
Copy link

@engcom-November getting similar error , currently we are not using CSP module

Error: Cannot instantiate interface Magento\Csp\Model\Collector\MergerInterface in /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121

@engcom-November
Copy link
Contributor

engcom-November commented Jun 21, 2024

Hello @dverkade,

Thank you for the report and collaboration!

We are to to reproduce this issue with 2.4.6 and upgrading it to 2.4.7.
Disabled the Magento_Csp module in 2.4.6 and after updating it to 2.4.7, we got the below error when opening frontend:

main.CRITICAL: Error: Cannot instantiate interface Magento\Csp\Model\Collector\MergerInterface in /opt/homebrew/var/www/magento246p5ce/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121

Hence confirming this issue.

Thanks.

@engcom-November engcom-November added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Component: Csp Area: Framework labels Jun 21, 2024
@m2-community-project m2-community-project bot removed the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Jun 21, 2024
@m2-community-project m2-community-project bot added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed and removed Issue: needs update Additional information is require, waiting for response labels Jun 21, 2024
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-12281 is successfully created for this GitHub issue.

Copy link

m2-assistant bot commented Jun 21, 2024

✅ Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@github-jira-sync-bot
Copy link

❌ You don't have permission to export this issue.

@engcom-Hotel engcom-Hotel added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Framework Component: Csp Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for dev Reported on 2.4.7 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Status: Ready for Development
Development

No branches or pull requests

10 participants