Composer install suddenly fails on deploy

I’ve been deploying with bedrock capistrano, and haven’t had any issues.

I attempt to update my WordPress version, and now the following error appears when running bundle exec cap production deploy :

INFO[0eb5332d] Running /usr/bin/env composer install --no-dev --prefer-dist --no-interaction --quiet --optimize-autoloader on timmygelles.com
DEBUG[0eb5332d] Command: cd ~/bedrock/releases/20151012204830 && ( WP_ENV=production /usr/bin/env composer install --no-dev --prefer-dist --no-interaction --quiet --optimize-autoloader )
DEBUG[0eb5332d] 	stdin: is not a tty
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host timmygelles.com: composer exit status: 1
composer stdout: Nothing written
composer stderr: stdin: is not a tty

Not sure how to tell if it’s an issue with my server or config setup. (As it was working on a deploy I made but 5mins prior before it stopped, I’m thinking the former)

How can I tell?

What have you tried so far?

https://www.google.com/search?q=site%3Adiscourse.roots.io+stdin%3A+is+not+a+tty

Well I’m not sure what to try as I don’t really understand the error.

Checked the server logs, nothing there

ran task with --trace but the error is the same as above as I have set :log_level, :debug in my deploy.rb

Performed a rollback which was successful, but now the site is 404’ing. Have a ticket with the server company (ASO) and will hopefully hear from them.

My composer file & deploy.rb

I’m referring to the error you pasted that appears a dozen times on this forum. Have you looked into the other threads where people have the same error and checked for any solutions there first?

yes, but their errors all seem to be variations of what i’m encountering.

I found this: Composer Install doesn’t seem to run at all during deploys, and when adding set :composer_install_flags, '--no-dev --no-interaction --optimize-autoloader to my deploy.rb, checking into repo, and then running the deploy I get the following error:

INFO[a2e71db9] Running /usr/bin/env composer install --no-dev --no-interaction --optimize-autoloader on timmygelles.com
DEBUG[a2e71db9] Command: cd ~/bedrock/releases/20151013161550 && ( WP_ENV=production /usr/bin/env composer install --no-dev --no-interaction --optimize-autoloader )
DEBUG[a2e71db9] 	stdin: is not a tty
DEBUG[a2e71db9] 	Warning: This development build of composer is over 30 days old. It is recommended to update it by running "/usr/local/bin/composer self-update" to get the latest version.
DEBUG[a2e71db9] 	stdin: is not a tty
DEBUG[a2e71db9] 	Warning: This development build of composer is over 30 days old. It is recommended to update it by running "/usr/local/bin/composer self-update" to get the latest version.
DEBUG[a2e71db9] 	
DEBUG[a2e71db9] 	
DEBUG[a2e71db9] 	                                                                          
DEBUG[a2e71db9] 	  [UnexpectedValueException]                                              
DEBUG[a2e71db9] 	Warning: This development build of composer is over 30 days old. It is recommended to update it by running "/usr/local/bin/composer self-update" to get the latest version.
DEBUG[a2e71db9] 	  Could not parse version constraint ^1.0: Invalid version string "^1.0"  
DEBUG[a2e71db9] 	                                                                          
DEBUG[a2e71db9] 	
DEBUG[a2e71db9] 	
DEBUG[a2e71db9] 	Warning: This development build of composer is over 30 days old. It is recommended to update it by running "/usr/local/bin/composer self-update" to get the latest version.
DEBUG[a2e71db9] 	install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN]
DEBUG[a2e71db9] 	Warning: This development build of composer is over 30 days old. It is recommended to update it by running "/usr/local/bin/composer self-update" to get the latest version.
DEBUG[a2e71db9] 	
DEBUG[a2e71db9] 	
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host timmygelles.com: composer exit status: 1
composer stdout: Nothing written
composer stderr: stdin: is not a tty


                                                                          
  [UnexpectedValueException]                                              
  Could not parse version constraint ^1.0: Invalid version string "^1.0"  

This “^1.0” is located in line 156 of my composer.lock file. I deleted the file, ran composer update locally, and it still occurs.

Manually removing the ^ from the composer.lock file, checking it into the repo, then deploying is what fixed the issue.

Good luck to anyone else with the same problem as this thread was unlisted because I allegedly had the same problem as everyone else. Yet no where was 'Could not parse version constraint ^1.0: Invalid version string "^1.0"' or any part of that on this forum.

This thread was unlisted because you didn’t try to figure out the problem yourself first.

I didn’t say your problem was the same as others, I asked if you looked through the other threads that had part of the error that you pasted.

Good job on figuring it out on your own. :clap: