I really need help on capifony.
It follow each post on stack overflow but nothing works for me.
I try to deploy a symfony 2.3 app and I'v got this error:
Fatal error: require(): Failed opening required '../20140821061908/app/../vendor/autoload.php' (include_path=
'.:/usr/share/pear:/usr/share/php') in ../releases/20140821061908/
app/autoload.php on line 5
Below is my deploy.rb:
set :application, "*****"
set :domain, "*****"
set :deploy_to, "*****"
set :app_path, "app"
set :web_path, "web"
#set :repository, "****"
set :repository, "******"
set :user, "*****"
set :password, "******"
set :scm, :git
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, or `none`
set :model_manager, "doctrine"
# Or: `propel`
role :web, domain # Your HTTP server, Apache/etc
role :app, domain, :primary => true # This may be the same as your `Web` server
# General config stuff
set :keep_releases, 5
set :shared_files, ["app/config/parameters.yml", "app/config/parameters_dev.yml", "app/config/parameters.yml"] # This stops us from having to recreate the parameters file on every deploy.
set :shared_children, [app_path + "/logs", web_path + "/uploads"]
set :use_composer, true
set :update_vendors, true
set :branch, `git tag`.split("\n").last
set :deploy_via, :copy
#set :deploy_via, :rsync_with_remote_cache
set :update_vendors, true
set :vendors_mode, "install"
set :composer_options, "--no-dev --verbose --prefer-dist --optimize-autoloader --no-progress"
# User details for the production server
set :user, "*****"
set :use_sudo, false
ssh_options[:forward_agent] = true
ssh_options[:keys] = %w(*********)
# Run migrations before warming the cache
#before "php app/console cache:clear"
task :upload_parameters do
origin_file = "app/config/parameters.yml"
destination_file = latest_release + "/app/config/parameters.yml" # Notice the
latest_release
try_sudo "mkdir -p #{File.dirname(destination_file)}"
top.upload(origin_file, destination_file)
end
before "deploy:share_childs", "upload_parameters","symfony:cache:warmup", "symfony:doctrine:migrations:migrate"
after "deploy" do
run "cd ******** && php app/console cache:clear --env=prod && php app/console assetic:dump --env=prod"
end
# Be more verbose by uncommenting the following line
logger.level = Logger::MAX_LEVEL
This is my log:
DL is
deprecated, please use Fiddle
* 2014-08-21 12:32:33 executing `deploy'
* 2014-08-21 12:32:33 executing `deploy:update'
** transaction: start
* 2014-08-21 12:32:33 executing `deploy:update_code'
triggering before callbacks for `deploy:update_code'
--> Updating code base with copy strategy
executing locally: "git ls-remote https://github.com/********** HEA
D"
Username for 'https://github.com':
Password for '******'
command finished in 108591ms
* getting (via checkout) revision 1fae0d14fc741d4a0c5d948f7161a1e05649a58e to
C:/Users/user/AppData/Local/Temp/20140821083421
executing locally: git clone -q https://github.com/reynermedia/symfony C:/Us
ers/user/AppData/Local/Temp/20140821083421 && cd C:/Users/user/AppData/Local/Tem
p/20140821083421 && git checkout -q -b deploy 1fae0d14fc741d4a0c5d948f7161a1e056
49a58e
Username for 'https://github.com':
Password for '****':
command finished in 276697ms
* Compressing C:/Users/user/AppData/Local/Temp/20140821083421 to C:/Users/user
/AppData/Local/Temp/20140821083421.tar.gz
executing locally: tar czf 20140821083421.tar.gz 20140821083421
command finished in 16760ms
servers: ["54.244.228.172"]
** sftp upload C:/Users/user/AppData/Local/Temp/20140821083421.tar.gz -> /tmp/2
0140821083421.tar.gz
[54.244.228.172] /tmp/20140821083421.tar.gz
[54.244.228.172] done
* sftp upload complete
* executing "cd ********/releases && tar xzf /tmp/20140821083421.tar.g
z && rm /tmp/20140821083421.tar.gz"
servers: ["54.244.228.172"]
[54.244.228.172] executing command
command finished in 2800ms
* 2014-08-21 12:53:57 executing `deploy:finalize_update'
* executing "chmod -R g+w ********/releases/20140821083421"
servers: ["54.244.228.172"]
[54.244.228.172] executing command
command finished in 872ms
--> Creating cache directory
* executing "sh -c 'if [ -d *****/releases/20140821083421/app/cache
] ; then rm -rf *******/releases/20140821083421/app/cache; fi'"
servers: ["54.244.228.172"]
[54.244.228.172] executing command
command finished in 778ms
* executing "sh -c 'mkdir -p *********/releases/20140821083421/app/cach
e && chmod -R 0777 ***********/releases/20140821083421/app/cache'"
servers: ["54.244.228.172"]
[54.244.228.172] executing command
command finished in 808ms
* executing "chmod -R g+w *********/releases/20140821083421/app/cache"
servers: ["54.244.228.172"]
[54.244.228.172] executing command
command finished in 805ms
* 2014-08-21 12:54:00 executing `deploy:share_childs'
triggering before callbacks for `deploy:share_childs'
* 2014-08-21 12:54:00 executing `upload_parameters'
* executing "mkdir -p ************/releases/20140821083421/app/config"
servers: ["54.244.228.172"]
[54.244.228.172] executing command
command finished in 773ms
servers: ["54.244.228.172"]
** sftp upload app/config/parameters.yml -> **********/releases/201408210
83421/app/config/parameters.yml
[54.244.228.172] *********/releases/20140821083421/app/config/paramet
ers.yml
[54.244.228.172] done
* sftp upload complete
* 2014-08-21 12:54:02 executing `symfony:cache:warmup'
--> Warming up cache
* executing "sh -c 'cd ***********/releases/20140821083421 && php app/con
sole cache:warmup --env=prod --no-debug'"
servers: ["54.244.228.172"]
[54.244.228.172] executing command
*** [err :: 54.244.228.172] PHP Warning: Module 'apc' already loaded in Unknown
on line 0
*** [err :: 54.244.228.172] PHP Warning: require(***********/releases/2014
0821083421/app/../vendor/autoload.php): failed to open stream: No such file or d
irectory in ***********/releases/20140821083421/app/autoload.php on line 5
** [out :: 54.244.228.172]
** [out :: 54.244.228.172] Warning: require(***********/releases/201408210
83421/app/../vendor/autoload.php): failed to open stream: No such file or direct
ory in /var/www/library/releases/20140821083421/app/autoload.php on line 5
*** [err :: 54.244.228.172] PHP Fatal error: require(): Failed opening required
'/var/www/library/releases/20140821083421/app/../vendor/autoload.php' (include_
path='.:/usr/share/pear:/usr/share/php') in **********/releases/2014082108
3421/app/autoload.php on line 5
** [out :: 54.244.228.172]
** [out :: 54.244.228.172] Fatal error: require(): Failed opening required '**********/releases/20140821083421/app/../vendor/autoload.php' (include_path=
'.:/usr/share/pear:/usr/share/php') in ***********/releases/20140821083421/
app/autoload.php on line 5
command finished in 903ms
*** [deploy:update_code] rolling back
* executing "rm -rf ***********/releases/20140821083421; true"
servers: ["54.244.228.172"]
[54.244.228.172] executing command
command finished in 919ms
failed: "sh -c 'sh -c '\\''cd **********/releases/20140821083421 && php ap
p/console cache:warmup --env=prod --no-debug'\\'''" on 54.244.228.172
Thanks to @rolerbi, the de deploy pass the error and seems to do everything well. But at the end it just rollback... Below are my logs
** [out :: 54.244.228.172] 11:55:59 [file+] **********/releases/201408220
72838/app/../web/js/compiled/min_signup.js
command finished in 78664ms
* 2014-08-22 11:55:42 executing `symfony:cache:warmup'
--> Warming up cache
* executing "sh -c 'cd **********/releases/20140822072838 && php app/con
sole cache:warmup --env=prod --no-debug'"
servers: ["54.244.228.172"]
[54.244.228.172] executing command
*** [err :: 54.244.228.172] PHP Warning: Module 'apc' already loaded in Unknown
on line 0
** [out :: 54.244.228.172] Warming up the cache for the prod environment with d
ebug false
command finished in 12389ms
* executing "chmod -R g+w **********/releases/20140822072838/app/cache"
servers: ["54.244.228.172"]
[54.244.228.172] executing command
command finished in 843ms
triggering after callbacks for `symfony:cache:warmup'
* 2014-08-22 11:55:55 executing `symfony:doctrine:migrations:migrate'
triggering before callbacks for `symfony:doctrine:migrations:migrate'
* executing "sh -c 'cd **********/releases/20140822072838 && php app/con
sole --no-ansi doctrine:migrations:status --env=prod --no-debug'"
servers: ["54.244.228.172"]
[54.244.228.172] executing command
command finished in 1391ms
*** [deploy:update_code] rolling back
* executing "rm -rf **********/releases/20140822072838; true"
servers: ["54.244.228.172"]
[54.244.228.172] executing command
command finished in 2183ms
failed: "sh -c 'sh -c '\\''cd **********/releases/20140822072838 && php ap
p/console --no-ansi doctrine:migrations:status --env=prod --no-debug'\\'''" on ****************
before "deploy:share_childs", "upload_parameters","symfony:cache:warmup", "symfony:doctrine:migrations:migrate"
This line force to warmup cache before vendors are installed. Replace it with :
before "deploy:share_childs", "upload_parameters"
after "symfony:cache:warmup", "symfony:doctrine:migrations:migrate"
In place of
after "deploy" do
run "cd ******** && php app/console cache:clear --env=prod && php app/console assetic:dump --env=prod"
end
use
set :assets_install, true
set :dump_assetic_assets, true