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

Error while self-updating the application: Permission denied #60

Closed
caendesilva opened this issue Apr 17, 2024 · 3 comments · Fixed by #69
Closed

Error while self-updating the application: Permission denied #60

caendesilva opened this issue Apr 17, 2024 · 3 comments · Fixed by #69

Comments

@caendesilva
Copy link
Member

Description

A fatal error occurred while trying to update the application using the self-update command.

Error message

rename(/tmp/hydekz727D,/usr/local/bin/hyde): Permission denied on line 272 in file phar:///usr/local/bin/hyde/app/Commands/SelfUpdateCommand.php

Stack trace

#0 phar:///usr/local/bin/hyde/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(255): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}()
#2 phar:///usr/local/bin/hyde/app/Commands/SelfUpdateCommand.php(272): rename()
#3 phar:///usr/local/bin/hyde/app/Commands/SelfUpdateCommand.php(247): App\Commands\SelfUpdateCommand->replaceApplication()
#4 phar:///usr/local/bin/hyde/app/Commands/SelfUpdateCommand.php(211): App\Commands\SelfUpdateCommand->updateDirectly()
#5 phar:///usr/local/bin/hyde/app/Commands/SelfUpdateCommand.php(96): App\Commands\SelfUpdateCommand->updateApplication()
#6 phar:///usr/local/bin/hyde/vendor/illuminate/container/BoundMethod.php(36): App\Commands\SelfUpdateCommand->handle()
#7 phar:///usr/local/bin/hyde/vendor/illuminate/container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#8 phar:///usr/local/bin/hyde/vendor/illuminate/container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#9 phar:///usr/local/bin/hyde/vendor/illuminate/container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()
#10 phar:///usr/local/bin/hyde/vendor/illuminate/container/Container.php(662): Illuminate\Container\BoundMethod::call()
#11 phar:///usr/local/bin/hyde/vendor/illuminate/console/Command.php(211): Illuminate\Container\Container->call()
#12 phar:///usr/local/bin/hyde/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute()
#13 phar:///usr/local/bin/hyde/vendor/illuminate/console/Command.php(180): Symfony\Component\Console\Command\Command->run()
#14 phar:///usr/local/bin/hyde/vendor/symfony/console/Application.php(1096): Illuminate\Console\Command->run()
#15 phar:///usr/local/bin/hyde/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()
#16 phar:///usr/local/bin/hyde/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()
#17 phar:///usr/local/bin/hyde/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\Component\Console\Application->run()
#18 phar:///usr/local/bin/hyde/vendor/laravel-zero/framework/src/Kernel.php(97): Illuminate\Foundation\Console\Kernel->handle()
#19 phar:///usr/local/bin/hyde/hyde(54): LaravelZero\Framework\Kernel->handle()
#20 /usr/local/bin/hyde(14): require('...')
#21 {main}

Environment

Application version: v0.6.0
PHP version:         v8.2.12
Operating system:    Linux

Context

  • Trying to update manually installed binary at /usr/local/bin/hyde
@caendesilva
Copy link
Member Author

I think our permissions check is faulty.

Rerunning with sudo and I could install, but then got this

 sudo /usr/local/bin/hyde self-update

Checking for a new version...
=============================

A new version is available.

Updating to the latest version...
=================================

