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

Problem with deploy after updated module with SFTP error in setup:di:compile step #155

Closed
yattargor opened this issue Jan 27, 2021 · 5 comments

Comments

@yattargor
Copy link

yattargor commented Jan 27, 2021

Hello,

first of all I would like to thank those who maintain this capistrano-magento2, it is really very useful and its optimal functioning, but I have a problem.

I got to the point that I have to update a Mageplaza plugin not via composer but simply by copying the folder /app and overwriting it within the webserver. After doing the usual compilations and upgrades, clear the cache as usual ... everything in the development environment works fine.

But as soon as I go to deploy in my staging environment, capistrano gives me an error at the "setup: di: compile" step

"""
Interceptors generation...

Class Magento\Newsletter\Model\SubscriptionManagerInterface does not exist
Class Mageplaza\BetterMaintenance\Plugin\Controller\Subscriber\NewAction\In
terceptor generation error: The requested class did not generate properly,
because the 'generated' directory permission is read-only. If --- after run
ning the 'bin/magento setup:di:compile' CLI command when the 'generated' di
rectory permission is set to write --- the requested class did not generate
properly, then you must add the generated class object to the signature of
the related construct method, only.
"""

I can't understand why this, I've always updated the plugins via composer this is the first time that i updated plugin via SFTP. Can you tell me how I can proceed to resolve this fail deploy?

Thank you in advance for your answer

@PascalBrouwers
Copy link

They gave you a patched version of the Mageplaza module didn't they?
If you have it in app/code instead of a composer module the deployment will work just fine.
If that staging environment has allot of visitors and is using Redis caching you might have run into the same problem as me: #151

@yattargor
Copy link
Author

yattargor commented Jan 28, 2021

Thank you for your response, probably this is the problem infact I use redis on my staging server.
I'm not very skilled in capistrano-magento2, so I put your code:

`
Rake::Task["magento:maintenance:enable"].clear

namespace :magento do
namespace :maintenance do
task :enable do
on release_roles :all do
within release_path do
execute :magento, 'cache:flush'
execute :magento, 'maintenance:enable'
execute :magento, 'cache:flush'
end
end
end
end
end
`

in "deploy.rake" file in lib/task in magento capistrano folder, so maybe this override normal deploy but the end is the same...

01 php -f bin/magento -- setup:di:compile --no-ansi 01 Compilation was started. 01 %message% 0/7 [>---------------------------] 0% < 1 sec 72.5 MiB%message% 0/7 [>------------------------… 01 Proxies code generation... 0/7 [>------------------------] 0% < 1 sec 72.5 MiB 01 01 Proxies code generation... 1/7 [===>---------------------] 14% 1 sec 78.5 MiB 01 01 Repositories code generation... 1/7 [===>------------------] 14% 1 sec 78.5 MiB 01 01 Repositories code generation... 2/7 [=====>-------------] 28% 13 secs 237.0 MiB 01 01 Service data attributes generation... 2/7 [===>---------] 28% 13 secs 237.0 MiB 01 01 Service data attributes generation... 3/7 [=====>-------] 42% 13 secs 239.0 MiB 01 01 Application code generator... 3/7 [=====>-------] 42% 13 secs 239.0 MiB 01 01 Application code generator... 4/7 [=======>-----] 57% 28 secs 263.0 MiB 01 01 Interceptors generation... 4/7 [=======>-----] 57% 28 secs 263.0 MiB 01 01 In Generator.php line 139: 01 01 Class Magento\Newsletter\Model\SubscriptionManagerInterface does not exist 01 Class Mageplaza\BetterMaintenance\Plugin\Controller\Subscriber\NewAction\In 01 terceptor generation error: The requested class did not generate properly, 01 because the 'generated' directory permission is read-only. If --- after run 01 ning the 'bin/magento setup:di:compile' CLI command when the 'generated' di 01 rectory permission is set to write --- the requested class did not generate 01 properly, then you must add the generated class object to the signature of 01 the related construct method, only.

Excuse for this, but you are the man and probably your solution is correct, but i have to understand it!

Thank you in advance for your answer

@PascalBrouwers
Copy link

See, my latest response in that thread. I'm not using the override of "magento:maintenance:enable" anymore.

@yattargor
Copy link
Author

OK, I used your final response in that thread like you say. But probably for my incompetence I din't manage to fix problem.
I used your code in deploy.rake file and try to execute during deploy but probably I am not on the right way.

Strange... in the past I have various problems with capistrano-magento2 but after some headache I resolve that, if you have some further advice for me your are the best!

Thank you

@yattargor
Copy link
Author

Seems that problem is plugin that I have installed, because in their forum, others people have my problem.

Thank you Pascal for your answer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants