4

I use capifony with symfony 2.

My deploy.rb

set :application, "Name project"
set :domain,      "My Ip"
set :deploy_to,   "My folder"
set :app_path,    "app"

set :repository,  "git@bitbucket.org:dou/test.git"
set :scm,         :git
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, or `none`

set :model_manager, "doctrine"
# Or: `propel`

set :shared_files,      ["app/config/parameters.yml"]
set :shared_children,   [app_path + "/logs", web_path + "/uploads", web_path + "/media", "vendor"]

set :use_composer, true
#set :composer_options,  "--prefer-source --no-interaction"

set :deploy_via, :copy
set :branch, "master"

set :user, 'user'
set :password, 'pass'


role :web,        domain                         # Your HTTP server, Apache/etc
role :app,        domain, :primary => true       # This may be the same as your `Web` server

set  :keep_releases,  3
set :use_sudo,   false
set :update_vendors,    true 
# Be more verbose by uncommenting the following line
logger.level = Logger::MAX_LEVEL
#set :dump_assetic_assets, true
set :ssh_options, { :forward_agent => true }


default_run_options[:pty] = true

And it was all ok. But yesterday I had an error.

 * 2013-12-10 11:51:23 executing `symfony:cache:warmup'
--> Warming up cache
  * executing "sh -c 'cd /home/myproject/beta/releases/20131210094811 && php app/console cache:warmup --env=prod --no-debug'"
    servers: ["IP"]
    [IP] executing command
 ** [out :: IP] Warming up the cache for the prod environment with debug false
    command finished in 18712ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /home/myproject/beta/releases/20131210094811; true"
    servers: ["IP"]
    [IP] executing command
    command finished in 633ms
failed: "sh -c 'sh -c '\\''cd /home/myproject/beta/releases/20131210094811 && php app/console cache:warmup --env=prod --no-debug'\\'''" on IP

Capifony try clear cache for prod, but it can't.So Can I see somehow error, why it can't clear cache? It clear cache for dev, but for prod it fails without any error for me.

Nicolai Fröhlich
  • 51,330
  • 11
  • 126
  • 130
denys281
  • 2,004
  • 2
  • 19
  • 38
  • Just a little comment, i don't know the answer but i can see '--no-debug' in your command line.... ? – BENARD Patrick Dec 10 '13 at 10:33
  • Yes.this command run capifony. Maybe you konw how run this command with debug? – denys281 Dec 10 '13 at 10:57
  • The only thing i know is when in my console i type "php app/console cache:warmup --env=prod" all work.... Like there's not "--no-debug", maybe it will write something if you have errors ? – BENARD Patrick Dec 10 '13 at 11:00
  • What's the `umask` for the deployment user on the server? – Nicolai Fröhlich Dec 10 '13 at 11:09
  • @nifr 002 . The point is, that all worked last week, and it successful clear cache for dev. – denys281 Dec 10 '13 at 11:24
  • Ah okay it's `002`. I was suggesting a permission-issue (i.e. the cache-directory not being writeable) - this question might be related to **[this question](http://stackoverflow.com/questions/20355742/an-error-occurred-when-executing-the-cacheclear-no-warmup-command-with)**. – Nicolai Fröhlich Dec 10 '13 at 11:29
  • @nifr I saw this question, but @whitebear didn't saw error. Now I run `cap -d deploy` and don't execute `php app/console cache:warmup --env=prod --no-debug`, but this isn't solution. – denys281 Dec 10 '13 at 11:39
  • You should try to disable the `cache:warmup`-step and see if the deployment finishes correctly then. afterwards connect to the the server via ssh manually, invoke the command and examine the errors. Further examine the file-permissions and ownership of the `cache`-folder. – Nicolai Fröhlich Dec 10 '13 at 11:43
  • I do this, when I make `cap -d deploy`,and I don't execute cache:warmup command. And after this in my new release I make `php app/console cache:warmup --env=prod --no-debug`and all works without error. I will try to find how execute cache:warmup without --no-debug during deploy. – denys281 Dec 10 '13 at 11:50
  • the `--no-debug` flag is conditionally (depending on the `symfony_debug` setting) added in the `console_options` definition in [`lib/capifony_symfony2.rb#L167`](https://github.com/everzet/capifony/blob/master/lib/capifony_symfony2.rb#L167). Just add `set :symfony_debug, true` to your `deploy.rb` . – Nicolai Fröhlich Dec 10 '13 at 12:00
  • What additional error message do you get with `symfony_debug` set to true? – Nicolai Fröhlich Dec 10 '13 at 12:25
  • @nifr I get nothing, there are no additional error messages :( – denys281 Dec 10 '13 at 16:41
  • I've got the very same problem. And same as denys281 I don't get any errors using any of the methods mentioned here. It seems that the command just finishes without a proper return value. When executing manually it works perfectly. – Michi Dec 11 '13 at 04:34

0 Answers0