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

Validate that Phar exists upstream before executing update #7

Open
grasmash opened this issue Feb 26, 2021 · 0 comments
Open

Validate that Phar exists upstream before executing update #7

grasmash opened this issue Feb 26, 2021 · 0 comments

Comments

@grasmash
Copy link
Contributor

We recently had our phar build job on Travis fail. The release was made, but the phar was not attached. Running the self-update command produced:

Notice: Undefined offset: 0 in phar:///usr/local/bin/acli/vendor/consolidation/self-update/src/SelfUpdateCommand.php on line 94

Notice: Trying to get property 'browser_download_url' of non-object in phar:///usr/local/bin/acli/vendor/consolidation/self-update/src/SelfUpdateCommand.php on line 94
Downloading Acquia CLI (acquia/cli) 1.7.1

Fatal error: Uncaught TypeError: Argument 1 passed to Symfony\Component\Filesystem\Filesystem::copy() must be of the type string, null given, called in phar:///usr/local/bin/acli/vendor/consolidation/self-update/src/SelfUpdateCommand.php on line 150 and defined in phar:///usr/local/bin/acli/vendor/symfony/filesystem/Filesystem.php:37
Stack trace:
#0 phar:///usr/local/bin/acli/vendor/consolidation/self-update/src/SelfUpdateCommand.php(150): Symfony\Component\Filesystem\Filesystem->copy(NULL, '/usr/local/bin/...')
#1 phar:///usr/local/bin/acli/vendor/symfony/console/Command/Command.php(255): SelfUpdate\SelfUpdateCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 phar:///usr/local/bin/acli/vendor/symfony/console/Application.php(989): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 phar:///usr/local/bin/acli/vendor/symfony/console/Application.p in phar:///usr/local/bin/acli/vendor/symfony/filesystem/Filesystem.php on line 37

Note the Symfony\Component\Filesystem\Filesystem->copy(NULL, '/usr/local/bin/...')

The self-update library should fist check to see if the phar exists, and if it does not, it should throw an informative exception like "No Phar file is attached to the x.y.z release on GitHub."

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

1 participant