phive icon indicating copy to clipboard operation
phive copied to clipboard

"Creating directory failed" in GitLab CI

Open JanWennrichPCSG opened this issue 4 months ago • 5 comments

When executing phive install in GitLab CI as a non-root user, a "creating directory failed" error occurs.

You can see an example here: https://dev.quiqqer.com/quiqqer/quiqqer/-/jobs/6108

I tried to debug this and came to the following conclusion:

  • the repository/project is automatically cloned by GitLab CI with the root user as the owner and chmod 666 (see example)
  • the user executing phive install is www-data (see example)
  • if the phive.xml already exists, the method PharIo\FileSystem\Directory->ensureExists() tries to chmod the project directory (see code)
  • as the executing user is www-data and thus does not own the project directory, the chmod fails due to lack of permission

Am I doing something wrong or is this a bug? Is PHIVE even meant to be used in CI to install tooling? Is it correct to use the phive.xml file or should I use a different file for that?

JanWennrichPCSG avatar Feb 21 '24 10:02 JanWennrichPCSG