Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't seem to deploy with capistrano3... but all responses are successful. #41

Closed
jfrux opened this issue Feb 10, 2014 · 18 comments

Comments

Projects
None yet
7 participants
@jfrux
Copy link

commented Feb 10, 2014

$ cap production deploy
 INFO [e9cd1232] Running /usr/bin/env mkdir -p /tmp/my_app/ on my_app.com
 INFO [e9cd1232] Finished in 0.484 seconds with exit status 0 (successful).
 INFO Uploading /tmp/my_app/git-ssh.sh 100.0%
 INFO [e91dcfcd] Running /usr/bin/env chmod +x /tmp/my_app/git-ssh.sh on my_app.com
 INFO [e91dcfcd] Finished in 0.063 seconds with exit status 0 (successful).

This all looks good, but it doesn't create the directories or anything.

@swalkinshaw

This comment has been minimized.

Copy link
Member

commented Feb 10, 2014

Is that your full deploy log? Change this to :debug as well and then check the output: https://github.com/roots/bedrock/blob/master/config/deploy.rb#L17

@jfrux

This comment has been minimized.

Copy link
Author

commented Feb 10, 2014

Thanks, that helped me... been a long day... I've done this 100 times and today I'm just losing it.
Thanks again!

@jfrux jfrux closed this Feb 10, 2014

@jfrux

This comment has been minimized.

Copy link
Author

commented Feb 10, 2014

my only issue now seems to be this:

...
 INFO [eb460cd5] Running /usr/bin/env composer install --no-dev --no-scripts --quiet --optimize-autoloader on site.com
DEBUG [eb460cd5] Command: cd /home/site/public_html/releases/20140210225657 && ( WP_ENV=production /usr/bin/env composer install --no-dev --no-scripts --quiet --optimize-autoloader )
DEBUG [eb460cd5]    /usr/bin/env:
DEBUG [eb460cd5]    composer
DEBUG [eb460cd5]    : No such file or directory
DEBUG [eb460cd5]
cap aborted!
composer stdout: Nothing written
composer stderr: Nothing written

@jfrux jfrux reopened this Feb 10, 2014

@swalkinshaw

This comment has been minimized.

Copy link
Member

commented Feb 11, 2014

Does running composer work if you just SSH into your server? If it doesn't, thats something you need to solve first. If it does, could be similar to these solutions:

http://discourse.roots.io/t/capistrano-composer-step-failure/1046
http://discourse.roots.io/t/deploying-wordpress-with-capistrano-screencast/863/26?u=swalkinshaw

@jfrux

This comment has been minimized.

Copy link
Author

commented Feb 11, 2014

Yep it does work if I SSH into the server.

@swalkinshaw

This comment has been minimized.

Copy link
Member

commented Feb 11, 2014

Well then you may need to update your command map to point to the absolute path of composer, or use default_env to update your path like (wherever composer is):

set :default_env, { path: "/usr/local/bin:$PATH" }

Either way, this isn't a Bedrock issue as we don't include any server configuration yet. I suggest checking into Capistrano docs/help and/or SSHKit. Or you can post in the Roots discourse forum.

@jfrux

This comment has been minimized.

Copy link
Author

commented Feb 11, 2014

That fixed it! Thank you!
On Feb 11, 2014, at 5:09 PM, Scott Walkinshaw notifications@github.com wrote:

Well then you may need to update your command map to point to the absolute path of composer, or use default_env to update your path like (wherever composer is):

set :default_env, { path: "/usr/local/bin:$PATH" }
Either way, this isn't a Bedrock issue as we include any server configuration yet. I suggest checking into Capistrano docs/help and/or SSHKit. Or you can post in the Roots discourse forum.


Reply to this email directly or view it on GitHub.

@swalkinshaw

This comment has been minimized.

Copy link
Member

commented Feb 11, 2014

Can you post exactly what you changed for reference? Helps if someone else comes across this issue.

@jfrux

This comment has been minimized.

Copy link
Author

commented Feb 11, 2014

Well, it will definitely be different for everyone but you just set this line in your deploy.rb
SSHKit.config.command_map[:composer] = "~/bin/composer"

Mine happened to be under the current user's "bin" directory. But it could be anywhere, really.
Thanks again!

@reneruiz

This comment has been minimized.

Copy link

commented Mar 16, 2014

I have both lines in deploy.rb:

set :default_env, { path: "/usr/local/bin:$PATH" }
SSHKit.config.command_map[:composer] = "/usr/local/bin/composer"

and I'm still getting the composer stdout error:

INFO [17eba5fc] Running /usr/local/bin/composer install --no-dev --no-scripts --quiet --optimize-autoloader on staging.thisisreneruiz.com
cap aborted!
composer stdout: Nothing written
composer stderr: Nothing written

I even tried installing composer with Capistrano's available tasks:
$ cap staging composer:install_executable

I've tried rebooting the machine. Based on those two links that @swalkinshaw posted, I updated memory_limit in php.ini from -1 to 512M, although the DigitalOcean droplet I'm using is only configured with 512MBs. Could that be why?

EDIT:

Okay, looks like I had to add this to staging.rb for it to work:

SSHKit.config.command_map[:composer] = "/var/www/staging.thisisreneruiz.com/shared/composer.phar"

That was the location that $ cap staging composer:install_executable installed the executable, too. Kind of an ugly solution. 😕

@swalkinshaw

This comment has been minimized.

Copy link
Member

commented Mar 16, 2014

Shouldn't have anything to do with memory. I would remove the default_env line and just go with the command map.

Please try with log_level set to debug and see what the output says. It should give you the exact shell command being run and you can further debug by trying to manually run it on your remote server.

@goellner

This comment has been minimized.

Copy link

commented May 5, 2014

I have similar problem with my deployment process. I set the default env to "set :default_env, { path: "/usr/local/bin:$PATH" }" and additionally added this line "SSHKit.config.command_map[:composer] = "/usr/local/bin/composer"". Now I wonder if i get this whole thing right. Does composer has to be installed on my server or just on my local machine? I have composer installed on my local machine and it is in the /usr/local/bin folder.

The error looks like this:
DEBUG [1af3225b] bash: /usr/local/bin/composer: No such file or directory

@swalkinshaw

This comment has been minimized.

Copy link
Member

commented May 5, 2014

@byrus It's executing that command on the remote server. So you need Composer installed there and the command map should reference the path on the remote server.

@kjprince

This comment has been minimized.

Copy link

commented May 18, 2014

I had a similar issue.

Capistrano deployment would throw an error when attempting to run the composer tasks.

 INFO [44095e89] Running /usr/bin/env composer install --no-dev --prefer-dist --no-interaction --quiet --optimize-autoloader on 162.243.247.167
cap aborted!
SSHKit::Command::Failed: composer stdout: Nothing written
composer stderr: Nothing written

I installed composer on my remote server, in my user directory (~/kj or /home/kj) as shown in the docs.

Then I moved composer.phar to enable the composer command globally:
mv composer.phar /usr/local/bin/composer

Everything works fine now.

@cfxd

This comment has been minimized.

Copy link

commented Aug 31, 2014

I am now running into this issue. The only thing about my local setup that changed is that I am directly plugged into my router now instead of using my WiFi. Not sure if that would make any difference. I'm still able to SSH into my shared host and running composer with php-cli /home4/cfxdesig/composer.phar works fine.

Here is my complete deploy log: http://pastebin.com/1WB4AyVu

There are failures on lines 73, 76, 82, 85, and 94 but from what I remember these have been present all along and deploys have been fine. It's been about a month since my last successful deploy.

Any troubleshooting help would be great guys. Thanks!

@etcook

This comment has been minimized.

Copy link
Contributor

commented Aug 31, 2014

Have you tried going into the written deploy directory on the remote server and running composer install manually to see what the error is?

@cfxd

This comment has been minimized.

Copy link

commented Aug 31, 2014

@etcook thank you!

Noob mistake. I thought for sure the written deploy dir would be removed if the deploy was unsuccessful. Shame on me for not checking.

Running composer install in the deploy dir threw an error with my lock file which I tracked down to having updated a few plugin versions in composer.json but I never performed an update so the lock file contained outdated dependencies.

Thanks again!

@jfrux

This comment has been minimized.

Copy link
Author

commented Nov 23, 2015

Since this is top result for google... figured I'd post this other thing that helped resolve my issues for some strange reason...

added:

set :composer_install_flags, '--no-dev --no-interaction --optimize-autoloader'

by removing the --quiet from the default install flags it helped resolve it... must have given capistrano what it needed to ensure it completed correctly...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.