Updating the application...
Downloading the latest version...
The application has been updated successfully.
PHP Fatal error:  Uncaught ErrorException: include(): zlib: data error in phar:///usr/local/bin/hyde/.box/vendor/composer/ClassLoader.php:576
Stack trace:
#0 phar:///usr/local/bin/hyde/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(255): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 phar:///usr/local/bin/hyde/.box/vendor/composer/ClassLoader.php(576): Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}()
#2 phar:///usr/local/bin/hyde/.box/vendor/composer/ClassLoader.php(576): include('...')
#3 phar:///usr/local/bin/hyde/.box/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}()
#4 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#5 phar:///usr/local/bin/hyde/vendor/illuminate/container/Container.php(912): ReflectionClass->__construct()
#6 phar:///usr/local/bin/hyde/vendor/illuminate/container/Container.php(795): Illuminate\Container\Container->build()
#7 phar:///usr/local/bin/hyde/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Application.php(963): Illuminate\Container\Container->resolve()
#8 phar:///usr/local/bin/hyde/vendor/illuminate/container/Container.php(296): Illuminate\Foundation\Application->resolve()
#9 phar:///usr/local/bin/hyde/vendor/illuminate/container/Container.php(908): Illuminate\Container\Container->Illuminate\Container\{closure}()
#10 phar:///usr/local/bin/hyde/vendor/illuminate/container/Container.php(795): Illuminate\Container\Container->build()
#11 phar:///usr/local/bin/hyde/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Application.php(963): Illuminate\Container\Container->resolve()
#12 phar:///usr/local/bin/hyde/vendor/illuminate/container/Container.php(731): Illuminate\Foundation\Application->resolve()
#13 phar:///usr/local/bin/hyde/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Application.php(948): Illuminate\Container\Container->make()
#14 phar:///usr/local/bin/hyde/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(288): Illuminate\Foundation\Application->make()
#15 phar:///usr/local/bin/hyde/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(207): Illuminate\Foundation\Bootstrap\HandleExceptions->getExceptionHandler()
#16 phar:///usr/local/bin/hyde/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(189): Illuminate\Foundation\Bootstrap\HandleExceptions->renderForConsole()
#17 phar:///usr/local/bin/hyde/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(255): Illuminate\Foundation\Bootstrap\HandleExceptions->handleException()
#18 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}()
#19 {main}
  thrown in phar:///usr/local/bin/hyde/.box/vendor/composer/ClassLoader.php on line 576
PHP Fatal error:  Uncaught ErrorException: include(): zlib: data error in phar:///usr/local/bin/hyde/.box/vendor/composer/ClassLoader.php:576
Stack trace:
#0 phar:///usr/local/bin/hyde/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(255): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 phar:///usr/local/bin/hyde/.box/vendor/composer/ClassLoader.php(576): Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}()
#2 phar:///usr/local/bin/hyde/.box/vendor/composer/ClassLoader.php(576): include('...')
#3 phar:///usr/local/bin/hyde/.box/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}()
#4 phar:///usr/local/bin/hyde/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(244): Composer\Autoload\ClassLoader->loadClass()
#5 phar:///usr/local/bin/hyde/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(231): Illuminate\Foundation\Bootstrap\HandleExceptions->fatalErrorFromPhpError()
#6 phar:///usr/local/bin/hyde/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(255): Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown()
#7 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}()
#8 {main}
  thrown in phar:///usr/local/bin/hyde/.box/vendor/composer/ClassLoader.php on line 576

And when I try to run it to check the version I get permission denied, so I think we forgot to make the downloaded binary executable

/usr/local/bin/hyde 
bash: /usr/local/bin/hyde: Permission denied

@caendesilva
Copy link
Member Author

Part one:
Catch this with note about using sudo

[ERROR] Something went wrong while updating the application!

rename(/tmp/hyde4JMTss,/usr/local/bin/hyde): Permission denied on line 275 in file phar:///usr/local/bin/hyde/app/Commands/SelfUpdateCommand.php
For more information, run the command again with the -v option to throw the exception.

Part two:
What is this about??

PHP Fatal error: Uncaught ErrorException: include(): zlib: data error in phar:///usr/local/bin/hyde/.box/vendor/composer/ClassLoader.php:576

caendesilva added a commit that referenced this issue Apr 17, 2024
May fix `PHP Fatal error: Uncaught ErrorException: include(): zlib: data error in phar:///usr/local/bin/hyde/.box/vendor/composer/ClassLoader.php:576` see #60 (comment)
@caendesilva
Copy link
Member Author

Fixed by #69 and #65

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

Successfully merging a pull request may close this issue.

1 participant