cloudinary / cloudinary_magento2

Cloudinary's Magento 2 extension. Upload product images to the cloud, manipulate them to match your graphic design and optimize images for better user experience
MIT License
15 stars 8 forks source link

Unable to properly install an extension on magento 2.4 CE #111

Closed jaaf85 closed 1 year ago

jaaf85 commented 2 years ago

Hi, i am trying to install the extension on magento CE 2.4 (image on docker Bitnami-docker-magento). But after completing installation process with composer, i am faced to Class Not Found ,

i suspect some missing generated code : first i tought that it was related to my installation process with some permissions problem but i used the recommended steps on your readme page, with user of magento and i am facing this issue.

BUG REPORT INFORMATION here are key informations from my environment: --> Host OS : unbuntu 21.04 --> docker , docker-compose : version from june 2021 --> magento community edition --> extension to install: cloudinary-magento2 extension

What steps will reproduce the bug?

Access to magento container bash from the host , using daemon user ( user of magento ) on magento root directory :

sudo docker-compose exec magento bash su daemon -s /bin/bash cd /bitnami/magento

Performing the installation process with daemon user when needed

composer require cloudinary/cloudinary-magento2 php bin/magento maintenance:enable php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy -f php bin/magento maintenance:disable php bin/magento cache:flush

What is the expected behavior? access to the admin panel UI to configure the extension. and access to the store

What do you see instead? on the admin panel :

image after clicking on settings to configure the cloudinary plugin : i get :

Error: Class 'Cloudinary\Cloudinary\Model\AutoUploadMapping\AutoUploadConfiguration' not found in /bitnami/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121 Stack trace: #0 /bitnami/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() https://github.com/bitnami/bitnami-docker-magento/pull/1 /bitnami/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create() https://github.com/bitnami/bitnami-docker-magento/pull/2 /bitnami/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get() https://github.com/bitnami/bitnami-docker-magento/pull/3 /bitnami/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create() https://github.com/bitnami/bitnami-docker-magento/pull/4

on the store page : 1 exception(s): Exception #0 (InvalidArgumentException): Plugin class Cloudinary\Cloudinary\Plugin\Cms\Block\Block doesn't exist

Exception #0 (InvalidArgumentException): Plugin class Cloudinary\Cloudinary\Plugin\Cms\Block\Block doesn't exist

1 Magento\Framework\Interception\PluginList\PluginList->_inheritPlugins() called at [vendor/magento/framework/Interception/PluginList/PluginList.php:192]

2 Magento\Framework\Interception\PluginList\PluginList->getNext() called at [generated/code/MGS/Mpanel/Block/Cms/Block/Interceptor.php:22]

3 MGS\Mpanel\Block\Cms\Block\Interceptor->toHtml() called at [app/design/frontend/Mgs/claue/Magento_Theme/templates/html/header.phtml:23]

4 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:71]

5 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/View/Element/Template.php:273]

6 Magento\Framework\View\Element\Template->fetchView() called at [vendor/magento/framework/View/Element/Template.php:303]

7 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1111]

8 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1115]

9 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:675]

10 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [vendor/magento/framework/View/Layout.php:578]

11 Magento\Framework\View\Layout->_renderBlock() called at [vendor/magento/framework/View/Layout.php:555]

12 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]

13 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]

14 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]

15 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]

16 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]

17 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]

18 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]

19 Magento\Framework\View\Layout->renderElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:140]

20 Magento\Framework\View\Layout\Interceptor->renderElement() called at [vendor/magento/framework/View/Layout.php:606]

21 Magento\Framework\View\Layout->_renderContainer() called at [vendor/magento/framework/View/Layout.php:557]

22 Magento\Framework\View\Layout->renderNonCachedElement() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:149]

23 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]

Additional information

Version

Output of docker version: Client: Docker Engine - Community Version: 20.10.7 API version: 1.41 Go version: go1.13.15 Git commit: f0df350 Built: Wed Jun 2 12:00:45 2021 OS/Arch: linux/amd64 Context: default Experimental: true Server: Docker Engine - Community Engine: Version: 20.10.7 API version: 1.41 (minimum version 1.12) Go version: go1.13.15 Git commit: b0f5bc3 Built: Wed Jun 2 11:58:56 2021 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.4.6 GitCommit: d71fcd7d8303cbf684402823e425e9dd2e99285d runc: Version: 1.0.0-rc95 GitCommit: b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7 docker-init: Version: 0.19.0 GitCommit: de40ad0

Output of docker info: Client: Context: default Debug Mode: false Plugins: app: Docker App (Docker Inc., v0.9.1-beta3) buildx: Build with BuildKit (Docker Inc., v0.5.1-docker) scan: Docker Scan (Docker Inc., v0.8.0)

Server: Containers: 4 Running: 3 Paused: 0 Stopped: 1 Images: 4 Server Version: 20.10.7 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: true userxattr: false Logging Driver: json-file Cgroup Driver: cgroupfs Cgroup Version: 1 Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc Default Runtime: runc Init Binary: docker-init containerd version: d71fcd7d8303cbf684402823e425e9dd2e99285d runc version: b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7 init version: de40ad0 Security Options: apparmor seccomp Profile: default Kernel Version: 5.11.0-17-generic Operating System: Ubuntu 21.04 OSType: linux Architecture: x86_64 CPUs: 4 Total Memory: 7.581GiB Name: vps-73c654a3 ID: 7ISF:DTCZ:LYLM:22LP:EGZK:AKCJ:5EUB:GXEF:DH37:TPWS:GDP2:44N6 Docker Root Dir: /var/lib/docker Debug Mode: false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false

wissam-khalili commented 2 years ago

Hi @jaaf85 ,

Thank you for reaching out. Could you please share your Cloudinary Cloud name and the Cloudinary plugin version that you are trying to install? Is it an upgrade or a fresh install?

Thanks, Wissam

jaaf85 commented 2 years ago

Hi Wissam,

thank you for your reply .

my cloud name is : ddurwg6xm i a m on a staging server trying to test cloudinary integration before going in production.

i am trying to install the version behind the composer code:version "cloudinary/cloudinary-magento2 "

when i look to composer logs , its succesfully install this version

Downloading cloudinary/cloudinary_php (1.20.1)

and for information, i am using a well crafted docker image of magento (provided by bitnami). so i run the command with the magento user and not root user. i have succesfully installed other extensions on this image through composer

wissam-khalili commented 2 years ago

Hi @jaaf85 ,

Could you provide us SSH access to your environment in order to review the installation?

Thanks, Wissam

wissam-khalili commented 2 years ago

Hi @jaaf85 ,

I'm following up to see whether you had a chance to look into my last response.

Thanks, Wissam

jaaf85 commented 2 years ago

Hi Wissam, thank you for your message ! i am still struggling with this. i can try to provide you with an SSH access to the environment. How do you want me to give you the needed credentials with privacy ?
Thanks, Jaaf

atdcloud commented 2 years ago

Hi @jaaf85,

Using the docker-compose.yml provided by the bitnami team here. I was able to deploy Magento with docker-compose up -d, then docker-compose exec magento sh to shell into the container, then lastly composer require cloudinary/cloudinary-magento2 to install the cloudinary extension. I then cd vendor to check if the cloudinary folder is installed. Lastly, I navigated to Store > Configuration in Magento to set up the cloudinary integration. As you can see, I didn't need to invoke the php bin/magento executables. Perhaps try this instead and let us know how it goes?

Thanks, Anthony

jaaf85 commented 2 years ago

Hi @atdcloud Anthony. Thank you for your investsgation time. I will try this today and keep you posted . Just one question about your installation process. What user did you use to launch the command composer require cloudinary/cloudinary-magento2 ? On my installation process i used the magento user and not root user. Thanks, Jaaf

atdcloud commented 2 years ago

@jaaf85 When I shell into the container, it uses the default user (which I believe is the root) as I didn't pass -u specific user param. Try it out and let us know how it goes.

atdcloud commented 2 years ago

@jaaf85 just checking back and do let us know if there's still an issue.

jaaf85 commented 2 years ago

Hi Anthony,

sorry for the delay, i tried your instructions and its seems to be working 👍 in fact using composer require command with root user and without the others command seems to make it work

for information the module was disabled by default and i enbale it with user of magento and not root

i will try the configuration and run it and keep you posted if it's definitevely working or not :)

thank you so much !

jaaf85 commented 2 years ago

just one question : does the missing command will induce some weird behavior afterwards ?
php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy -f

atdcloud commented 2 years ago

Hi @jaaf85,

Thank you for the update and glad that it works. Yes, by default the plug-in needs to be explicitly enabled because one of its requirements is for you to supply it with Cloudinary's environment variable. For the most part, the extra commands are to update the Magento and its schema, compile dependency injections, and delete generate files. I suggested not running these extra commands as I would like to see if our plug-in loads in Magento without touching the Magento's environment as there could be other factors that are in play outside of our plug-in (other third-party extensions). However, you should be able to run those commands. Let us know if there are any issues.