Giter VIP home page Giter VIP logo

Comments (11)

limonazzo avatar limonazzo commented on May 31, 2024 4

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.

davidalger avatar davidalger commented on May 31, 2024 2

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.

KevinMace avatar KevinMace commented on May 31, 2024 2

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.

southerncomputer avatar southerncomputer commented on May 31, 2024 2

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.

davidalger avatar davidalger commented on May 31, 2024 1

@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.

giacmir avatar giacmir commented on May 31, 2024

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.

Serhiy-Nazarov avatar Serhiy-Nazarov commented on May 31, 2024

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.

Serhiy-Nazarov avatar Serhiy-Nazarov commented on May 31, 2024

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.

davidalger avatar davidalger commented on May 31, 2024

@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.

KevinMace avatar KevinMace commented on May 31, 2024

@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.

giacmir avatar giacmir commented on May 31, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.