phar-io / phive

The Phar Installation and Verification Environment (PHIVE)
https://phar.io
BSD 3-Clause "New" or "Revised" License
579 stars 43 forks source link

Creating directory failed #401

Closed gam04 closed 1 year ago

gam04 commented 1 year ago

Hi there.

I have an issue running phive update on WSL , i get the following output :

Phive 0.15.2 - Copyright (C) 2015-2023 by Arne Blankerts, Sebastian Heuer and Contributors
[ERROR]    An error occurred while processing your request:

          Creating directory "./tools" failed.

          #0 vendor/phar-io/filesystem/src/Directory.php(79)
          #1 src/shared/config/PhiveXmlConfig.php(231): PharIo\FileSystem\Directory->ensureExists()
          #2 src/shared/config/PhiveXmlConfig.php(129): PharIo\Phive\PhiveXmlConfig->nodeToConfiguredPhar()
          #3 src/commands/update/UpdateCommandConfig.php(64): PharIo\Phive\PhiveXmlConfig->getPhars()
          #4 src/commands/update/UpdateCommandConfig.php(43): PharIo\Phive\UpdateCommandConfig->getPharAliasesFromPhiveXmlConfig()
          #5 src/commands/update/UpdateCommand.php(45): PharIo\Phive\UpdateCommandConfig->getRequestedPhars()
          #6 src/shared/cli/Runner.php(241): PharIo\Phive\UpdateCommand->execute()
          #7 src/shared/cli/Runner.php(95): PharIo\Phive\Cli\Runner->execute()
          #8 (354): PharIo\Phive\Cli\Runner->run()
          #9 {main}

          Environment: PHP 8.1.14 (on Linux 5.15.79.1-microsoft-standard-WSL2)
          Phive Version: 0.15.2

          This should not have happened and is most likely a bug.
          Please report it at https://github.com/phar-io/phive/issues, make sure you include
          the full output of this error message. Thank you!

The directory ./tools in fact, is created but the process stop with the above message.

I have installed phive on WSL using the instructions on the official website

Thanks for you support 💯

theseer commented 1 year ago

I'm not sure how to reproduce this:

theseer@VirtualWin11:~/test$ pwd
/home/theseer/test

theseer@VirtualWin11:~/test$ php phive.phar update
Phive 0.15.2 - Copyright (C) 2015-2023 by Arne Blankerts, Sebastian Heuer and Contributors
Copying phpab-1.27.1.phar to /home/theseer/test/tools/phpab

It seems to work fine for me on my virtualbox based Windows 11 with WSL 1. (I apparently can't use WSL 2 within VirtualBox)...

Is there anything special about the location where the ./tools-folder should be created? Any permission issues or some such?

theseer commented 1 year ago

Ping?

gam04 commented 1 year ago

It was a permission issue.

It seems the phive directory was touched by some process in my system.

Thanks.

theseer commented 1 year ago

Thanks for the feedback :)