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

Problem when deploy wordpress app #17

Open
gwmoura opened this issue Apr 24, 2016 · 3 comments
Open

Problem when deploy wordpress app #17

gwmoura opened this issue Apr 24, 2016 · 3 comments

Comments

@gwmoura
Copy link
Contributor

gwmoura commented Apr 24, 2016

I have a wordpress app running normally, but when I tryed update it, I receive this error:

remote: Processing triggers for sgml-base (1.26+nmu4ubuntu1) ...
remote:  * Stopping Apache httpd web server apache2
remote:  * 
remote: update-rc.d: /etc/init.d/apache2 exists during rc.d purge (use -f to force)
remote: /usr/bin/env: php: No such file or directory
remote: Traceback (most recent call last):
remote:   File "/var/lib/tsuru/php/deploy.py", line 209, in <module>
remote:     manager.install()
remote:   File "/var/lib/tsuru/php/deploy.py", line 92, in install
remote:     self.install_composer()
remote:   File "/var/lib/tsuru/php/deploy.py", line 109, in install_composer
remote:     raise InstallationException('Unable to install composer dependencies')
remote: __main__.InstallationException: Unable to install composer dependencies
remote: Installing system packages...
remote: Install composer dependencies
remote: Composer is not found locally, downloading it
remote: 2016/04/24 15:37:24 exit status 1
remote: Exit status 1
To [email protected]:iblvwordpress.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:iblvwordpress.git'

The error occur in this line - https://github.com/tsuru/platforms/blob/master/php/deploy.py#L108

if os.system('cd %s && %s install' % (self.application.get('directory'), composer_phar)) != 0:
                raise InstallationException('Unable to install composer dependencies')

Accessing the container and following this steps to simulate the error, I receive this error:

$ tsuru app-shell
ubuntu@67bd6a2c8453:/$ cd /home/application/current/
ubuntu@67bd6a2c8453:/home/application/current$ python -c 'import os; os.system("cd /home/application/current && ./composer.phar install")'
Cannot create cache directory /home/ubuntu/.composer/cache/repo/http---wpackagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/ubuntu/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/ubuntu/.composer/cache/files/, or directory is not writable. Proceeding without cache
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update


  [ErrorException]                                                                                                       
  file_put_contents(/home/application/current/vendor/composer/installed.json): failed to open stream: Permission denied  


install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]...

Running with sudo the script is executed normally:

$ python -c 'import os; os.system("cd /home/application/current && sudo ./composer.phar install")'
Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files

I think if we change os.system('cd %s && %s install' % (self.application.get('directory') to os.system('cd %s && sudo %s install' % (self.application.get('directory'), composer_phar)), composer_phar))` this problem is resolved.

@jroquejr
Copy link

@gwmoura, you had progress with this?

@morpheu
Copy link
Member

morpheu commented Jan 31, 2017

@gwmoura could you check if this still happen? I've updated php platform and tested composer with success.

@gwmoura
Copy link
Contributor Author

gwmoura commented Nov 10, 2017

@morpheu @jroqueweb I'm sorry, I gonna test and return with a feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants