0

This is killing me.

When I run bin/magento setup:upgrade it throws this:

Warning: include(/vendor/composer/../../generated/code/Magento/Framework/App/Config/InitialConfigSource/Proxy.php): failed to open stream: No such file or directory in /vendor/composer/ClassLoader.php on line 444

And when I run bin/magento setup:di:compile it throws this:

Class Magento\Framework\App\ResourceConnection\Proxy does not exist

Site was running perfectly. I had run setup:upgrade before without any problem. I had also ran di:compile.

But today, all of sudden this is happening.

Any idea?

UPDATE

I used to follow this every time when I compile: https://devdocs.magento.com/guides/v2.3/performance-best-practices/deployment-flow.html

Could it be the reason now that I cannot run bin/magento setup:upgrade or bin/magento setup:di:compile?

I remember, at first running bin/magento setup:upgrade it threw error, after that I am stuck, couldn't run any CLI commands.

UPDATE 2

On first run setup:upgrade, it threw an error. Unfortunately I did not make a note of that and re-run the setup:upgrade again. Since then the above-mentioned error is thrown.

UPDATE 3

Alright, so in my local instance, I was able to reproduce a similar error. It's slightly different than what I was getting in my live server:

Warning: include(/vendor/composer/../../generated/code/Magento/Framework/App/ResourceConnection/Proxy.php): failed to open stream: No such file or directory in /vendor/composer/ClassLoader.php on line 444

So, after I ran composer update It did allow me to run Magento CLI commands. And I was able to compile.

I still want to understand this. I am yet to perform this into my live server.

1

If you use dockergento try

dockergento composer dump-autoload
 docker exec -it -u 0 hp_redis_1 bash

Then inside

redis-cli flushall
exit

and then run setup:upgrade . If you don't use dockergento it might be something similar for bin magento. first try bin/magento composer dump-autoload.

| improve this answer | |
0

I would suggest to run update composer. Please follow the below command.

composer update

php bin/magento cache:flush and cache:clean

php bin/magento setup:upgrade

Hope this will help you.

| improve this answer | |
  • I know, like I said, I want to understand this. Why this happens, what are the causes? – Adarsh Khatri Apr 12 at 22:00
  • Can you please let me know, your issue has been fixed using my solution or not? – Nits Apr 13 at 10:29
0

You are running composer or magento commands with root user (sudo), just fix the permissions and the owners of your magento files and directories (fix the generated directory and remove its content)

After fixing the owner here is a good answer for the permissions

| improve this answer | |
  • There is no permission issue. I am running command same way I have been running, that is from magento user. – Adarsh Khatri Apr 17 at 21:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.