Comments (11)
I did:
rm -rf var/generation/*
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
works for me 🍺
from capistrano-magento2.
Is there also an app/etc/config.php
file present in the deployed file set? That, the env.php and a working database must be in place for Magento 2 to recognize itself as an installed application and display the full set of commands in the CLI tool.
from capistrano-magento2.
I'm having this same issue, Magento is installed and running but when I try to deploy I'm getting the There are no commands defined in the setup:static-content namespace.
error. If I SSH in to my server as my deploy
user i'm able to run the command successfully from within the failed release directory. It's the same deploy
user being used by Capistrano to deploy releases.
The only other time I have seen this error is when permissions have been set incorrectly, but in this instance they seem ok as i'm able to run the command manually. Is it possible that the capistrano-magento2
gem is trying to run the setup:static-content
command before the permissions have finished being set correctly?
EDIT: Ignore this, it was related to the env.php file permission in my shared directory.
from capistrano-magento2.
This happened to me -> I ran php bin/magento module:status and it threw an error that a resource.xml was not proper ! removed the resource.xml from the offending conversion module and the setup:static-content:deploy command came back! just an FYI
from capistrano-magento2.
@mrsena As you noted, the setup:static-content:deploy
command is only available to bin/magento
after Magento is installed. The current version of the gem assumes that there is working database and app/etc/env.php
configuration file (i.e. setup:install has already been run). If you take a peek in https://github.com/davidalger/capistrano-magento2/blob/master/lib/capistrano/tasks/deploy.rake you'll notice that the gem is attempting to run that pretty much immediately after the composer install, without checking to see if Magento is setup yet or not.
I get around this by manually installing Magento 2 in order to get the database and config file, then setup the capistrano gem.
Implementing from-scratch deploy support so it will the setup:install
procedure for you with some default parameters is something I'm wanting to work on here fairly soon, as it will make the initial setup of a project simpler to do.
from capistrano-magento2.
You should have setup:static-content:deploy If it does not appear then probably your installation is broken.
In the setup namespace there should be the folllowing commands available (as of Magento 2.0.7)
setup:backup Takes backup of Magento Application code base, media and database setup:config:set Creates or modifies the deployment configuration setup:cron:run Runs cron job scheduled for setup application setup:db-data:upgrade Installs and upgrades data in the DB setup:db-schema:upgrade Installs and upgrades the DB schema setup:db:status Checks if DB schema or data requires upgrade setup:di:compile Generates DI configuration and all non-existing interceptors and factories setup:di:compile-multi-tenant Generates all non-existing proxies and factories, and pre-compile class definitions, inheritance information and plugin definitions setup:install Installs the Magento application setup:performance:generate-fixtures Generates fixtures setup:rollback Rolls back Magento Application codebase, media and database setup:static-content:deploy Deploys static view files setup:store-config:set Installs the store configuration setup:uninstall Uninstalls the Magento application setup:upgrade
I suggest you to try to run setup:upgrade and look for errors.
from capistrano-magento2.
setup:static-content:deploy available only after install magento.
By default in git repo present 2 files:
- composer.json
- composer.lock
I have error when try deploy by capistrano-magento2 (Magento 2.0.7, http://devdocs.magento.com/guides/v2.0/install-gde/prereq/integrator_install.html)
Can you write full script for install from scratch?
My M2 repo: https://github.com/MrSena/demo-m2
cap production deploy
return error
[InvalidArgumentException]
01 There are no commands defined in the "setup:static-content" namespace.
from capistrano-magento2.
I did so, but the error is the same.
Capistrano create new folder in 'releases' and create symlink to app/etc/env.php (Magento already installed)
But after this 'setup:static-content' still not available in releases/xxxxxxxxxxxxxx and I have error.
00:29 magento:setup:static-content:deploy
01 php -f bin/magento -- setup:static-content:deploy | stdbuf -o0 tr -d .
01
01
01
01 [InvalidArgumentException]
01 There are no commands defined in the "setup:static-content" namespace.
01 Did you mean one of these?
01 setup
01 setup:config
01
01 setup:cron
01 setup:db-data
01 setup:db-schema
01 setup:db
01 setup:di
01 setup:performance
01 setup:store-config
I cannot figure out where I made a mistake
from capistrano-magento2.
@KevinMace That is really interesting…I'm curious though, do you know what the permissions were on the file in the shared directory that failed the command when running via Capistrano?
from capistrano-magento2.
@davidalger Sorry i'm not sure, I didn't make a note of them before they were changed to the correct permissions. If it happens again I will update this issue.
from capistrano-magento2.
@davidalger I had the same issue with env.php permissions that @KevinMace mentioned. In my case I have uploaded that file as root and it was at 644. Changing the ownership to the deploy user solved the issue.
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.