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

composer (and /usr/local/bin) need to be writeable in web image #2614

Closed
rfay opened this issue Nov 6, 2020 · 3 comments
Closed

composer (and /usr/local/bin) need to be writeable in web image #2614

rfay opened this issue Nov 6, 2020 · 3 comments
Milestone

Comments

@rfay
Copy link
Member

rfay commented Nov 6, 2020

Describe the bug

composer (and /usr/local/bin) need to be writeable in web image

To Reproduce

$ ddev exec composer self-update --1
Warning: You forced the install of 1.10.17 via --1, but 2.0.4 is the latest stable version. Updating to it via composer self-update --stable is recommended.
Upgrading to version 1.10.17 (1.x channel).



  [Composer\Downloader\FilesystemException]
  Filesystem exception:
  Composer update failed: "/usr/local/bin/composer" could not be written.
  rename(/usr/local/bin/composer): Failed to open stream: Permission denied
@rfay rfay added this to the v1.16 milestone Nov 6, 2020
@digchris
Copy link

digchris commented Nov 7, 2020

Hi, I got exactly the same error when attempting to upgrade composer on my Ubuntu 20.04 system running:

Docker version 19.03.13, build 4484c46d9d and
DDEV-Local version v1.15.3
commit v1.15.3
db drud/ddev-dbserver-mariadb-10.2:v1.15.1
dba phpmyadmin/phpmyadmin:5
ddev-ssh-agent drud/ddev-ssh-agent:v1.15.1
docker 19.03.13
docker-compose 1.25.0-rc4
os linux
router drud/ddev-router:v1.15.1
web drud/ddev-webserver:v1.15.3

Here is the cli response when I tried to self-update Composer:
$ ddev exec composer self-update --stable
Updating to version 2.0.6 (stable channel).
Downloading (100%)

[Composer\Downloader\FilesystemException]
Filesystem exception:
Composer update failed: "/usr/local/bin/composer" could not be written.
rename(/usr/local/bin/composer): failed to open stream: Permission denied

self-update [-r|--rollback] [--clean-backups] [--no-progress] [--update-keys] [--stable] [--preview] [--snapshot] [--1] [--2] [--set-channel-only] [--] []

Failed to execute command composer self-update --stable: exit status 1

@rfay
Copy link
Member Author

rfay commented Nov 7, 2020

You can easily use ddev exec sudo composer self-update --stable if you'd like. It has always worked. You can also update it with a custom Dockerfile, which is easier. See #2383 (comment)

@digchris
Copy link

digchris commented Nov 7, 2020

Yes, your suggestion worked a treat.
Thanks for responding :)

@rfay rfay closed this as completed in f6f475b Nov 8, 2020
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

2 participants