Comments (7)
@avra911 Since it doesn't happen consistently, then it's almost certainly not an issue with the capistrano-magento2 Gem, but rather something in your server configuration that is being triggered by the deployment process. I just saw the edit you made to the commend above and I agree with your assessment. I would recommend closing this issue.
from capistrano-magento2.
@avra911 I've added a setting so this argument can be configured. Details can be found in the readme and/or the above commit.
I opted to default to nil
which leaves the default at whatever the default is for bin/magento
as the --jobs
setting is only actually available in Magento 2.1.1 and later. This allows me to issue a warning if someone tries to use the setting on an unsupported version of Magento, and also keeps the default in line with whatever the Magento platform sets it to in the future (although I don't see it changing).
The underlying bug you're running into is definitely a Magento core issue (so keep that Magento issue open!), but to workaround it in the meantime, you can now add the following to your config.rb
:
set :magento_deploy_jobs, 1
from capistrano-magento2.
@avra911 A couple of things you might try:
- Try re-running the Capistrano deploy command to see if the issue is reproducible. The error is happening when cache data is being saved to Redis, so it could very well be a glitch that may not happen again if you try to re-deploy.
- If you are still getting the same error, when the error occurs, SSH into the environment, cd to the failed release directory (e.g.
cd /var/www/magento/releases/20170221151910/
) and run the exactsetup:static-content:deploy
command that Capistrano tried to run to see if you can reproduce the error. You can find the exact command in thelog/capistrano.log
file.
from capistrano-magento2.
Hi, @erikhansen
Thank you very much for the fast feedback on this.
-
Re-running capistrano deploy gives errors most of the times, see: http://nimb.ws/dTZ5JQ. The error is random, but >80% of the times it fails in a particular project only, it did not happened in any other sites/projects. However what I discover is that sometimes is a different file from static-content which fails, it not always
js-translation.json
. The command which failed wasbin/magento setup:static-content:deploy en_US
, reproducible even outside capistrano, by runningssh [email protected] /usr/bin/env php -f /path_to_site/bin/magento -- setup:static-content:deploy en_US | stdbuf -o0 tr -d .
. -
If I logged in to the server where the site is located, manually running the command which failed, it is always a success, it never fails, so it means it is only effecting while using remote command. I tried multiple times and it was always working directly from magento. I even created all the steps which deploys is doing, in order to reproduce it, but no luck.
Is a bit weird and I wanted some other feedback, tomorrow I will try to debug exactly that error (by adding some extra dump to the output) and get more details.
Best regards!
PS: I thought it might not be related to magento, because I discovered it while using capistrano, but now I doubt about that. Now I think it might not be related at all to capistrano.
from capistrano-magento2.
Sure, @erikhansen, thanks a lot!
from capistrano-magento2.
Hi, @erikhansen
I am reopening the issue because it seems a workaround might be to set the number of jobs for the static content deploy to 1, by using --jobs
(-j) which, from magento docs it means: Enable parallel processing using the specified number of jobs. The default is 4. To cause the task to run in one process (for example, if your system does not support process forking), use --jobs 1.
Would be nice to have the option to set that in deploy.rb parameters, with a default: 1 (for example named magento_deploy_jobs
).
from capistrano-magento2.
Actually it's an issue running Magento with Redis cache. See also: magento/magento2#8643 where the same solution is provided (-j 1)
from capistrano-magento2.
Related Issues (20)
- Do not run show pending updates when capistrano is outside magento git repo HOT 1
- var/reports HOT 2
- Can't install 'capistrano/magento2/cachetool' HOT 2
- [enhancement] Deploy on multiple fronts without recompiling everything on each machine HOT 2
- Catalog product images in production mode delete after deploy HOT 1
- Cached data from current release causes new release to fail with redis caching HOT 6
- Change default path of Composer HOT 2
- Magento still has issues with /pub in sitemap HOT 1
- Change deployment order of DI compile and schema upgrade HOT 2
- Problem with deploy after updated module with SFTP error in setup:di:compile step HOT 5
- Doesn't work with PHP 7.4 and Magento 2..42 HOT 4
- When execute command cap staging deploy
- Issue: Cached metadata/generated files HOT 7
- How to handle initial setup:install HOT 1
- How can I flush cache file on multi server HOT 1
- touch: cannot touch '/var/www/html/releases/20220809134142/pub/static/deployed_version.txt' No such file or directory HOT 1
- Suggestion: Add arbitrary composer_flags or option to run composer with --no-plugins HOT 1
- Capistrano version
- Support for Quality Patches Tool
- When upgrading PHP version, mainenance:enable runs against old codebase, using new php version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capistrano-magento2.