Virtual-environments: Wrong permissions for PHP .composer directory

Created on 4 May 2020  路  5Comments  路  Source: actions/virtual-environments

Describe the bug
When using PHP composer, it is not possible to use the composer cache, since the .composer directory permissions are wrong. This leads to the situation, that the composer cache cannot be saved during built steps

Area for Triage:

Error Message:

Cannot create cache directory /home/runner/.composer/cache/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/runner/.composer/cache/files/, or directory is not writable. Proceeding without cache

Permissions:

image

Question, Bug, or Feature?:
Bug

Virtual environments affected

  • [ ] macOS 10.15
  • [ ] Ubuntu 16.04 LTS
  • [X] Ubuntu 18.04 LTS
  • [ ] Windows Server 2016 R2
  • [ ] Windows Server 2019

Expected behavior
Directory .composer must be writeable to the runner user.

Actual behavior
Directory is not writeable. As a workaround, I added sudo chmod 777 ~/.composer to my built pipeline

PHP Ubuntu awaiting-deployment bug

All 5 comments

@derhansen Hello,
Thank you for the reported issue and the investigation details. I have reproduced the issue on my side and I'm working on the fix at this time.
I will keep you posted.

@derhansen We have added fix for the issue to the image and it will be rolled out next week.
In case of any questions, please let us know, we will be glad to assist you further.

@Darleev Awesome, thanks a lot for your work!

@derhansen I have verified that after deployment .composer directory exists in home(~/) directory with the following rights:
drwxrwxrwx 2 vsts docker 4.0K May 13 03:16 .composer
I'm going to close the issue, in case of any questions feel free to open new issue:)

@Darleev Thanks, works as expected

Was this page helpful?
0 / 5 - 0 ratings

Related issues

raulpopadineti picture raulpopadineti  路  3Comments

orj picture orj  路  4Comments

MSP-Greg picture MSP-Greg  路  3Comments

shogo82148 picture shogo82148  路  3Comments

frankieroberto picture frankieroberto  路  4Comments