2

I'm getting this error while trying to deploy my Symfony2 application to production server.

--> Downloading Composer
  * executing "sh -c 'cd /home/myproject/releases/20150427081943 && curl -s http://getcomposer.org/installer | php'"

Preparing to execute command: "sh -c 'cd /home/myproject/releases/20150427081943 && curl -s http://getcomposer.org/installer | php'"
Execute ([Yes], No, Abort) ?  |y|  y

  servers: ["myproject.net"]
    [myproject.net] executing command
 ** [out :: myproject.net] <html>
 ** [out :: myproject.net] <head><title>302 Found</title></head>
 ** [out :: myproject.net] <body bgcolor="white">
 ** [out :: myproject.net] <center><h1>302 Found</h1></center>
 ** [out :: myproject.net] <hr><center>nginx</center>
 ** [out :: myproject.net] </body>
 ** [out :: myproject.net] </html>
    command finished in 156ms

So curl -s http://getcomposer.org/installer|php command returns 302 and i'm not shure how to fix this in my script.

I've seen on getcomposer.org that curl uses additional -S flag with the -s flag, like this curl -sS http://getcomposer.org/installer|php

j0k
  • 22,600
  • 28
  • 79
  • 90
3ND
  • 430
  • 1
  • 6
  • 17

1 Answers1

1

A couple of hours ago, the Composer website (https://getcomposer.org/) started redirecting all HTTP traffic to HTTPS using 302 responses.

The issue is, however, that Capifony still points to the HTTP location of the installer, and curl doesn't follow the redirect because the -L / --location flag isn't set.

You aren't the only one with this problem, and the guys of Capifony are already working on this.

In the meanwhile, see this answer on another question for a workaround:

To circumvent capifony downloading from the wrong url I added:

task :download_composer do
  run "cd " + release_path + " && curl -s https://getcomposer.org/installer | php"
end

before "symfony:composer:update", "download_composer"
before "symfony:composer:install", "download_composer"

This works because capifony checks if composer.phar is already present, if it is it'll warn you but just continue anyway

Update: the issue has now been fixed, update Capifony to version 2.8.5.

Community
  • 1
  • 1
Nic Wortel
  • 11,155
  • 6
  • 60
  • 79
  • I'm reffering to capifony error, 302 thing is obvious. I'm trying to fix this by overriding capifony task which downloads composer but i don't know how. I don't even know if its possible in deploy.rb script or the capifony core should take care of that – 3ND Apr 27 '15 at 08:54
  • I'm sorry, I guess I didn't read your question well enough. I've updated my answer. I also found someone else asking the same question, so I've marked this one as a duplicate. – Nic Wortel Apr 27 '15 at 09:25